我有一个使用QT Creator开发的应用程序。该项目构建并引用构建树中的几个共享库。当我尝试使用远程调试器调试我的项目时,我无法进入或中断任何库代码。
我尝试使用LD_LIBRARY_PATH
等设置set-solib-search-path
来修复它。
更详细的信息:
/home/debian
/home/debian/lib
ls $LD_LIBRARY_PATH
按预期显示我的所有库文件
启动GDB命令:
set solib-search-path /home/debian/lib
运行gdb /home/debian/lib/mylib.so.1
会产生以下结果:
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 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 "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lib/mylib.so.1...done.
这意味着gdb能够读取符号。
但是,在qt中调试器控制台中运行info shared library
会产生
>~"From To Syms Read Shared Object Library\n"
>~" No /home/debian/lib/mylib.so.1\n"
正在运行sharedlibrary /home/debian/lib/mylib.so.1
似乎没有做任何事情;它只是说&#34;完成&#34;。
正在运行add-symbol-file /home/debian/lib/mylib.so.1
失败
The address where /home/debian/lib/mylib.so.1 has been loaded is missing
应用程序输出屏幕在启动时显示"Could not load shared library symbols"
,并显示"Do you need "set solib-search-path" or "set sysroot"?"
但show solib-search-path
打印出来
The search path for loading non-absolute shared library symbol files is /home/debian/lib.
正如所料。
如何解决这个问题,以便我可以调试我的库?
修改 如果我在目标设备上进行调试,而不是从Qt Creator进行远程调试,gdb可以加载符号,步入库代码,并设置断点。任何人都知道我为什么不能进行远程调试?