当我在 GDB/CentOS 中运行程序时,我在控制台中看到以下消息:
warning: File "/usr/lib64/libstdc++.so.6.0.18-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
我完全按照这个警告说的去做。我创建文件 /home/user/.gdbinit
只有一行 add-auto-load-safe-path/usr/lib64/libstdc++.so.6.0.18-gdb.py
。没有改变。即使在重新启动后,我也会看到相同的错误消息。
有什么想法是什么问题吗?
最佳答案
来自gdb docs :
set auto-load safe-path [directories]
Set the list of directories (and their subdirectories) trusted for automatic loading and execution of scripts.
这是指定目录,但你指定一个文件:
add-auto-load-safe-path /usr/lib64/libstdc++.so.6.0.18-gdb.py
你可能想做:
add-auto-load-safe-path /usr/lib64/
关于c++ - CentOS 上的 GDB 忽略 gdbinit 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21776169/