* gdb.mi/mi-syn-frame.c (main, foo, bar)
authorDaniel Jacobowitz <drow@false.org>
Sun, 29 Apr 2007 16:20:50 +0000 (16:20 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sun, 29 Apr 2007 16:20:50 +0000 (16:20 +0000)
(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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi-syn-frame.c
gdb/testsuite/gdb.mi/mi-syn-frame.exp
gdb/testsuite/gdb.mi/mi2-syn-frame.exp
gdb/testsuite/lib/mi-support.exp

index af0221b8255f6fb6a1eebe9c5b63063f1120f9b2..bc8b6cea1cd46c6dd22020340ed6a5cde190294f 100644 (file)
@@ -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>
 
index 580b5342716f13d7ba4a22b96ada319e922aecb7..ddfc08e39d9289ddd8ed975d1e85fe4c63116baa 100644 (file)
@@ -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 */
index 43e154454f780d53cdcd4c6c7c48a72071748289..53d1ff9202a946c8c6de63c9ff38e16e43075ed5 100644 (file)
@@ -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"
 
index f10ecf65c8401d0ef82418fbb4e38d064214876f..b568f00ab39fbba310a7f9588a9632e71f6b15af 100644 (file)
@@ -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"
 
index 2482016e9527abc9661507842be6d0664fffc7e1..6763ff527f01d145c998c3876b26faa7c330993a 100644 (file)
@@ -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"
            }
         }
     }
This page took 0.041985 seconds and 4 git commands to generate.