首先,这个(和后续的)错误:
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
,或者它找到了错误的问题。