0

我正在使用gdb来调试我的代码,仍然是初学者
我想知道如何获取实际地址
例如,给定以下汇编代码:
cmp %eax, 0x4(%rbp,%rbx,4)

我想知道与 %eax 比较的是什么,换句话说,我想知道里面有什么:0x4(%rbp,%rbx,4)

4

1 回答 1

0

If you don't know at&t syntax, switch gdb to intel syntax using set disassembly-flavor intel. Then you will see this expression is really rbp+rbx*4+4. Then read gdb help and you will find the x (examine memory) command and that you can access registers using $ prefix. Putting all this together, you should type x $rbp+$rbx*4+4 to see the contents.

于 2014-06-06T22:40:49.507 回答