aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-05-12 06:50:26 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-06-17 14:12:19 -0400
commitbc460514b9db46a491c2c39cd118b02608742968 (patch)
treef69ab69c50811c321f6e2d66a04ceca2ffb766e1 /gdb/doc
parentb58c513b7932cfb9852d66e07282b9c2379197ed (diff)
downloadfsf-binutils-gdb-bc460514b9db46a491c2c39cd118b02608742968.zip
fsf-binutils-gdb-bc460514b9db46a491c2c39cd118b02608742968.tar.gz
fsf-binutils-gdb-bc460514b9db46a491c2c39cd118b02608742968.tar.bz2
Tweak the handling of $GDBHISTSIZE edge cases [PR gdb/16999]
When GDB reads a nonsensical value for the GDBHISTSIZE environment variable, i.e. one that is non-numeric or negative, GDB then sets its history size to 0. This behavior is annoying and also inconsistent with the behavior of bash. This patch makes the behavior of invalid GDBHISTSIZE consistent with how bash handles HISTSIZE. When we encounter a null or out-of-range GDBHISTSIZE (outside of [0, INT_MAX]) we now set the history size to unlimited instead of 0. When we encounter a non-numeric GDBHISTSIZE we do nothing. gdb/ChangeLog: PR gdb/16999 * NEWS: Mention new GDBHISTSIZE behavior. * top.c (init_history): For null or out-of-range GDBHISTSIZE, set history size to unlimited. Ignore non-numeric GDBHISTSIZE. gdb/doc/ChangeLog: PR gdb/16999 * gdb.texinfo (Command History): Mention new GDBHISTSIZE behavior. gdb/testsuite/ChangeLog: PR gdb/16999 * gdb.base/gdbhistsize-history.exp: New test.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog6
-rw-r--r--gdb/doc/gdb.texinfo9
2 files changed, 11 insertions, 4 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index ed51387..d38550a 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,11 @@
2015-06-17 Patrick Palka <patrick@parcs.ath.cx>
+ PR gdb/16999
+ * gdb.texinfo (Command History): Mention new GDBHISTSIZE
+ behavior.
+
+2015-06-17 Patrick Palka <patrick@parcs.ath.cx>
+
* gdb.texinfo (Command History): Replace occurrences of HISTSIZE
with GDBHISTSIZE.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e02f92e..9889b69 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22639,10 +22639,11 @@ Stop recording command history in a file.
@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{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.
+This defaults to the value of the environment variable @env{GDBHISTSIZE}, or
+to 256 if this variable is not set. Non-numeric values of @env{GDBHISTSIZE}
+are ignored. If @var{size} is @code{unlimited} or if @env{GDBHISTSIZE} is a
+negative number, the number of commands @value{GDBN} keeps in the history list
+is unlimited.
@end table
History expansion assigns special meaning to the character @kbd{!}.