《coredump问题原理探究》Linux x86版6.8节多继承coredump例子

下面看一个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

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值