Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload gdbinit?

Tags:

c

debugging

gdb

Is there a way to reload .gdbinit file.

Assume that you are already working in gdb, and you have made changes to .gdbinit, and want to reload the new .gdbinit without disturbing the present gdb environment.

Is this possible?


1 Answers

You can execute the commands in .gdbinit (or any other file) with the source command. E.g., source .gdbinit will execute the commands in the .gdbinit in your current directory. You will need to specify the path if you want to use another .gdbinit, such as source ~/.gdbinit for the one in your home directory.

This will only execute the commands currently in the file; it will not reset or undo the commands that were previously in the file. So it will update any definitions or settings the current commands make, but it will not erase or undo any old definitions or settings.

like image 139
Eric Postpischil Avatar answered Sep 09 '25 18:09

Eric Postpischil