user713867
user713867

Reputation:

How to reload gdbinit?

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?

Upvotes: 29

Views: 14931

Answers (2)

Eric Postpischil
Eric Postpischil

Reputation: 223503

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.

Upvotes: 30

David Souther
David Souther

Reputation: 8174

source ~/.gdbinit

http://pirate.shu.edu/~minimair/assembler/

Upvotes: 20

Related Questions