summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-04-29 16:20:50 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-04-29 16:20:50 +0000
commit59f7923389f3f7a11ded2adc681a960fd1a3bb73 (patch)
treebcf0f2526c68a5c2eb90e26c3ec0c86d8e499e0c
parent001b67176c1f4c74f05958eb5c5d2ea4f70ce4ef (diff)
downloadgdb-59f7923389f3f7a11ded2adc681a960fd1a3bb73.tar.gz
* 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.
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.c8
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.exp11
-rw-r--r--gdb/testsuite/gdb.mi/mi2-syn-frame.exp6
-rw-r--r--gdb/testsuite/lib/mi-support.exp20
5 files changed, 28 insertions, 26 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index af0221b8255..bc8b6cea1cd 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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>
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c
index 580b5342716..ddfc08e39d9 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.c
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c
@@ -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 */
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
index 43e154454f7..53d1ff9202a 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
index f10ecf65c84..b568f00ab39 100644
--- a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
@@ -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"
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 2482016e952..6763ff527f0 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -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"
}
}
}