我有一个程序,在调试模式下编译。然而,当我做 ldd 时:
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00821000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0x0083c000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00921000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0x009ac000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x152fa000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0x0094d000)
...
我在这里看不到任何调试符号...
我的程序崩溃了,我在 gdb bt 中有这个输出:
#0 0x00007f2f95ca7030 in ?? ()
#1 0x00007f3013edd801 in ?? ()
#2 0x0002965300014c4c in ?? ()
#3 0x00007f305e3006c0 in ?? ()
#4 0x00007f3000000084 in ?? ()
#5 0x00007f3000000002 in ?? ()
#6 0x00007f307a57aec0 in ?? ()
#7 0x000000000494c740 in ?? ()
#8 0x00007f3092e93720 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#9 0x0000000000000030 in ?? ()
#10 0x000000000b85de60 in ?? ()
#11 0x00007f305f913000 in ?? ()
#12 0x00007f3095cbe750 in ?? ()
#13 0x00007f3089eb2390 in ?? ()
#14 0x00007f3095cc4a88 in ?? ()
#15 0x00007f30956b4d78 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#16 0x00007f3095cc3800 in ?? ()
#17 0x00007f3089eb2000 in ?? ()
#18 0x00007f3088c41230 in ?? ()
#19 0x00007f30956b4d78 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#20 0x0000000004c35488 in ?? ()
#21 0x00007f3089eb2060 in ?? ()
#22 0x00007f3095cbe738 in ?? ()
#23 0x00007f30952c83a1 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#24 0x00007f309535f567 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#25 0x00007f30953349a2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#26 0x00007f30954176ce in QScriptValue::call(QScriptValue const&, QList<QScriptValue> const&) () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
... (Readable backtrace from my code)
所以我的问题是,如何链接到 libc6 的调试版本?如果我知道要传递给编译器的内容,那么我可以将其放入 qmake 文件中,以便以这种方式编译。
我也安装了 libc6-dbg。
谢谢。