如何保存“设置solib-search-path” [英] how to save "set solib-search-path"
问题描述
我想知道linux gdb调试。
I wonder linux gdb debugging.
我有1个执行文件,1个核心转储文件。
这样,我就这样在linux
中打开了它,
I have 1 execute file, 1 core dump file. so, I opened it in linux like this,
gdb exefilename -c exefuilename.core
但是,我只显示错误消息。
but, I only show error message.
warning: Could not load shared library symbols for 44 libraries, e.g. /usr/local/lib/libboost_system.so.1.55.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
所以,我输入命令,
set solib-search-path /librarypath/
和符号读取成功。
,然后输入命令
and symbol read succeed. and, I input command
quit
,然后我重新打开转储文件。像这样
and, I reopen dump file. like this,
gdb exefilename -c exefuilename.core
,但仍显示相同的错误消息。
but still show same error message.
warning: Could not load shared library symbols for 44 libraries, e.g. /usr/local/lib/libboost_system.so.1.55.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
我不想再显示此错误消息。
因此,我想保存库搜索路径。
我该怎么办?
I don't want to show this error message never. so, I want to save library search path. how Can I do?
推荐答案
您可以创建一个名为 .gdbinit
您可以将其放在您的主文件夹(它将为所有项目加载)或当前目录中(并将用于从该文件夹加载的gdb会话)。
You can put this either in your home folder (and it will be loaded for all projects) or in your current directory (and it will be used for gdb sessions loaded from this folder).
周围有很多有趣的例子,说明了各种复杂性。我会很简单地开始-只需在本地文件夹中创建一行 .gdbinit
There are a bunch of interesting examples of various complexity around. I'd keep it simple to start with - just create a .gdbinit
in your local folder with that one line
set solib-search-path /librarypath/
以后再添加更多。
这篇关于如何保存“设置solib-search-path”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!