您的位置:首页 > 其它

gdb常用的几个命令

2011-02-28 11:00 246 查看
官网:

http://www.gnu.org/software/gdb/documentation/

gdb

help x

x &var_name:输出变量

Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
Defaults for format and size letters are those previously used.
Default count is 1. Default address is following last thing printed
with this command or "print".
e.g.: x/24w &a 输出变量a地址后的24个字. 4*24个字节的内容。

c: continue 继续执行
s: step into
n: next, step over

b: breakpoint,usage (b main,add a breakpoint as main func) 增加断点
l: list the source,列出源代码
bt: backtrace 显示栈中的内容,相当 于 CallStack

p: 输入变量名(p var_name)

info registers:输出寄存器内容
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: