如何在gdb启动时加载.gdbinit? [英] How do I load .gdbinit on gdb startup?

查看:333
本文介绍了如何在gdb启动时加载.gdbinit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个看似微不足道的问题,但我找不到简单的方法来实现.

This is a seemly trivial question but I can't find a simple way to accomplish this.

我在与gdb.exe存在的目录下定义了.gdbinit文件,该文件位于编译器的bin目录中.但是,当我运行gdb时,我得到了:

I have my .gdbinit file defined in the same directory as where gdb.exe exist -- that is inside my compiler's bin directory. However, when I run gdb I get this:

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".

我在此处查阅了有关自动加载的手册.但这与保留我添加的新安全路径无关!退出gdb并再次启动它,我添加的安全路径都消失了.

I looked up the manual about auto-loading here but it has nothing about keeping that new safe-path I added saved! Exiting gdb and starting it up again and the safe-paths I added are gone.

我的.gdbinit包含我在启动时始终要加载的设置.加载.gdbinit可能与环境无关,但是在Windows下执行此操作的最简单方法是什么?还有一个限制,即.gdbinit不能驻留在我的主目录中-它必须与gdb.exe可执行文件位于同一路径.

My .gdbinit contains settings that I always want loaded upon startup. Loading .gdbinit is probably environment agnostic but what's the simplest way to do this under Windows? There is an addition constraint that .gdbinit cannot reside in my home directory -- it must be in the same path as the gdb.exe executable.

推荐答案

我将.gdbinit文件定义在与gdb.exe存在的目录相同的目录中

I have my .gdbinit file defined in the same directory as where gdb.exe exist

放入您的$HOME当前目录中.

这篇关于如何在gdb启动时加载.gdbinit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆