Force gdb to read .gdbinit in current folder

GDB User Initialization File

The user initialization file contains commands that are executed upon the startup of GDB. It is located in your home directory under the path:

~/.gdbinit

Create/edit this file and add the following line to this file:

set auto-load safe-path /

This allows our programs to use a current directory initialization file, i.e. you can create a .gdbinit for each project you’re debugging.

Leave a Reply

Your email address will not be published. Required fields are marked *