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.89k stars 499 forks source link

Fetch Disassembly not properly detecting gdb version #166

Closed DMLou closed 6 years ago

DMLou commented 6 years ago
Describe the issue

When trying to fetch disassembly by clicking the "fetch disassembly" button, nothing happens and I get the following error in the gdb console:

data-disassemble: Mode argument must be 0, 1, 2, or 3.

I looked at the gdbgui code a bit and I think the issue may be in the get_disassembly_format_num function. Perhaps it's not detecting the correct version for some reason?

I manually typed the following command in the gdb console and did get disassembly to appear, so it's a work-around, if not an ideal one:

-data-disassemble -f /path/to/source.cpp -l 1 -n 1000 -- 4

I'll fill in the details on my OS, gdbgui, and gdb version in the section below.

Steps to replicate
Describe your environment
cs01 commented 6 years ago

Thanks for the report!

What I think is happening is that the regular expression that tries to parse the gdb version isn't able to parse the output of your gdb binary (GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7). So the regex could be changed to account for your particular case, but I think a better solution would for me to try to run the disassembly command w/ version 4, and if it fails, suppress the error message and then just try with version 3. I will change this in the next few days.

cs01 commented 6 years ago

This has been fixed in v0.11.1.1