aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/readline.exp
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-06-17 13:31:56 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-06-17 14:03:50 -0400
commitb58c513b7932cfb9852d66e07282b9c2379197ed (patch)
treea9ef6cd36d255b406c308352a7a8e2b8d8836e5a /gdb/testsuite/gdb.base/readline.exp
parent7d5c6c43ca8a5dd5491f4a58e977ec5501386ee3 (diff)
downloadgdb-b58c513b7932cfb9852d66e07282b9c2379197ed.zip
gdb-b58c513b7932cfb9852d66e07282b9c2379197ed.tar.gz
gdb-b58c513b7932cfb9852d66e07282b9c2379197ed.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.base/readline.exp')
-rw-r--r--gdb/testsuite/gdb.base/readline.exp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index c444285..f0490a2 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -185,11 +185,11 @@ gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
if [info exists env(GDBHISTFILE)] {
set old_gdbhistfile $env(GDBHISTFILE)
}
-if [info exists env(HISTSIZE)] {
- set old_histsize $env(HISTSIZE)
+if [info exists env(GDBHISTSIZE)] {
+ set old_gdbhistsize $env(GDBHISTSIZE)
}
set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
-set env(HISTSIZE) "10"
+set env(GDBHISTSIZE) "10"
gdb_exit
gdb_start
@@ -207,10 +207,10 @@ if [info exists old_gdbhistfile] {
} else {
unset env(GDBHISTFILE)
}
-if [info exists old_histsize] {
- set env(HISTSIZE) $old_histsize
+if [info exists old_gdbhistsize] {
+ set env(GDBHISTSIZE) $old_gdbhistsize
} else {
- unset env(HISTSIZE)
+ unset env(GDBHISTSIZE)
}
set timeout $oldtimeout1