+2011-03-07 Tom Tromey <tromey@redhat.com>
+
+ * infrun.c (print_exited_reason): Include inferior id and pid in
+ message.
+
2011-03-07 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_has_execution>: Add ptid_t
static void
print_exited_reason (int exitstatus)
{
+ struct inferior *inf = current_inferior ();
+ const char *pidstr = target_pid_to_str (pid_to_ptid (inf->pid));
+
annotate_exited (exitstatus);
if (exitstatus)
{
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason",
async_reason_lookup (EXEC_ASYNC_EXITED));
- ui_out_text (uiout, "\nProgram exited with code ");
+ ui_out_text (uiout, "[Inferior ");
+ ui_out_text (uiout, plongest (inf->num));
+ ui_out_text (uiout, " (");
+ ui_out_text (uiout, pidstr);
+ ui_out_text (uiout, ") exited with code ");
ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) exitstatus);
- ui_out_text (uiout, ".\n");
+ ui_out_text (uiout, "]\n");
}
else
{
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason", async_reason_lookup (EXEC_ASYNC_EXITED_NORMALLY));
- ui_out_text (uiout, "\nProgram exited normally.\n");
+ ui_out_text (uiout, "[Inferior ");
+ ui_out_text (uiout, plongest (inf->num));
+ ui_out_text (uiout, " (");
+ ui_out_text (uiout, pidstr);
+ ui_out_text (uiout, ") exited normally]\n");
}
/* Support the --return-child-result option. */
return_child_result_value = exitstatus;
+2011-03-07 Tom Tromey <tromey@redhat.com>
+
+ * lib/opencl.exp (skip_opencl_tests): Update for exit message
+ change.
+ * lib/mi-support.exp (mi_gdb_test): Update for exit message
+ change.
+ * lib/gdb.exp (gdb_test_multiple): Update comment. Update for
+ exit message change.
+ (skip_altivec_tests): Update for exit message change.
+ (skip_vsx_tests): Likewise.
+ (gdb_continue_to_end): Likewise. Add 'command' argument.
+ * lib/cell.exp (skip_cell_tests): Update for exit message change.
+ * gdb.threads/tls.exp: Update for exit message change.
+ * gdb.threads/thread-unwindonsignal.exp: Use
+ gdb_continue_to_end.
+ * gdb.threads/step.exp (step_it): Update for exit message change.
+ (continue_all): Likewise.
+ * gdb.threads/print-threads.exp (test_all_threads): Update for
+ exit message change.
+ * gdb.threads/interrupted-hand-call.exp: Use
+ gdb_continue_to_end.
+ * gdb.threads/execl.exp: Use gdb_continue_to_end.
+ * gdb.python/py-prettyprint.exp (run_lang_tests): Use
+ gdb_continue_to_end.
+ * gdb.hp/gdb.objdbg/objdbg02.exp: Use gdb_continue_to_end.
+ * gdb.hp/gdb.objdbg/objdbg01.exp: Use gdb_continue_to_end.
+ * gdb.hp/gdb.defects/solib-d.exp: Update for exit message change.
+ * gdb.cp/method.exp: Update for exit message change.
+ * gdb.cp/mb-templates.exp: Update for exit message change.
+ * gdb.cp/mb-inline.exp: Use gdb_continue_to_end.
+ * gdb.cp/annota3.exp: Update for exit message change.
+ * gdb.cp/annota2.exp: Update for exit message change.
+ * gdb.cell/fork.exp: Use gdb_continue_to_end.
+ * gdb.base/term.exp: Update for exit message change.
+ * gdb.base/step-test.exp (test_i): Update for exit message change.
+ * gdb.base/sigstep.exp (advance): Update for exit message change.
+ (advancei): Likewise.
+ * gdb.base/siginfo.exp: Update for exit message change.
+ * gdb.base/shlib-call.exp: Use gdb_continue_to_end.
+ * gdb.base/reread.exp: Use gdb_continue_to_end.
+ * gdb.base/langs.exp: Use gdb_continue_to_end.
+ * gdb.base/interrupt.exp: Update for exit message change.
+ * gdb.base/gdb1555.exp: Update for exit message change.
+ * gdb.base/exe-lock.exp: Use gdb_continue_to_end.
+ * gdb.base/ending-run.exp: Update for exit message change.
+ * gdb.base/chng-syms.exp: Update for exit message change.
+ * gdb.base/checkpoint.exp: Update for exit message change.
+ * gdb.base/catch-syscall.exp (check_for_program_end): Use
+ gdb_continue_to_end.
+ (test_catch_syscall_with_wrong_args): Likewise.
+ * gdb.base/call-signal-resume.exp: Use gdb_continue_to_end.
+ * gdb.base/break-interp.exp (test_ld): Update for exit message
+ change.
+ * gdb.base/bang.exp: Update for exit message change.
+ * gdb.base/attach.exp (do_attach_tests): Use gdb_continue_to_end.
+ (do_call_attach_tests): Likewise.
+ * gdb.base/a2-run.exp: Update for exit message change.
+ * gdb.arch/ppc-dfp.exp: Update for exit message change.
+ * gdb.ada/tasks.exp: Use gdb_continue_to_end.
+ * gdb.ada/catch_ex.exp: Use gdb_continue_to_end.
+
2011-03-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/help.exp (help thread find): Fix one forgotten quote.
"Continuing\.$eol$catchpoint_msg$eol.*SPOT4" \
"continuing to unhandled exception"
-gdb_test "continue" \
- "Continuing\..*Program exited.*" \
- "continuing to program completion"
+gdb_continue_to_end
# Now, resume the execution and make sure that GDB does not stop when
# task 4 hits the breakpoint. Continuing thus results in our program
# running to completion.
-gdb_test "continue" \
- ".*Program exited normally\..*" \
- "continue until end of program"
+gdb_continue_to_end
# When the prompt comes back we'll be at the Set DFP rounding mode breakpoint.
# Unless the program bails out after checking AT_HWCAP.
gdb_expect {
- -re "Program exited with code 01.\[\r\n\]+$gdb_prompt $" {
+ -re "$inferior_exited_re with code 01.\[\r\n\]+$gdb_prompt $" {
unsupported "This machine doesn't support Decimal Floating Point."
return -1
}
set timeout 120
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
- "Program exited normally" {
+ "$inferior_exited_re normally" {
unresolved "run \"$testfile\" with no args"
}
-re "usage: factorial <number>" {
gdb_expect -re "$gdb_prompt $" {}
} else {
gdb_expect {
- -re ".*usage: factorial <number>.*Program exited with code 01\.\r\n$gdb_prompt $" {
+ -re ".*usage: factorial <number>.*$inferior_exited_re with code 01.\r\n$gdb_prompt $" {
pass "run \"$testfile\" with no args"
pass "no spurious messages at program exit"
}
- -re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
+ -re ".*usage: factorial <number>.*$inferior_exited_re with code 01.*$gdb_prompt $" {
pass "run \"$testfile\" with no args"
fail "no spurious messages at program exit"
}
- -re ".*usage: factorial <number>.* EXIT code 1.*Program exited normally\.\r\n$gdb_prompt $" {
+ -re ".*usage: factorial <number>.* EXIT code 1.*$inferior_exited_re normally.\r\n$gdb_prompt $" {
pass "run \"$testfile\" with no args (exit wrapper)"
pass "no spurious messages at program exit"
}
- -re ".*usage: factorial <number>.* EXIT code 1.*Program exited normally.*$gdb_prompt $" {
+ -re ".*usage: factorial <number>.* EXIT code 1.*$inferior_exited_re normally.*$gdb_prompt $" {
pass "run \"$testfile\" with no args (exit wrapper)"
fail "no spurious messages at program exit"
}
set timeout 120
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
- "Program exited normally" {
+ "$inferior_exited_re normally" {
unresolved "run \"$testfile\" with arg"
}
"120" {
set timeout 120
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
- "Program exited normally" {
+ "$inferior_exited_re normally" {
unresolved "run \"$testfile\" again with same args"
}
"120" { pass "run \"$testfile\" again with same args" }
set timeout 120
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
- "Program exited normally" {
+ "$inferior_exited_re normally" {
unresolved "run after setting args to nil"
}
"usage: factorial <number>" {
set timeout 120
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
- "Program exited normally" {
+ "$inferior_exited_re normally" {
unresolved "run \"$testfile\" again after setting args"
}
"720" {
# Allow the test process to exit, to cleanup after ourselves.
- gdb_test "continue" "Program exited normally." "after attach2, exit"
+ gdb_continue_to_end "after attach2, exit"
# Make sure we don't leave a process around to confuse
# the next test run (and prevent the compile by keeping
# Get rid of the process
gdb_test "p should_exit = 1"
- gdb_test "c" "Program exited normally."
+ gdb_continue_to_end
# Be paranoid
gdb_run_cmd
gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $" {
+ -re ".*$inferior_exited_re normally.*$gdb_prompt $" {
pass "run program"
}
timeout {
}
proc test_ld {file ifmain trynosym displacement} {
- global srcdir subdir gdb_prompt expect_out
+ global srcdir subdir gdb_prompt expect_out inferior_exited_re
# First test normal `file'-command loaded $FILE with symbols.
}
exp_continue
}
- -re "Program exited (normally|with code \[0-9\]+)\\.\r\n$gdb_prompt $" {
+ -re "$inferior_exited_re (normally|with code \[0-9\]+).\r\n$gdb_prompt $" {
# Do not check the binary filename as it may be truncated.
pass $test
}
# Continue one last time, the program should exit normally.
-gdb_test "continue" "Program exited normally." \
- "continue to program exit"
+gdb_continue_to_end
return 0
# Deleting the catchpoints
delete_breakpoints
- set thistest "successful program end"
- gdb_test "continue" "Program exited normally.*" $thistest
+ gdb_continue_to_end
}
# If it doesn't, everything is right (since we don't have
# a syscall named "mlock" in it). Otherwise, this is a failure.
set thistest "catch syscall with unused syscall ($syscall_name)"
- gdb_test "continue" "Program exited normally.*" $thistest
+ gdb_continue_to_end $thistest
}
proc test_catch_syscall_restarting_inferior {} {
delete_breakpoints
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork one"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork two"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork three"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork four"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork five"
#
gdb_run_cmd
gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $" {
+ -re ".*$inferior_exited_re normally.*$gdb_prompt $" {
pass "running with invalidated bpt condition after executable changes"
}
-re ".*Breakpoint .*,( 0x.* in)? (\[^ \]*)exit .*$gdb_prompt $" {
# This is what happens on mingw32ce.
pass "step out of main"
}
- -re ".*Program exited normally.*$gdb_prompt $" {
+ -re ".*$inferior_exited_re normally.*$gdb_prompt $" {
# This is what happens on Linux i86 (and I would expect others)
set program_exited 1
pass "step out of main"
global program_exited;
if {[eval expr $program_exited == 0]} {
gdb_test_multiple "n" "step to end of run" {
- -re "Program exited normally.*$gdb_prompt $" {
+ -re "$inferior_exited_re normally.*$gdb_prompt $" {
# If we actually have debug info for the start function,
# then we won't get the "Single-stepping until function
# exit" message.
pass "step to end of run"
set program_exited_normally 1
}
- -re "Single.*EXIT code 0\r\n.*Program exited normally.*$gdb_prompt $" {
+ -re "Single.*EXIT code 0\r\n.*$inferior_exited_re normally.*$gdb_prompt $" {
pass "step to end of run (status wrapper)"
set program_exited_normally 1
}
-re "Single.*EXIT code 0\r\n.*$gdb_prompt $" {
pass "step to end of run (status wrapper)"
}
- -re ".*Single.*Program exited.*$gdb_prompt $" {
+ -re ".*Single.*$inferior_exited_re.*$gdb_prompt $" {
pass "step to end of run"
set program_exited_normally 1
}
continue
}
-gdb_test "continue" \
- ".*Program exited normally\\." \
- "continue until program exits"
+gdb_continue_to_end
# Try deleting the executable file, now that the program has exited,
# and make sure that the deletion worked by verifying that the exe
-re "\[0-9\]+.*return a;.*$gdb_prompt $" {
pass $name
}
- -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
+ -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" {
kfail "gdb/1555" $name
}
}
send_gdb "\004"
gdb_expect {
- -re "end of file.*Program exited normally.*$gdb_prompt $" {
+ -re "end of file.*$inferior_exited_re normally.*$gdb_prompt $" {
pass "send end of file"
}
-re "$gdb_prompt $" { fail "send end of file" }
if [target_info exists gdb,noresults] { return }
- if [target_info exists use_gdb_stub] {
- gdb_breakpoint "exit"
- gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
- } else {
- gdb_test "cont" "Program exited normally\\..*" \
- "continue to exit in langs.exp"
- }
+ gdb_continue_to_end "langs.exp"
}
gdb_exit
# This time, let the program run to completion. If GDB checks the
# executable file's timestamp now, it won't notice any change.
- gdb_test "continue" ".*Program exited.*" \
- "second pass: continue to completion"
+ gdb_continue_to_end "second pass"
# Now move the newer executable into place, and re-run. GDB
# should still notice that the executable file has changed,
gdb_test "run" "Starting program:.*Breakpoint .,.*" \
"run to bp in shared library"
- gdb_test "cont" ".*Program exited normally..*"
+ gdb_continue_to_end
gdb_test "run" "Starting program:.*Breakpoint .,.*" \
"re-run to bp in shared library (PR's 16495, 18213)"
- gdb_test "cont" ".*Program exited normally..*"
+ gdb_continue_to_end
}
return 0
send_gdb "step\n"
exp_continue
}
- -re "Program exited normally.*${gdb_prompt} $" {
+ -re "$inferior_exited_re normally.*${gdb_prompt} $" {
kfail gdb/1613 "$test (program exited)"
}
-re "(while ..done|return 0).*${gdb_prompt} $" {
}
proc advance { i } {
- global gdb_prompt
+ global gdb_prompt inferior_exited_re
set prefix "$i from handler"
# Get us back into the handler
send_gdb "$i\n"
exp_continue -continue_timer
}
- -re "Program exited normally.*${gdb_prompt} $" {
+ -re "$inferior_exited_re normally.*${gdb_prompt} $" {
setup_kfail gdb/1639 powerpc-*-*bsd*
fail "$test (program exited)"
}
}
proc advancei { i } {
- global gdb_prompt
+ global gdb_prompt inferior_exited_re
set prefix "$i from handleri"
set program_exited 0
-re "main .*${gdb_prompt} $" {
fail "$test (in main)"
}
- -re "Program exited normally.*${gdb_prompt} $" {
+ -re "$inferior_exited_re normally.*${gdb_prompt} $" {
fail "$test (program exited)"
set program_exited 1
}
send_gdb "y\n"
exp_continue -continue_timer
}
- -re "Program exited normally.*${gdb_prompt} $" {
+ -re "$inferior_exited_re normally.*${gdb_prompt} $" {
kfail gdb/1639 "$test (program exited)"
set program_exited 1
}
-re ".*${decimal}.*callee.*NEXTI.*$gdb_prompt $" {
pass "$test"
}
- -re ".*(Program received|Program exited).*$gdb_prompt $" {
+ -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
# Oops... We ran to the end of the program... Better reset
if {![runto_main]} then {
fail "$test (Can't run to main)"
gdb_test "info terminal" "No saved terminal information.*" "test info terminal"
gdb_run_cmd 5
gdb_expect {
- -re ".*120.*Program exited normally.*$gdb_prompt $" {
+ -re ".*120.*$inferior_exited_re normally.*$gdb_prompt $" {
gdb_test "info terminal" "No saved terminal information.*" "test info terminal #2"
}
default {
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, func \\(\\) at .*$spu_file.c:.*" \
"run until breakpoint hit"
-gdb_test "continue" "Continuing\\..*Program exited normally.*" \
- "run until end"
+gdb_continue_to_end
gdb_exit
# `a.x is 1' is asynchronous regarding to `frames-invalid'.
#
gdb_test_multiple "continue" "continue until exit" {
- -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)*\r\na.x is 1\r\n\(\r\n\032\032frames-invalid\r\n\)*\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
+ -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)*\r\na.x is 1\r\n\(\r\n\032\032frames-invalid\r\n\)*\r\n\032\032exited 0\r\n.$inferior_exited_re normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
pass "continue until exit"
}
}
"\r\n\032\032starting\r\n"
"a.x is 1\r\n"
"\r\n\032\032exited 0\r\n"
- "\r\n"
- "Program exited normally.\r\n"
+ ".$inferior_exited_re normally.\r\n"
"\r\n\032\032stopped\r\n"
}
}
}
-gdb_test "continue" \
- ".*Program exited normally.*" \
- "continue with disabled breakpoint 1.2"
+gdb_continue_to_end "disabled breakpoint 1.2"
# Make sure we can set a breakpoint on a source statement that spans
# multiple lines.
gdb_run_cmd
gdb_expect {
- -re "Program exited normally.*$gdb_prompt $" {
+ -re "$inferior_exited_re normally.*$gdb_prompt $" {
pass "disable breakpoint: run to breakpoint"
}
-re "$gdb_prompt $" {
}
gdb_test_multiple "cont" "finish program" {
- -re "Continuing.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
+ -re "Continuing.\r\n$inferior_exited_re normally.*$gdb_prompt $" {
pass "finish program"
}
- -re "Continuing.* EXIT code 0.*Program exited normally.*$gdb_prompt $" {
+ -re "Continuing.* EXIT code 0.*$inferior_exited_re normally.*$gdb_prompt $" {
pass "finish program (exit wrapper)"
}
}
-re ".*solib-d1.*$gdb_prompt $" {
pass "Catch implicit load at startup"
}
- -re "Program exited.*$gdb_prompt $" {
+ -re "Inferior \[0-9\]+ exited.*$gdb_prompt $" {
fail "CLLbs14756 || CLLbs16090 came back ???"
}
timeout { fail "(timeout) implicit library load" }
-re "Stopped due to shared library event.*$gdb_prompt $" {
pass "stop for shlib event"
}
- -re "Program exited.*$gdb_prompt $" {
+ -re "Inferior \[0-9\]+ exited.*$gdb_prompt $" {
fail "Bug CLLbs16090 came back ?"
}
timeout { fail "(timeout) stop for shlib event " }
gdb_test "s 1" ".*25.*"
if [istarget "hppa64-*-*"] {
gdb_test "s 1" "0x\[0-9a-f\]+ in .*"
- gdb_test "c" ".*Program exited normally.*"
+ gdb_continue_to_end
} else {
gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
- gdb_test "s 1" ".*Program exited normally.*"
+ gdb_continue_to_end "" "s 1"
}
}
gdb_test "s 1" ".*16.*"
if [istarget "hppa64-*-*"] {
gdb_test "s 1" "0x\[0-9a-f\]+ in .*START.*"
- gdb_test "c" ".*Program exited normally.*"
+ gdb_continue_to_end
} else {
gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
- gdb_test "s 1" ".*Program exited normally.*"
+ gdb_continue_to_end "" "s 1"
}
gdb_test "print nstype" " = {.0. = 7, .1. = 42}" \
"print nstype on one line"
- gdb_test "continue" "Program exited normally\."
+ gdb_continue_to_end
remote_file host delete ${remote_python_file}
}
}
}
-gdb_test "continue" ".*Program exited normally\\." \
- "continue to end"
+gdb_continue_to_end
# Continue one last time, the program should exit normally.
-gdb_test "continue" "Program exited normally." \
- "continue to program exit"
+gdb_continue_to_end
return 0
}
proc test_all_threads { name kill } {
- global gdb_prompt
+ global gdb_prompt inferior_exited_re
set i 0
set j 0
send_gdb "continue\n"
exp_continue
}
- -re "Program exited normally\\.\[\r\n\]+$gdb_prompt" {
+ -re "$inferior_exited_re normally.\[\r\n\]+$gdb_prompt" {
pass "program exited normally"
if {$i == 5} {
pass "all threads ran once ($name)"
proc step_it { cmd } {
global gdb_prompt
global program_exited
+ global inferior_exited_re
send_gdb "$cmd\n"
gdb_expect {
-re "0x\[0-9A-Fa-f\]* *in.*\r\n$gdb_prompt $" { pass "step_it"; return 0 }
-re "0x\[0-9A-Fa-f\]* *\[0-9\]*.*\r\n$gdb_prompt $" { pass "step_it"; return 1 }
- -re "Program exited .*\n$gdb_prompt $" {
+ -re "$inferior_exited_re .*\n$gdb_prompt $" {
set program_exited 1
return -1
}
proc continue_all {} {
global gdb_prompt
+ global inferior_exited_re
send_gdb "continue\n"
gdb_expect {
pass "continue_all"
return 0
}
- -re "Program exited .*\n$gdb_prompt $" {
+ -re "$inferior_exited_re .*\n$gdb_prompt $" {
set program_exited 1
return 1;
}
# Continue one last time, the program should exit normally.
-gdb_test "continue" "Program exited normally." \
- "continue to program exit"
+gdb_continue_to_end
return 0
unsupported "continue to first thread: system does not support TLS"
return -1
}
- -re ".*Program exited normally.*$gdb_prompt $" {
+ -re ".*$inferior_exited_re normally.*$gdb_prompt $" {
fail "continue to first thread: program runaway"
}
-re ".*Pass 0 done.*Pass 1 done.*$gdb_prompt $" {
# Return 0 if so, 1 if it does not.
proc skip_cell_tests {} {
global skip_cell_tests_saved
- global srcdir subdir gdb_prompt
+ global srcdir subdir gdb_prompt inferior_exited_re
# Use the cached value, if it exists.
set me "skip_cell_tests"
gdb_load "$exe"
gdb_run_cmd
gdb_expect {
- -re ".*Program exited normally.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: Cell/B.E. hardware detected"
set skip_cell_tests_saved 0
}
- -re ".*Program exited with code.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re with code.*${gdb_prompt} $" {
verbose -log "\n$me: Cell/B.E. hardware not detected"
set skip_cell_tests_saved 1
}
set octal "\[0-7\]+"
+set inferior_exited_re "Inferior \[0-9\]+ \\(.*\\) exited"
+
### Only procedures should come after this point.
#
# }
# }
#
-# The standard patterns, such as "Program exited..." and "A problem
+# The standard patterns, such as "Inferior exited..." and "A problem
# ...", all being implicitly appended to that list.
#
proc gdb_test_multiple { command message user_code } {
global verbose
global gdb_prompt
global GDB
+ global inferior_exited_re
upvar timeout timeout
upvar expect_out expect_out
fail "$message"
set result 1
}
- -re "Program exited with code \[0-9\]+.*$gdb_prompt $" {
+ -re "$inferior_exited_re with code \[0-9\]+.*$gdb_prompt $" {
if ![string match "" $message] then {
set errmsg "$message (the program exited)"
} else {
fail "$errmsg"
set result -1
}
- -re "Program exited normally.*$gdb_prompt $" {
+ -re "$inferior_exited_re normally.*$gdb_prompt $" {
if ![string match "" $message] then {
set errmsg "$message (the program exited)"
} else {
proc skip_altivec_tests {} {
global skip_vmx_tests_saved
- global srcdir subdir gdb_prompt
+ global srcdir subdir gdb_prompt inferior_exited_re
# Use the cached value, if it exists.
set me "skip_altivec_tests"
verbose -log "\n$me altivec hardware not detected"
set skip_vmx_tests_saved 1
}
- -re ".*Program exited normally.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: altivec hardware detected"
set skip_vmx_tests_saved 0
}
proc skip_vsx_tests {} {
global skip_vsx_tests_saved
- global srcdir subdir gdb_prompt
+ global srcdir subdir gdb_prompt inferior_exited_re
# Use the cached value, if it exists.
set me "skip_vsx_tests"
verbose -log "\n$me VSX hardware not detected"
set skip_vsx_tests_saved 1
}
- -re ".*Program exited normally.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: VSX hardware detected"
set skip_vsx_tests_saved 0
}
# stub is used, we set a breakpoint at exit because we cannot rely on
# exit() behavior of a remote target.
#
-# mssg is the error message that gets printed.
+# MSSG is the error message that gets printed. If not given, a
+# default is used.
+# COMMAND is the command to invoke. If not given, "continue" is
+# used.
+
+proc gdb_continue_to_end {{mssg ""} {command continue}} {
+ global inferior_exited_re
-proc gdb_continue_to_end {mssg} {
+ if {$mssg == ""} {
+ set text "continue until exit"
+ } else {
+ set text "continue until exit at $mssg"
+ }
if [target_info exists use_gdb_stub] {
if {![gdb_breakpoint "exit"]} {
return 0
}
gdb_test "continue" "Continuing..*Breakpoint .*exit.*" \
- "continue until exit at $mssg"
+ $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\]+|Program exited normally\\.).*"\
- "continue until exit at $mssg"
+ "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|$inferior_exited_re normally).*"\
+ $text
}
}
global verbose
global mi_gdb_prompt
global GDB expect_out
+ global inferior_exited_re
upvar timeout timeout
set command [lindex $args 0]
fail "$message"
set result 1
}
- -re "Program exited with code \[0-9\]+.*$mi_gdb_prompt\[ \]*$" {
+ -re "$inferior_exited_re with code \[0-9\]+.*$mi_gdb_prompt\[ \]*$" {
if ![string match "" $message] then {
set errmsg "$message (the program exited)"
} else {
# it does not.
proc skip_opencl_tests {} {
global skip_opencl_tests_saved srcdir objdir subdir gdb_prompt
+ global inferior_exited_re
# Use the cached value, if it exists. Cache value per "board" to handle
# runs with multiple options (e.g. unix/{-m32,-64}) correctly.
clean_restart "$executable"
gdb_run_cmd
gdb_expect 30 {
- -re ".*Program exited normally.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: OpenCL support detected"
set skip_opencl_tests_saved($board) 0
}
- -re ".*Program exited with code.*${gdb_prompt} $" {
+ -re ".*$inferior_exited_re code.*${gdb_prompt} $" {
verbose -log "\n$me: OpenCL support not detected"
set skip_opencl_tests_saved($board) 1
}