gdb的gui用法 -tui

gdb的gui用法

调试代码的时候,只能看到下一行,每次使用list非常烦,不知道当前代码的context 

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 srcStandard layout—source on top, command window on the bottom
layout asmJust like the "src" layout, except it's an assembly window on top
layout splitThree windows: source on top, assembly in the middle, and command at the bottom
layout regOpens the register window on top of either source or assembly, whichever was opened last
tui reg generalShow the general registers
tui reg floatShow the floating point registers
tui reg systemShow the "system" registers
tui reg nextShow 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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值