【发布时间】:2018-11-15 00:41:37
【问题描述】:
我有一个非常基本的程序,我用
编译gcc -m32 -g -o hello32.out hello.c
当我在 gdb 中运行 disassemble main 时,我得到以下输出:
0x0000051d <+0>: lea ecx,[esp+0x4]
0x00000521 <+4>: and esp,0xfffffff0
0x00000524 <+7>: push DWORD PTR [ecx-0x4]
0x00000527 <+10>: push ebp
0x00000528 <+11>: mov ebp,esp
0x0000052a <+13>: push ebx
0x0000052b <+14>: push ecx
0x0000052c <+15>: sub esp,0x10
0x0000052f <+18>: call 0x420 <__x86.get_pc_thunk.bx>
0x00000534 <+23>: add ebx,0x1aa4
0x0000053a <+29>: mov DWORD PTR [ebp-0xc],0x0
... [truncated for brevity]
但是,当我跑步时
(gdb) break main
(gdb) run
(gdb) info register eip
我明白了
eip 0x5655553a 0x5655553a <main+29>
为什么main+29在汇编转储中显示为0x0000053a,而在给出eip地址时却显示为0x5655553a?
【问题讨论】: