Enable GDB command history

September 23, 2020

gdb logo

By default, command history is disabled in gdb. It can be activated using the GDB configuration file: .gdbinit

You can add the following command to your .gdbinit to enable command history:

set history save on

Beware that gdb will create a .gdb_history file where you run gdb. I recommend to add this file to your .gitignore

Good night! Stay safe, clean code!