gdb的gui用法
http://beej.us/guide/bggdb/#compiling
簡單來說就是在以往的gdb開始的時候添加一個-tui選項.有的版本已經有gdbtui這個程序了
在linux自帶的終端里是正常顯示的,但是在securecrt里面,可能由於編碼的問題,邊緣會有些亂碼,不過不影響使用(如果你的程序有錯誤輸出,會擾亂整個界面,所以在調試的時候,建議添加2>/dev/null,這樣的話基本可用)
啟動gdb之后,上面是src窗口,下面是cmd窗口,默認focus在src窗口的,這樣的話上下鍵以及pagedown,pageup都是在移動顯示代碼,並不顯示上下的調試命令.這個時候要切換focus,具體可簡單參見
(gdb) info win 查看當前focus
SRC (36 lines) <has focus>
CMD (18 lines)
(gdb) fs next 切換focus Focus set to CMD window. (gdb) info win SRC (36 lines) CMD (18 lines) <has focus> (gdb) fs SRC 切換指定focus Focus set to SRC window. (gdb)
(Window names are 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 exclusively.)
And here is a screenshot of what you'll see, approximately:
In TUI mode, the layout command controls which windows you see. Additionally, the tui reg allows control of the register window, and will open it if it's not already open.
The commands are:
| layout src | Standard layout—source on top, command window on the bottom |
| layout asm | Just like the "src" layout, except it's an assembly window 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 was 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 be pages of registers that aren't in the "general", "float", or "system" sets |
