GDB can keep track of the commands you type during your debugging sessions, so that you can be certain of precisely what happened. Use these commands to manage the GDB command history facility.
set history filename fnameGDBHISTFILE, or to
./.gdb_history (./_gdb_history on MS-DOS) if this variable
is not set.
set history saveset history save onset history filename command. By default, this option is disabled.
set history save offset history size sizeHISTSIZE, or to 256 if this variable is not set.
History expansion assigns special meaning to the character !.
Since ! is also the logical not operator in C, history expansion
is off by default. If you decide to enable history expansion with the
set history expansion on command, you may sometimes need to
follow ! (when it is used as logical not, in an expression) with
a space or a tab to prevent it from being expanded. The readline
history facilities do not attempt substitution on the strings
!= and !(, even when history expansion is enabled.
The commands to control history expansion are:
set history expansion onset history expansionset history expansion offThe readline code comes with more complete documentation of
editing and history expansion features. Users unfamiliar with gnu Emacs
or vi may wish to read it.
show historyshow history filenameshow history saveshow history sizeshow history expansionshow history by itself displays all four states.
show commandsshow commands nshow commands +