主机上的gdb显示堆栈已损坏 [英] gdb on host shows stack is corrupt

查看:213
本文介绍了主机上的gdb显示堆栈已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在x86目标计算机上生成的应用程序核心文件.所有库和二进制文件都被剥离,因此在目标上运行时的回溯跟踪非常少,甚至没有.我仍然看到符号名称和追溯.

I have a application core file that was generated on an x86 target machine. All the libraries and binaries are stripped and so the back trace when running on the target is very minimal to nothing. i still do see the symbol name and back trace.

但是,如果我将核心文件移到主机上并在主机上运行x86的gdb,请为其提供sysroot,它抱怨以下内容.

However, if i move the core file to a host machine and run the gdb for x86 on the host, provide it with sysroot , it complains with the following.

无法在地址0x104加载内存

cannot load memory at address 0x104

任何想法/建议为什么主机在目标可以解码回溯跟踪时抱怨? 顺便说一句,我所有的代码都已经用-fPIC编译了.

Any ideas/suggestions why the host complains while the target is ok decoding the back trace? BTW, all my code has been compiled with -fPIC.

推荐答案

我执行以下操作:gdb-7.2 path_to_biniary,然后设置sysroot

i do the following: gdb-7.2 path_to_biniary , then set sysroot

尝试以下方法:

gdb /path/to/binary
(gdb) set sysroot /path/to/buildroot
(gdb) core /path/to/core_file

在内核已加载后设置sysroot(我相信您的调用会发生这种情况)为时已晚.

Setting sysroot after the core has already been loaded (as I believe happens in your invocation) is too late.

这篇关于主机上的gdb显示堆栈已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆