tags:

views:

17

answers:

1

How can I set up gdb so that it saves the command history? When starting a new gdb session I'd like to use the arrow up keys to access the commands of the previous sessions.

+2  A: 

Create a file $HOME/.gdbinit with the following content:

set history filename ~/.gdb_history
set history save
Just found this out for myself and thought I'd share it on SO.
For next time, it's perfectly legitimate to create such self-answered questions as non-community-wiki. :)
Greg Hewgill