(gdb) c
Continuing.
Error while mapping shared library sections:
/work/install/bluetooth//lib/libobexftp.so.0: No such file or directory.
Error while mapping shared library sections:
/work/install/bluetooth//lib/libc.so.6: No such file or directory.
gdb默认的搜索路径内没有
(相对与远程调试,gdb默认搜索的路径即为交叉编译器的库路径,下面我会介绍到)
因此,这里我们需要修改一下gdb默认的共享库搜索路径。
修改的办法是设置GDB的环境变量:
(gdb) show solib-absolute-prefix
The current system root is "/opt/montavista/pro/devkit/arm/v5t_le/target".
上面这个路径即GDB默认的绝对搜索路径,即交叉编译器库路径
(gdb) show solib-search-path
The search path for loading non-absolute shared library symbol files is .
(gdb) set solib-search-path /work/install/bluetooth/lib
这个路径为若在solib-absolute-prefix指定的路径内没有搜索到库,则再继续尝试从该路径进行搜索。
这点倒有点类似于系统默认库搜索路径与LD_LIBRARY_PATH的关系。
详细参考GDB手册中相关部分:
http://wiki.chinaunix.net/index.php/GDB_Manual_15_1
设置好solib-search-path后再运行程序:
(gdb) set solib-search-path /work/install/bluetooth/lib/
(gdb) c