使用Qt Creator 2.7.1和Qt 4.8.4,我创建了一个Qt库和一个简单的Qt应用程序,它动态链接到这个库。我尝试远程部署和调试我的应用程序,并在调用它们时逐步进入我的库函数。我可以成功地设置断点并进行远程调试,但是我无法使用调试器(gdb)逐步进入我的库函数。当我首次在调试模式下使用QtCreator远程启动我的应用程序时,会出现以下警告:
Could not load shared library symbols for 7 libraries, e.g. libcustom-stuff.so.1.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
我的调试器是使用Qt Creator设置的,如下图所示(请注意,我在第3张图中切换了“目标路径”和“路径”,但并没有帮助):
![enter image description here](https://istack.dev59.com/7VcEx.webp)
![enter image description here](https://istack.dev59.com/JYoRJ.webp)
![enter image description here](https://istack.dev59.com/H7asO.webp)
![enter image description here](https://istack.dev59.com/TEUsK.webp)
info sharedlibrary
我得到的回复是:
>~"From To Syms Read Shared Object Library\n"
>~"0x400007e0 0x40011bf0 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3\n"
>~" No libcustom-stuff.so.1\n"
>~"0x4006d018 0x400d7124 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtDBus.so.4\n"
>~"0x401065c4 0x4013dd18 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtXml.so.4\n"
>~"0x40172430 0x4024c1b4 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtNetwork.so.4\n"
我还确保库和应用程序都使用以下方式构建:
CONFIG+=declarative_debug
在库和应用程序的“编译输出”窗格中,我看到了“-g”标志。它们都位于文件系统上的同一个目录中,那么是什么原因导致我可以在应用程序中进行调试并设置断点,但无法进入库调用?非常感谢您的任何想法。
更新: 根据kikeenrique的建议,我尝试从我的Ubuntu主机(而不是ARM目标)加载调试符号:
GNU gdb (Ubuntu/Linaro 7.4-0~69~lucid1) 7.4
Copyright (C) 2012 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Welcome to Fluke GDB Init Script for QtCreator
Reading symbols from /home/user/proj/output/exported-nfs/home/user/libcustom-stuff.so.1.0.0...done.
(gdb)
看起来GDB至少能够加载符号。