* gdb.mi/mi-syn-frame.c (main, foo, bar)
(have_a_very_merry_interrupt): Remove calls to puts. * gdb.mi/mi-syn-frame.exp, gdb.mi/mi2-syn-frame.exp: Do not expect inferior output. * lib/mi-support.exp (mi_gdb_test): Check gdb,noinferiorio. Correct test names.
This commit is contained in:
parent
db9d7fc570
commit
d084b3317a
@ -1,3 +1,12 @@
|
||||
2007-04-29 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* gdb.mi/mi-syn-frame.c (main, foo, bar)
|
||||
(have_a_very_merry_interrupt): Remove calls to puts.
|
||||
* gdb.mi/mi-syn-frame.exp, gdb.mi/mi2-syn-frame.exp: Do not expect
|
||||
inferior output.
|
||||
* lib/mi-support.exp (mi_gdb_test): Check gdb,noinferiorio. Correct
|
||||
test names.
|
||||
|
||||
2007-04-29 Markus Deuling <deuling@de.ibm.com>
|
||||
Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
|
@ -11,20 +11,15 @@ void have_a_very_merry_interrupt (void);
|
||||
|
||||
main ()
|
||||
{
|
||||
puts ("Starting up");
|
||||
|
||||
foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
|
||||
|
||||
|
||||
have_a_very_merry_interrupt ();
|
||||
|
||||
puts ("Shutting down");
|
||||
}
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
puts ("hi in foo");
|
||||
}
|
||||
|
||||
void
|
||||
@ -32,8 +27,6 @@ bar (void)
|
||||
{
|
||||
char *nuller = 0;
|
||||
|
||||
puts ("hi in bar");
|
||||
|
||||
*nuller = 'a'; /* try to cause a segfault */
|
||||
}
|
||||
|
||||
@ -58,7 +51,6 @@ subroutine (int in)
|
||||
void
|
||||
have_a_very_merry_interrupt (void)
|
||||
{
|
||||
puts ("Waiting to get a signal");
|
||||
signal (SIGALRM, handler);
|
||||
alarm (1);
|
||||
sleep (2); /* We'll receive that signal while sleeping */
|
||||
|
@ -37,7 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
|
||||
}
|
||||
|
||||
mi_gdb_exit
|
||||
mi_gdb_start separate-inferior-tty
|
||||
mi_gdb_start
|
||||
mi_delete_breakpoints
|
||||
mi_gdb_reinitialize_dir $srcdir/$subdir
|
||||
mi_gdb_load ${binfile}
|
||||
@ -61,8 +61,7 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
|
||||
#
|
||||
mi_gdb_test "403-exec-continue" \
|
||||
"403\\^running" \
|
||||
"testing exec continue" \
|
||||
"hi in foo\[\r\n\]\+"
|
||||
"testing exec continue"
|
||||
|
||||
mi_gdb_test "" "403\\*stopped" "finished exec continue"
|
||||
|
||||
@ -81,8 +80,7 @@ mi_gdb_test "405-break-insert subroutine" \
|
||||
|
||||
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
|
||||
"\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
|
||||
"data evaluate expression" \
|
||||
"Waiting to get a signal\[\r\n\]+"
|
||||
"data evaluate expression"
|
||||
|
||||
# We should have both a signal handler and a call dummy frame
|
||||
# in this next output.
|
||||
@ -106,8 +104,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
|
||||
|
||||
mi_gdb_test "410-data-evaluate-expression bar()" \
|
||||
"\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" \
|
||||
"call inferior function which raises exception" \
|
||||
"hi in bar\[\r\n\]+"
|
||||
"call inferior function which raises exception"
|
||||
|
||||
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
|
||||
|
||||
|
@ -64,7 +64,7 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
|
||||
|
||||
send_gdb "403-exec-continue\n"
|
||||
gdb_expect {
|
||||
-re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
||||
-re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
||||
pass "403-exec-continue"
|
||||
}
|
||||
timeout {
|
||||
@ -86,7 +86,7 @@ mi_gdb_test "405-break-insert subroutine" \
|
||||
"insert breakpoint subroutine"
|
||||
|
||||
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
|
||||
"Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
|
||||
"\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
|
||||
"evaluate expression have_a_very_merry_interrupt"
|
||||
|
||||
# We should have both a signal handler and a call dummy frame
|
||||
@ -115,7 +115,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
|
||||
# Call bar() by hand, which should get an exception while running.
|
||||
#
|
||||
|
||||
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
|
||||
mi_gdb_test "410-data-evaluate-expression bar()" "\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
|
||||
|
||||
mi_gdb_test "411-stack-list-frames" "411\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
|
||||
|
||||
|
@ -732,15 +732,19 @@ proc mi_gdb_test { args } {
|
||||
# If the GDB output matched, compare the inferior output.
|
||||
if { $result == 0 } {
|
||||
if [ info exists ipattern ] {
|
||||
global mi_inferior_spawn_id
|
||||
expect {
|
||||
-i $mi_inferior_spawn_id -re "$ipattern" {
|
||||
pass "inferior_output:$message"
|
||||
}
|
||||
timeout {
|
||||
fail "inferior output timeout"
|
||||
set result 1
|
||||
if { ![target_info exists gdb,noinferiorio] } {
|
||||
global mi_inferior_spawn_id
|
||||
expect {
|
||||
-i $mi_inferior_spawn_id -re "$ipattern" {
|
||||
pass "$message inferior output"
|
||||
}
|
||||
timeout {
|
||||
fail "$message inferior output (timeout)"
|
||||
set result 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unsupported "$message inferior output"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user