How do I load .gdbinit on gdb startup?

后端 未结 5 1018
花落未央
花落未央 2021-01-12 12:16

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

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

相关标签:
5条回答
  • 2021-01-12 12:34

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

    Put into your $HOME or into current directory.

    0 讨论(0)
  • 2021-01-12 12:35

    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
    
    0 讨论(0)
  • 2021-01-12 12:39

    For other struggling xtensa toolchain users: xt-gdb is not looking for a file named .gdbinit but rather .xt-gdbinit. Otherwise the mechanics are exactly the same as with standard gdb.

    0 讨论(0)
  • 2021-01-12 12:52

    I launch xt-gdb that comes with Xtensa tool chain with -iex -ix parameters as follows:

    xt-gdb -iex "set auto-load safe-path Path\to\gdbinit\dir" -ix Path\to\gdbinit\dir.gdbinit

    0 讨论(0)
  • 2021-01-12 12:54

    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

    0 讨论(0)
提交回复
热议问题