gdb加载当前目录下.gdbinit不成功
来源:互联网 发布:液压自动车床编程 编辑:程序博客网 时间:2024/05/21 10:04
学习使用GDB时说可以通过编辑.gdbinit文件来方便下次调试相同的程序,于是直接在当前目录下编辑了一个.gdbinit的文件,如下所示:
[root@bogon base]# ll -atotal 28drwxr-xr-x. 2 root root 4096 Jun 26 04:48 .drwxr-xr-x. 3 root root 4096 Jun 26 02:16 ..-rwxr-xr-x. 1 root root 16 Jun 26 04:48 .gdbinit-rw-r--r--. 1 root root 865 Jun 26 04:32 ins.c-rwxr-xr-x. 1 root root 9486 Jun 26 04:32 insert_sort
运行GDB,提示加载不成功:
[root@bogon base]# gdbwarning: File "/home/xyy/debug_test/base/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".To enable execution of this file addadd-auto-load-safe-path /home/xyy/debug_test/base/.gdbinitline to your configuration file "/root/.gdbinit".To completely disable this security protection addset auto-load safe-path /line to your configuration file "/root/.gdbinit".For more information about this security protection see the"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:info "(gdb)Auto-loading safe path"
根据上面的提示可知,加载不成功是由于
warning: File "/home/xyy/debug_test/base/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".可以通过
1、添加“add-auto-load-safe-path /home/xyy/debug_test/base/.gdbinit”到/root/.gdbinit文件中,使该文件可以被加载;
To enable execution of this file addadd-auto-load-safe-path /home/xyy/debug_test/base/.gdbinitline to your configuration file "/root/.gdbinit".
或者
2、添加“set auto-load safe-path /”到/root/.gdbinit文件中,相当于禁用了安全路径的保护;
To completely disable this security protection addset auto-load safe-path /line to your configuration file "/root/.gdbinit".
3、也可以先运行GDB在给出上面的提示后,运行gdb命令“source .gdbinit”,临时导入.gdbinit文件。
[root@bogon base]# gdb insert_sort ...For more information about this security protection see the"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:info "(gdb)Auto-loading safe path"(gdb) source .gdbinit Breakpoint 1 at 0x4006a7: file ins.c, line 62.Breakpoint 2 at 0x4005b7: file ins.c, line 29.(gdb)
4、调用GDB时指定启动文件。
[root@bogon base]# gdb -command=.gdbinit insert_sort
0 0
- gdb加载当前目录下.gdbinit不成功
- opensuse12.2的gdb不能自动加载.gdbinit的解决方法
- mingw gdb .gdbinit
- gdb的脚本使用 -- gdbinit
- gdb的脚本使用 -- gdbinit
- osx下gdb调试如何指定目录加载动态库
- gdbinit
- gdbinit
- gdbInit
- GDB配置与.gdbinit的编写
- gdb调试——.gdbinit脚本
- writetofile(保存自定义目录下不成功)
- win10下php5.4.43 php_curl加载不成功
- 将assets目录下的数据库文件拷贝到当前应用程序下的files目录下,并加载使用
- 关于gdb警告not using untrusted file "xx/.gdbinit"
- GDB实用插件(peda, gef, gdbinit)全解
- linux下获取当前目录
- windows 下获取当前目录
- 练习4——图论总结
- NodeJs——(7)request的结构
- 实战Docker到Kubernetes技术系列视频教程
- ORACLE-023:令人烦恼的 ora-01722 无效数字
- OKHttp的基本使用
- gdb加载当前目录下.gdbinit不成功
- 网络协议系列之一:HTTP(1)
- GPIO模拟I2C
- 获取tableview上面所有的cell
- PhysicsEditor downlooad link
- Java中只有值传递,没有引用传递 !
- NodeJs——(8)http.ServerRequest的过程
- LRU Caching
- iOS Network