2013-10-03 41 views
0

如何查看gdb中第一個操作數的地址處的數據?打印命令的Gdb語法

cmp [ebp+eax], edi 

我試着使用:

print /d $ebp 
print /d $eax 

和手動添加值,使地址,但不知道下一步該怎麼做,或者如果有一個更簡單的方法...

回答

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 
+0

感謝,正是這第二美元符號我從x/d $ ebp + eax中丟失 – user2827214