This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [patch] Save the history by default
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb at sourceware dot org, gdb-patches at sourceware dot org
- Date: Tue, 08 Sep 2009 23:17:05 +0300
- Subject: Re: [patch] Save the history by default
- References: <20090908200537.GA14676@host0.dyn.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Tue, 8 Sep 2009 22:05:37 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org
>
> The attached patch breaks backward compatibility with reading project's
> specific ./.gdb_history files. I believe if someone is using such files
> (me not) (s)he can add there appropriate `set history filename' to local
> `.gdbinit' there. Tried a patch defaulting to ./.gdb_history and falling back
> to $HOME/.gdb_history but I find it needlessly tricky. Experienced user can
> set it straightforward way according to the needs, just the default should IMO
> cover the major user base.
How about trying both, like we do with .gdbinit?
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -81,6 +81,8 @@ registers on ARM targets. Both ARM GNU/Linux native GDB and gdbserver
> can provide these registers (requires Linux 2.6.30 or later). Remote
> and simulator targets may also provide them.
>
> +* GDB now defaults to save the command history and using a file in $HOME.
> +
> * New remote packets
>
> qSearch:memory:
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -17722,15 +17722,15 @@ list, and where it writes the command history from this session when it
> exits. You can access this list through history expansion or through
> the history command editing characters listed below. This file defaults
> to the value of the environment variable @code{GDBHISTFILE}, or to
> -@file{./.gdb_history} (@file{./_gdb_history} on MS-DOS) if this variable
> -is not set.
> +@file{$HOME/.gdb_history} (@file{$HOME/_gdb_history} on MS-DOS) if this
> +variable is not set.
>
> @cindex save command history
> @kindex set history save
> @item set history save
> @itemx set history save on
> Record command history in a file, whose name may be specified with the
> -@code{set history filename} command. By default, this option is disabled.
> +@code{set history filename} command. By default, this option is enabled.
>
> @item set history save off
> Stop recording command history in a file.
These two parts are okay (assuming the code is accepted).
Thanks.