GDB:Cannot access memory at address

GDB调试内存访问错误

遇到这种提示,一般都是可执行文件与core文件不匹配导致,造成gdb无法找到core文件与可执行文件的符号对应关系。

解决方法有以下两种:

1.需要找到与core文件对应的可执行文件,即找到与core对应的core_test。一般都是在产生崩的机器上

2.如果实在找不到原始的可执行文件(可能由于某种不可描述的原因),可以使用与可执行文件的版本匹配的源代码重新编译,生成一个与core相匹配的可执行文件。

linux-q6be:/home/rain/tmp/gbsgapp # gdb core_test -c ./core
GNU gdb (GDB; SUSE Linux Enterprise 11) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from core_test...done.
[New LWP 5128]
[New LWP 5129]
[New LWP 5106]
[New LWP 5103]
[New LWP 5108]
[New LWP 5107]
[New LWP 5116]
[New LWP 5117]
[New LWP 5112]
[New LWP 5121]
[New LWP 5111]
[New LWP 5126]
[New LWP 5120]
[New LWP 5114]
[New LWP 5118]
[New LWP 5113]
[New LWP 5119]
[New LWP 5124]
[New LWP 5125]
[New LWP 5105]
[New LWP 5123]
[New LWP 5109]
[New LWP 5115]
[New LWP 5127]
[New LWP 5110]
[New LWP 5122]
[New LWP 5104]
Cannot access memory at address 0xffffffff00010007
Cannot access memory at address 0xffffffff0000ffff
(gdb) bt
#0  0x00007f352d855885 in ?? ()
#1  0x00007f352d856e61 in ?? ()
#2  0x0000001400000022 in ?? ()
#3  0x00007f35270f5eb0 in ?? ()
#4  0x00007f352ec94988 in ?? ()
#5  0x0000000000000010 in ?? ()
#6  0x00007f352d9614b5 in ?? ()
#7  0x0000000000000001 in ?? ()
#8  0x00007f352d834d02 in ?? ()
#9  0x0000000000000005 in ?? ()
#10 0x00007f352d962574 in ?? ()
#11 0x0000000000000003 in ?? ()
#12 0x00007f35270f5e9e in ?? ()
#13 0x0000000000000002 in ?? ()
#14 0x00007f352d9614cf in ?? ()
#15 0x0000000000000001 in ?? ()
#16 0x00007f352d96374a in ?? ()
#17 0x0000000000000003 in ?? ()
#18 0x00007f35270f5ea4 in ?? ()
#19 0x000000000000000c in ?? ()
#20 0x00007f352d96374e in ?? ()
#21 0x0000000000000002 in ?? ()
#22 0x0000000000000020 in ?? ()
#23 0x0000000000000000 in ?? ()

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值