How do I load .gdbinit on gdb startup? How do I load .gdbinit on gdb startup? windows windows

How do I load .gdbinit on gdb startup?


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

Put into your $HOME or into current directory.


I use CodeSourcery arm-none-eabi-gdb.exe on Windows 7. Following the above instructions did not work in my case. Below command worked:

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


None of the above answers worked for me. The problem is that under windows there's no HOME enviroment variable set. So let's set one:Write in command line:

   set HOME=c:\users\user

where the .gdbinit should be, and where You can disable the security protection by setting it content:

set auto-load safe-path /

And from now, Your gdb will load Your local .gdbinit

c:\MinGW\bin\gdb.exe app.exe