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

No data to display in Registers #406

Closed 0400H closed 1 year ago

0400H commented 3 years ago

ENV: Ubuntu 18.04 Docker gcc/g++ 7.5.0 gdb 8.1.1 python 3.6.9

pip3 install gdbgui==0.15.0.1

image

jmp0x7c00 commented 2 years ago

same problem!!

AlEscher commented 2 years ago

I have the same issue, missing the register information aswell as the stack view as seen here: https://www.gdbgui.com/screenshots/

hffaust commented 2 years ago

Same issue, Specs as follows:

gcc (Debian 10.2.1-6) 10.2.1 20210110 GNU gdb (Debian 10.1-1.7) Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux Python 3.9.2

Giuliobell commented 2 years ago

I also have the same problem. I find a temporary solution using gdbgui console in the lower-right corner

Immagine 2022-05-16 110430

if you want to see register information you only need to write the follow command info registers r0 r1 r2 followed by the name of the registers you need to see. Each register name must be separated by a space from each other

I suggest that this is a front-end problem because, if you inspect the register information div, it has no id. Instead others element which can display data to users has it

dcabanis commented 2 years ago

Same problem here, Ubuntu 20.04, gdbgui 0.15.0.1

listentodella commented 2 years ago

same problem. Is it fixed or any other solutions?

cs01 commented 2 years ago

I am able to reproduce this, it must have broken somehow. I will have to take a look and fix this. Sorry for the inconvenience.

For now, a workaround would be to use the gdb cli to print register values.

listentodella commented 2 years ago

Any plans to fix it ? Or can I revert it to worked version ? I really love this tool !

cs01 commented 2 years ago

You should be able to install older versions from pip with pip install gdbgui==VERSION

0400H commented 1 year ago

I have tried using docker to create a standard dev environment to debug, but compiling fails with nox , and it looks like there are too many dependencies that need to be installed and configured to the correct versions.

About a year ago, VS Code did not support to view registers while debugging, but it supports now. Although there are still some small bugs, it is enough to use.

image

gregbaker commented 1 year ago

The problem seems to be the React component not producing "update commands".

When I remove the if block on lines 43-41 of get_update_cmds (https://github.com/cs01/gdbgui/blob/master/gdbgui/src/js/Registers.tsx#L34-L41) I get register values in the frontend. I don't I understand the back-and-forth between the frontend, server, and gdb well enough to propose a PR, but...

I think the condition is wrong: it's comparing store.get("inferior_program") to -1, but I think the intent is:

    if ( store.get("inferior_program") == constants.inferior_states.paused
        || store.get("inferior_program") == constants.inferior_states.running ) {
      return cmds;
    }

Even with that change: my inferior_program is "paused" when I'm sitting at a breakpoint, so the condition will still be true and stop the function there.

Is it possible the condition is backwards: we should get the register values if the inferior program is running or paused, but not in other cases?

gregbaker commented 1 year ago

If my suspicion about the condition being inverted is correct, my commit to fix it is: https://github.com/gregbaker/gdbgui/commit/eddf5e056e689226ba6de79e15f797818a03cfe6

suka97 commented 1 year ago

@gregbaker I cannot build the executable from source. When I run the executable it's stuck on "Loading application". This issue doesn't happen when running the built binary from pipx.

Has this happen to you? I couldn't find too much information regarding building from source.

image