9

これは一見些細な質問ですが、これを達成する簡単な方法が見つかりません。

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

ここでオートロードに関するマニュアルを調べましたが、追加した新しいセーフパスを保存しておくことについては何もありません! gdb を終了して再起動すると、追加した安全なパスがなくなります。

My.gdbinitには、起動時に常にロードする設定が含まれています。読み込み.gdbinitはおそらく環境に依存しませんが、Windows でこれを行う最も簡単な方法は何ですか? ホーム ディレクトリに常駐できない追加の制約があります。実行可能ファイル.gdbinitと同じパスにある必要があります。gdb.exe

4

5 に答える 5

8

gdb.exe が存在するディレクトリと同じディレクトリに .gdbinit ファイルを定義しています。

あなたの$HOMEまたは現在のディレクトリに入れます。

于 2013-03-14T01:36:45.933 に答える
7

Windows 7 で CodeSourcery arm-none-eabi-gdb.exe を使用しています。私の場合、上記の手順に従ってもうまくいきませんでした。以下のコマンドが機能しました:

arm-none-eabi-gdb.exe -x D:\CodeSourcery\bin\.gdbinit

于 2015-03-05T20:11:58.020 に答える