How can I enter commands to a gdb prompt while debugging with Eclipse CDT?

后端 未结 2 1941
野趣味
野趣味 2021-01-07 21:57

I\'m using Eclipse (Helios SR1) CDT for my C++ development. Eclipse interfaces with GDB for debugging, but I can\'t figure out how to manually enter commands to GDB while d

相关标签:
2条回答
  • 2021-01-07 22:36

    If you are not debugging under Windows, you could try the gdb TUI. It's a little awkward to get used to, and is sometimes buggy, but in general it works fairly well. You can see the code being stepped through in one window while still being able to enter commands.

    Assuming your version of gdb was built with the --enable-tui configure option, simply fire up gdb and press C-x C-a to enter the TUI. Then, to make sure you can see the code and command windows, press C-x 2 (for two-window layout) It's been a while since I've had to use the TUI, but it should work for your requirements.

    0 讨论(0)
  • 2021-01-07 22:39

    It is actually very simple.

    Start debugging (eclipse will switch to Debug Perspective). Then make sure Console View is shown. If it's not show it (Window->Show view...). In that view you will find "Display selected console" icon. Select down arrow next to it an select console named "gdb" (not gdb traces!).

    What you enter in this console is forwarded directly to gdb (you can use all gdb commands).

    0 讨论(0)
提交回复
热议问题