cs01 / gdbgui

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
https://gdbgui.com
GNU General Public License v3.0
9.9k stars 499 forks source link

Problems arise using gdbgui with mingw64 on Windows 10 x64 #258

Open pidgeon777 opened 5 years ago

pidgeon777 commented 5 years ago

Describe the bug

gdbgui doesn't seem to work as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Click on 'Load Binary' to load 'output.exe' (a simple hello world c project compiled with mingw64):

image

The following error appears after having clicked on "Load binary":

image

image

  1. Click on 'Fetch source files'. The following appears:

image

I can't see any reference to the source file where the main has been originally declared (e.g. Out_Converter.c)

  1. Click on winnt.h source file. the following error appears:

image

Expected behavior

I would expect gdbgui to correctly load the Out_Converter.c source file to start debugging the program (output.exe).

Please complete the following information:

intelhex==2.2.1 numpy==1.15.2 Pygments==2.3.1

Additional context

Add any other context about the problem here.

mingw64 is currently installed into C:\msys64:

image

I'm running gdbgui_0.13.1.1.exe with no arguments.

'Out_Converter.c' is placed into its project folder.

bjorn3 commented 5 years ago
3. Click on winnt.h source file. the following error appears:

https://github.com/cs01/gdbgui/issues/227#issuecomment-425693030 provides a solution: gdbgui --remap-sources='{"/": ""}'

pidgeon777 commented 5 years ago

First of all, thanks for the prompt reply. I tried as you suggested, but it led to a failure:

c:\Users\<USERNAME>\Downloads>gdbgui_0.13.1.1.exe --remap-sources='{"/": ""}'
The '--remap-sources' argument must be valid JSON. See gdbgui --help.
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "gdbgui\backend.py", line 956, in main
  File "json\__init__.py", line 354, in loads
  File "json\decoder.py", line 339, in decode
  File "json\decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gdbgui\backend.py", line 1013, in <module>
  File "gdbgui\backend.py", line 962, in main
NameError: name 'exit' is not defined
[13140] Failed to execute script backend
jmtoniolo commented 4 years ago

gdbgui --remap-sources='{"/": ""}' is throwing

The '--remap-sources' argument must be valid JSON. See gdbgui --help. Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Any advice?

Denmey commented 4 years ago

gdbgui --remap-sources='{"/": ""}' is throwing

The '--remap-sources' argument must be valid JSON. See gdbgui --help. Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Any advice?

Instead of command with '{"/": ""}' use this command: gdbgui --remap-sources='{\"/\": \"\"}'

But slash is not being removed while clicking on source file in filesystem subwindow anyway. However you can use dropdown menu in this window to open your sources and this will work even without this additional argument.

When I run my program, gdbgui prints following message:

The underlying gdb process has been killed. This tab will no longer function as expected.

So I sadly can't do anything with gdbgui even with those efforts. Using gdb 8.1 on Windows 10.

gpdzvapatsva commented 2 years ago

RuntimeError: Windows is not supported at this time. Versions lower than 0.14.x. are Windows compatible.

gpdzvapatsva commented 2 years ago

gdbgui --remap-sources='{"/": ""}' is throwing The '--remap-sources' argument must be valid JSON. See gdbgui --help. Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Any advice?

Instead of command with '{"/": ""}' use this command: gdbgui --remap-sources='{\"/\": \"\"}'

But slash is not being removed while clicking on source file in filesystem subwindow anyway. However you can use dropdown menu in this window to open your sources and this will work even without this additional argument.

When I run my program, gdbgui prints following message:

The underlying gdb process has been killed. This tab will no longer function as expected.

So I sadly can't do anything with gdbgui even with those efforts. Using gdb 8.1 on Windows 10.

RuntimeError: Windows is not supported at this time. Versions lower than 0.14.x. are Windows compatible.