GDB GUI usage When debugging code, only see the next line, each use list very annoying, do not know the current code context
http://beej.us/guide/bggdb/#compiling
In short, add a-tui option at the beginning of the previous gdb. Some versions already have gdbtui this program.
Linux comes with the terminal is normal display, but in the SecureCRT, may be due to coding problems, the edge will be some garbled, but does not affect the use (if your program has error output, will disrupt the entire interface, so in debugging, it is recommended to add 2>/dev/null, This is basically available)
After starting GDB, the above is the SRC window, the following is the CMD window, the default focus in the SRC window, so that the upper and lower keys and pagedown,pageup are moving the display code, do not display the upper and lower debug commands. To switch focus at this point, you can simply see
Info win View current focus SRC (lines) fs next info win SRC (lines) CMD (lines) FS src switch specifies focusfocus set to SRC window. GDB)
(Window names is case in-sensitive.)
To start in Neato and highly-recommended GUI mode, start the debugger with Gdb-tui. (For many of the examples, below, I show the output of GDB's dumb terminal mode, but in real life I use TUI mode exclu sively.)
And here's a screenshot of what's ' ll see, approximately:
In TUI mode, the Layout command controls which Windows. Additionally, the TUI Reg allows control of the Register window, and would open it if it ' s not already open.
The commands are:
Layout src |
Standard layout-source in top, command window on the bottom |
Layout asm |
Just like the "src" layout, except it's an assembly windows on top |
Layout split |
Three Windows:source on top, assembly in the middle, and command at the bottom |
Layout reg |
Opens The Register window on top of either source or assembly, whichever is opened last |
TUI Reg General |
Show the general Registers |
TUI Reg float |
Show The floating point registers |
TUI Reg System |
Show the "system" registers |
TUI Reg Next |
Show the next page of Registers-this is important because there might are pages of registers that aren ' t in the ' General ', "Float", or "system" sets |
gdb TUI Toggle window