I am not using DDD. Am using GDB command line on an ubuntu box. This answer may be useful to those who want to save their gdb history within sessions:
As per the documentation available: here, history saving is disabled by default. To enable it and to do so everytime I run gdb, I did the following:
- Edited ~/.bashrc file to have the line "export GDBHISTFILE="$HOME/.gdb_history". This will save the history in this file. You may want to keep a size check on it which is described in the link.
- Edited ~/.gdbinit to have the lines:
set history save on
set history expansion on
- ran gdb
When I quit and restarted gdb, I was able to access previous sessions commands. I use the vi mode in gdb (Esc + Enter) and doing a "Ctrl + r" shows me previous listings. Hope this helps.