gdb调试遇到的问题

Posted peki10

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gdb调试遇到的问题相关的知识,希望对你有一定的参考价值。

解决方法:http://stackoverflow.com/questions/31062010/ubuntu-14-04-gcc-4-8-4-gdb-pretty-printing-doesnt-work-because-of-python-issu

warning: File "/usr/local/lib64/libstdc++.so.6.0.21-gdb.py" auto-loading has been declined by your `auto-load safe-path\' set to "$debugdir:$datadir/auto-load". To enable execution of this file add add-auto-load-safe-path /usr/local/lib64/libstdc++.so.6.0.21-gdb.py line to your configuration file "/root/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/root/.gdbinit".


$vi ~/.gdbinit

add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py
set auto-load safe-path /

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named \'libstdcxx\'
$vi ~/.gdbinit

add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py
set auto-load safe-path /
python sys.path.append("/usr/share/gcc-4.8/python")

以上是关于gdb调试遇到的问题的主要内容,如果未能解决你的问题,请参考以下文章

linux用gdb调试遇到函数调用怎么办?

gdb调试遇到的问题

Android emulator中C代码的调试——gdb/gdbservers时遇到的坑

gdb:调试VS代码时数组中的<错误读取变量>

GDB 调试遇到??的问题

C语言:当GDB遇到复杂数据结构,两分钟带你掌握四个高效调试技巧