[PATCH 5/5] Add "save history" command

Eli Zaretskii eliz@gnu.org
Sun Jan 29 16:56:32 GMT 2023


> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Sun, 29 Jan 2023 09:21:05 -0700
> 
> PR cli/23664 points out that it would sometimes be convenient to
> immediately save the current history to a file.  This patch implements
> this feature.
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23664
> ---
>  gdb/NEWS                                |  3 +++
>  gdb/doc/gdb.texinfo                     |  8 ++++++
>  gdb/testsuite/gdb.base/save-history.exp | 36 +++++++++++++++++++++++++
>  gdb/top.c                               | 18 +++++++++++++
>  4 files changed, 65 insertions(+)
>  create mode 100644 gdb/testsuite/gdb.base/save-history.exp

The documentation parts are okay, thanks.

> +Occasionally you may want to save your history to a file.  This
> +command will do just that, saving the commands in your current session
> +to the named file.  Note that you should normally edit the saved
> +history before using @code{source} to reload it, as the @code{save
> +history} command itself will be at the end of the file.

What is the rationale for saving the "save history" command as well?
Are there any circumstances when the user might want that?


More information about the Gdb-patches mailing list