这是一个似乎微不足道的问题,但我找不到一个简单的方法来实现这一目标.
我将.gdbinit文件定义在与gdb.exe存在的目录相同的目录中 – 这是在我的编译器的bin目录中.但是,当我运行gdb时,我得到了这个:
GNU gdb (GDB) 7.5.50.20120804-cvs Copyright (C) 2012 Free Software Foundation,Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY,to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-w64-mingw32". For bug reporting instructions,please see: <http://www.gnu.org/software/gdb/bugs/>. warning: File "g:\Mingw32-4.6.3\bin\.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
我查阅了关于自动加载here的手册,但它没有任何关于保持我添加保存的新安全路径!退出gdb并再次启动它,我添加的安全路径消失了.
我的.gdbinit包含我一直希望在启动时加载的设置.加载.gdbinit可能与环境无关,但在Windows下执行此操作最简单的方法是什么?还有一个附加约束,即.gdbinit不能驻留在我的主目录中 – 它必须与gdb.exe可执行文件位于同一路径中.
I have my .gdbinit file defined in the same directory as where gdb.exe exist
放入$HOME或当前目录.