summaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-09 14:17:04 +0000
committerTom Tromey <tromey@redhat.com>2011-03-09 14:17:04 +0000
commit142db50201b1b1c69ebdc2dcdb1181cde1db3b08 (patch)
tree25567526a30d415591435f0c23a0af7b70630765 /gdb/testsuite/lib
parent7403e6b3f0f7d4c4f80703486f602ee5e2c9a3dd (diff)
downloadgdb-142db50201b1b1c69ebdc2dcdb1181cde1db3b08.tar.gz
* lib/gdb.exp (inferior_exited_re): Match. leading `['. Wrap in
parentheses. (gdb_continue_to_end): Add "allow_extra" parameter. Use $command. * gdb.threads/thread-unwindonsignal.exp: Pass "allow_extra" argument to gdb_continue_to_end. * gdb.threads/interrupted-hand-call.exp: Pass "allow_extra" argument to gdb_continue_to_end. * gdb.cp/annota3.exp: Fix regex. * gdb.cp/annota2.exp: Fix regex. * gdb.base/shlib-call.exp: Pass "allow_extra" argument to gdb_continue_to_end. * gdb.base/call-signal-resume.exp: Revert earlier patch. * gdb.ada/tasks.exp: Pass "allow_extra" argument to gdb_continue_to_end.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp19
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3af8568bf44..1b601afc637 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -99,7 +99,7 @@ if ![info exists env(EXEEXT)] {
set octal "\[0-7\]+"
-set inferior_exited_re "Inferior \[0-9\]+ \\(.*\\) exited"
+set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)"
### Only procedures should come after this point.
@@ -3062,8 +3062,12 @@ proc gdb_get_line_number { text { file "" } } {
# default is used.
# COMMAND is the command to invoke. If not given, "continue" is
# used.
+# ALLOW_EXTRA is a flag indicating whether the test should expect
+# extra output between the "Continuing." line and the program
+# exiting. By default it is zero; if nonzero, any extra output
+# is accepted.
-proc gdb_continue_to_end {{mssg ""} {command continue}} {
+proc gdb_continue_to_end {{mssg ""} {command continue} {allow_extra 0}} {
global inferior_exited_re
if {$mssg == ""} {
@@ -3071,18 +3075,23 @@ proc gdb_continue_to_end {{mssg ""} {command continue}} {
} else {
set text "continue until exit at $mssg"
}
+ if {$allow_extra} {
+ set extra ".*"
+ } else {
+ set extra ""
+ }
if [target_info exists use_gdb_stub] {
if {![gdb_breakpoint "exit"]} {
return 0
}
- gdb_test "continue" "Continuing..*Breakpoint .*exit.*" \
+ gdb_test $command "Continuing..*Breakpoint .*exit.*" \
$text
} else {
# Continue until we exit. Should not stop again.
# Don't bother to check the output of the program, that may be
# extremely tough for some remote systems.
- gdb_test "continue"\
- "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|$inferior_exited_re normally).*"\
+ gdb_test $command \
+ "Continuing.\[\r\n0-9\]+${extra}(... EXIT code 0\[\r\n\]+|$inferior_exited_re normally).*"\
$text
}
}