aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-01-03 21:46:12 +0000
committerDaniel Jacobowitz <drow@false.org>2007-01-03 21:46:12 +0000
commit2e03ee74dfa6caf2953e73ff479d6e1461528f5f (patch)
tree4e9477ffaf91610c3637b268ee877aa12758fb32 /gdb/testsuite
parent1c63d08666fbdfac21d04a80234ed97588a26563 (diff)
downloadgdb-2e03ee74dfa6caf2953e73ff479d6e1461528f5f.zip
gdb-2e03ee74dfa6caf2953e73ff479d6e1461528f5f.tar.gz
gdb-2e03ee74dfa6caf2953e73ff479d6e1461528f5f.tar.bz2
2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com> * Makefile.in (top.o): Update. * top.c (gdb_readline_wrapper_done, gdb_readline_wrapper_result) (saved_after_char_processing_hook, gdb_readline_wrapper_line) (struct gdb_readline_wrapper_cleanup, gdb_readline_wrapper_cleanup): New. (gdb_readline_wrapper): Rewrite to use asynchronous readline. 2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com> Daniel Jacobowitz <dan@codesourcery.com> * gdb.base/readline.exp: Set $TERM. Test arrow keys in secondary prompts.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/readline.exp22
2 files changed, 27 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 57f8aa6..7ee795c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.base/readline.exp: Set $TERM. Test arrow keys in
+ secondary prompts.
+
2007-01-03 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.cp/classes.exp (test_pointers_to_class_members): Update expected
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index 511cb6b..2ad8580 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -159,6 +159,14 @@ if [info exists env(INPUTRC)] {
}
set env(INPUTRC) "/dev/null"
+# The arrow key test relies on the standard VT100 bindings, so make
+# sure that an appropriate terminal is selected. The same bug
+# doesn't show up if we use ^P / ^N instead.
+if [info exists env(TERM)] {
+ set old_term $env(TERM)
+}
+set env(TERM) "vt100"
+
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
@@ -178,6 +186,18 @@ operate_and_get_next "operate-and-get-next with secondary prompt" \
"p 5" "" \
"end" ".* = 5"
+# Verify that arrow keys work in secondary prompts. The control
+# sequence is a hard-coded VT100 up arrow.
+gdb_test "print 42" "\\\$\[0-9\]* = 42"
+set msg "arrow keys with secondary prompt"
+gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
+ -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" {
+ pass $msg
+ }
+ -re ".*Undefined command:.*$gdb_prompt $" {
+ fail $msg
+ }
+}
# Now repeat the first test with a history file that fills the entire
# history list.