用于打印命令的Gdb语法

时间:2013-10-03 06:48:43

标签: printing syntax gdb command

如何查看gdb中第一个操作数地址的数据?

cmp [ebp+eax], edi

我尝试使用:

print /d $ebp
print /d $eax

并手动添加值以制作地址,但不确定下一步该做什么,或者是否有更简单的方法......

1 个答案:

答案 0 :(得分:1)

(gdb) help x
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.

对于你的例子:

x/d $ebp+$eax