0

我正在使用 Eclipse 为 ARM 处理器开发和远程调试一些软件。不幸的是,我正在编写的软件是多线程的,我无法调试它。如果我在线程代码中放置一个断点,我会收到以下消息:

Child terminated with signal = 5

Child terminated with signal = 0x5

GDBserver exiting

在做了相当多的谷歌搜索之后,我找到了一个建议使用这个的“解决方案”:

strip --strip-debug libpthread.so.0

不幸的是,我仍然收到终止错误。

我非常感谢您帮助解决这个问题!

谢谢!

4

1 回答 1

1

首先,这个(和后续的)错误:

cc1.exe: error: unrecognized command line option "-fstrip-debug"

是由strip --strip-debug在 GCC 命令行中添加等引起的。这显然是虚假的事情,而不是你的谷歌搜索所建议的。(您可能需要清理您的问题以删除对这些错误的引用;它们与您的问题无关。)

所做(或应该)建议的是 usingstrip --strip-debug libpthread.so.0 而不是using strip libpthread.so.0

这是因为如果您的 libpthread.so.0 被完全剥离,GDB 将无法使用线程。

它可以被剥离调试符号(这是什么strip --strip-debug libpthread.so.0),但剥离它的所有符号(这是什么strip libpthread.so.0)是一个坏主意(TM)。

由于您(显然)不是自己在 building libpthread.so.0,因此您也不需要剥离它。

但是,您应该确认您的工具链的提供者没有搞砸它。以下命令不应该报告no symbols,实际上应该打印匹配nptl_version(作为定义的符号):

nm /path/to/target/libpthread.so.0 | grep nptl_version

假设到目前为止一切都很好,我们现在可以诊断您的问题,除了...您没有提供足够的信息 ;-( 特别是,当您运行 GDB 时,它应该打印类似的内容using /path/to/libthread_db.so.0。您可能需要寻找 GDB 控制台在 Eclipse 中,或者您可能想从命令行运行 GDB,这样您就可以准确地看到它打印的内容。

libthread_db.so.0(for host) 的版本与lipthread.so.0(for target)的版本相匹配是至关重要的。它们都应该由您的工具链供应商提供。

您的问题很可能是 GDB 根本找不到libthread_db.so.0,或者它找到了错误的问题。

于 2011-06-10T20:33:44.377 回答