2

I noticed that my command history remains only during the current session, and once I re-start ddd, say with the same process, it starts with a clean slate. Is there way I can force the latest history to persist/reload.

I couldn't find any relevant options in Edit-> Preference/GDB sessions.

I am using GNU DDD 3.3.9 (i386-redhat-linux-gnu)

sth
  • 222,467
  • 53
  • 283
  • 367
vehomzzz
  • 42,832
  • 72
  • 186
  • 216

2 Answers2

3

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:

  1. 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.
  2. Edited ~/.gdbinit to have the lines:
    set history save on
    set history expansion on
  3. 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.

Saurabh Hirani
  • 1,198
  • 14
  • 21
0

In the "Edit" -> "GDB settings...", there's "Saving of the history records on exit" (its the 18th item in DDD 3.3.11). Verify that it is checked.

I'm not sure if it exist in DDD 3.3.9...

Laurent Parenteau
  • 2,516
  • 20
  • 31