From bc460514b9db46a491c2c39cd118b02608742968 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Tue, 12 May 2015 06:50:26 -0400 Subject: 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. --- gdb/testsuite/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/testsuite/ChangeLog') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index abb0677..0f3749e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2015-06-17 Patrick Palka + PR gdb/16999 + * gdb.base/gdbhistsize-history.exp: New test. + +2015-06-17 Patrick Palka + * gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE with GDBHISTSIZE. * gdb.base/readline.exp: Likewise. -- cgit v1.1