From 7db6f30f9d4707b04e7292d7d8bfa5d37eaff67f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 6 May 2011 13:38:35 +0000 Subject: [PATCH] gdb/testsuite/ Fix a race. * gdb.cp/static-print-quit.exp (print c): Split to ... (print c - , print c - q , print c - to quit): ... these. Make the testfile untested on gdb-7.1. --- gdb/testsuite/ChangeLog | 7 ++++++ gdb/testsuite/gdb.cp/static-print-quit.exp | 25 +++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 180edc81a1..040b63aa07 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-05-06 Jan Kratochvil + + Fix a race. + * gdb.cp/static-print-quit.exp (print c): Split to ... + (print c - , print c - q , print c - to quit): + ... these. Make the testfile untested on gdb-7.1. + 2011-5-05 Janis Johnson * lib/gdb.exp (exec_target_file, exec_symbol_file, diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp index b6e34aaf44..38757df3b3 100644 --- a/gdb/testsuite/gdb.cp/static-print-quit.exp +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp @@ -30,14 +30,29 @@ clean_restart $executable gdb_test_no_output "set width 80" gdb_test_no_output "set height 2" -set test "print c" -gdb_test_multiple $test $test { - -re " = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type to continue, or q to quit---$" { +set test "print c - " +gdb_test_multiple "print c" $test { + -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type " { pass $test } + -re "\r\n---Type " { + # gdb-7.1 did not crash with this testcase but it had the same bug. + untested ${testfile}.exp + return 0 + } +} + +set test "print c - q " +gdb_test_multiple "" $test { + -re " to continue, or q " { + pass $test + } +} + +set test "print c - to quit" +gdb_test_multiple "" $test { -re " to quit---$" { - fail $test - return -1 + pass $test } }