下面看一个coredump的例子:
(gdb) bt
#0 0x08048662 in xuzhina_dump_c06_s5_ex_child::inheritFrom(char*, int) ()
#1 0x08048609 in main ()
先看一下xuzhina_dump_c06_s5_ex_child::inheritFrom的汇编:
(gdb) disassemble 0x08048662
Dump of assembler code for function _ZN28xuzhina_dump_c06_s5_ex_child11inheritFromEPci:
0x08048640 <+0>: push %ebp
0x08048641 <+1>: mov %esp,%ebp
0x08048643 <+3>: sub $0x18,%esp
0x08048646 <+6>: mov 0x8(%ebp),%eax
0x08048649 <+9>: mov (%eax),%eax
0x0804864b <+11>: mov (%eax),%eax
0x0804864d <+13>: mov 0x8(%ebp),%edx
0x08048650 <+16>: mov 0xc(%ebp),%ecx
0x08048653 <+19>: mov %ecx,0x4(%esp)
0x08048657 <+23>: mov %edx,(%esp)
0x0804865a <+26>: call *%eax
0x0804865c <+28>: mov 0x8(%ebp),%eax
0x0804865f <+31>: mov 0xc(%eax),%eax
=> 0x08048662 <+34>: mov (%eax),%eax
0x08048664 <+36>: mov 0x8(%ebp),%edx
0x08048667 <+39>: lea 0xc(%edx),%ecx
0x0804866a <+42>: mov 0x10(%ebp),%edx
0x0804866d <+45>: mov %edx,0x4(%esp)
0x08048671 <+49>: mov %ecx,(%esp)
0x08048674 <+52>: call *%eax
0x08048676 <+54>: mov 0x8(%ebp),%eax
0x08048679 <+57>: movl $0x1,0x14(%eax)
0x08048680 <+64>: leave
0x08048681 <+65>: ret
End of assembler dump.
更多内容请关注微信公众号“debugeeker", 链接为https://mp.weixin.qq.com/s/f33H2RKbl-4AkVVMsP0hig