From b58c513b7932cfb9852d66e07282b9c2379197ed Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 17 Jun 2015 13:31:56 -0400 Subject: Read $GDBHISTSIZE instead of $HISTSIZE The HISTSIZE environment variable is generally expected to be read by shells, not by applications. Some distros for example globally export HISTSIZE in /etc/profile -- with the intention that it only affects shells -- and by doing so it renders useless GDB's own mechanism for setting the history size via .gdbinit. Also, annoyances may arise when HISTSIZE is not interpreted the same way by the shell and by GDB, e.g. PR gdb/16999. That can always be fixed on a shell-by-shell basis but it may be impossible to be consistent with the behavior of all shells at once. Finally it just makes sense to not confound shell environment variables with application environment variables. gdb/ChangeLog: * NEWS: Mention that GDBHISTSIZE is read instead of HISTSIZE. * top.c (init_history): Read from GDBHISTSIZE instead of HISTSIZE. (init_main): Refer to GDBHISTSIZE instead of HISTSIZE. gdb/doc/ChangeLog: * gdb.texinfo (Command History): Replace occurrences of HISTSIZE with GDBHISTSIZE. gdb/testsuite/ChangeLog: * gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE with GDBHISTSIZE. * gdb.base/readline.exp: Likewise. --- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b970b621cee..ed513870a89 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-17 Patrick Palka + + * gdb.texinfo (Command History): Replace occurrences of HISTSIZE + with GDBHISTSIZE. + 2015-06-15 Simon Marchi * gdb.texinfo (GDB/MI Data Manipulation): Clarify usage of diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 952844efebc..e02f92eb0eb 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22635,12 +22635,12 @@ Stop recording command history in a file. @cindex history size @kindex set history size -@cindex @env{HISTSIZE}, environment variable +@cindex @env{GDBHISTSIZE}, environment variable @item set history size @var{size} @itemx set history size unlimited Set the number of commands which @value{GDBN} keeps in its history list. This defaults to the value of the environment variable -@code{HISTSIZE}, or to 256 if this variable is not set. If @var{size} +@code{GDBHISTSIZE}, or to 256 if this variable is not set. If @var{size} is @code{unlimited}, the number of commands @value{GDBN} keeps in the history list is unlimited. @end table -- cgit v1.2.1