From 2e03ee74dfa6caf2953e73ff479d6e1461528f5f Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 3 Jan 2007 21:46:12 +0000 Subject: 2007-01-03 Jan Kratochvil Daniel Jacobowitz * 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 Daniel Jacobowitz * gdb.base/readline.exp: Set $TERM. Test arrow keys in secondary prompts. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/readline.exp | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'gdb/testsuite') 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 + Daniel Jacobowitz + + * gdb.base/readline.exp: Set $TERM. Test arrow keys in + secondary prompts. + 2007-01-03 Daniel Jacobowitz * 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. -- cgit v1.1