2002-05-06 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 7 May 2002 02:22:08 +0000 (02:22 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 7 May 2002 02:22:08 +0000 (02:22 +0000)
* lib/gdb.exp (gdb_test): Add case to allow for status wrapper.
(gdb_continue_to_end): Accept output from status wrapper.
* gdb.base/ending-run.exp: Add case for output from status wrapper.
        Clean up fail messages to match pass messages.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/ending-run.exp
gdb/testsuite/lib/gdb.exp

index ef64d4f4417c4c761cc98239a2ecdc85bb6fccde..34c4a23b4016a4fe2e6a1894d30c5f5d36f913d0 100644 (file)
@@ -1,5 +1,10 @@
 2002-05-06  Michael Snyder  <msnyder@redhat.com>
 
+       * lib/gdb.exp (gdb_test): Add case to allow for status wrapper.
+       (gdb_continue_to_end): Accept output from status wrapper.
+       * gdb.base/ending-run.exp: Add case for output from status wrapper.
+       Clean up fail messages to match pass messages.
+
        Enable the "needs_status_wrapper" testsuite feature.
        * lib/gdb.exp (gdb_wrapper_init): New procedure.
        (gdb_compile): Conditionally call gdb_wrapper_init.
index df6a7081a3ffd8f781b65ca893be7116c5aacaef..656601efc9863967a5eab46ac0ba285c5cb4fe5f 100644 (file)
@@ -74,9 +74,15 @@ if [target_info exists use_gdb_stub] {
 gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
 send_gdb "i b\n"
 gdb_expect {
-    -re ".*breakpoint.*breakpoint.*$gdb_prompt $" { fail "clear bp" }
-    -re ".*3.*main.*31.*$gdb_prompt $" { pass "cleared bp at line before routine" }
-    -re ".*$gdb_prompt $" { fail "info b" }
+    -re ".*breakpoint.*breakpoint.*$gdb_prompt $" { 
+       fail "cleared bp at line before routine" 
+    }
+    -re ".*3.*main.*31.*$gdb_prompt $" { 
+       pass "cleared bp at line before routine" 
+    }
+    -re ".*$gdb_prompt $" { 
+       fail "cleared bp at line before routine (info b)" 
+    }
 }
 
 # Test some other "clear" combinations
@@ -115,13 +121,13 @@ gdb_expect {
 send_gdb "i b\n"
 gdb_expect {
     -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
-        fail "didn't clear bps
+        fail "all set to continue (didn't clear bps)
     }
     -re ".*3.*main.*31.*$gdb_prompt $" {
         pass "all set to continue"
     }
     -re ".*$gdb_prompt $" {
-        fail "missing bp at end"
+        fail "all set to continue (missing bp at end)"
     }
 }
 
@@ -152,7 +158,7 @@ gdb_expect {
        send_gdb "next\n"
        gdb_expect {
            -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
-               fail "Old bug came back!"
+               fail "step out of main (Old bug came back!)"
                gdb_test "n" ".*" ""
            }
            -re ".*in.*start.*$gdb_prompt $" { 
@@ -172,7 +178,7 @@ gdb_expect {
            }
            -re ".*in .nope ().*$gdb_prompt $" {
                # This is what happens on Solaris currently -sts 1999-08-25
-               pass "step out of main on Solaris"
+               pass "step out of main (on Solaris)"
            }
            -re ".*in _int_reset ().*$gdb_prompt $" {
                # This is what happens on Sanyo XStormy16
@@ -184,13 +190,18 @@ gdb_expect {
            }
            -re ".*in ..change.mode ().*$gdb_prompt $" {
                # This is what happens on ARM in thumb mode -fn 2000-02-01
-               pass "step out of main on ARM thumb"
+               pass "step out of main (on ARM thumb)"
            }
            -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { 
                pass "step out of main"
            }
-            -re ".*$gdb_prompt $" { fail "step at end 2" }
-           timeout { fail "hang or timeout on step at end 2" }
+           -re ".*in __wrap_main ().*$gdb_prompt $" {
+               pass "step out of main (status wrapper)"
+           }
+            -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
+           timeout { 
+               fail "step out of main (hang or timeout on step at end 2)" 
+           }
        }
     }
     -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
@@ -201,7 +212,7 @@ gdb_expect {
         pass "step out of main"
     }
     -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $"  {
-        pass "step out of main 2"
+        pass "step out of main (2)"
     }
     -re ".*Program exited normally.*$gdb_prompt $" {
        # This is what happens on Linux i86 (and I would expect others)
@@ -209,13 +220,13 @@ gdb_expect {
        pass "step out of main"
     }
     -re ".*in.*currently asm.*$gdb_prompt $" { 
-        pass "step out of main into assembler"
+        pass "step out of main (into assembler)"
     }
     -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
         pass "Cygmon stopped in ending trap."
     }
-    -re ".*$gdb_prompt $" { fail "step at end 1" }
-    timeout { fail "hang or timeout on step at end 1" }
+    -re ".*$gdb_prompt $" { fail "step out of main (at end 1)" }
+    timeout { fail "step out of main (hang or timeout on step at end 1)" }
 }
 
 if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
@@ -229,6 +240,9 @@ if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
                # exit" message.
                pass "step to end of run"
            }
+           -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
+               pass "step to end of run (status wrapper)"
+           }
            -re ".*Single.*Program exited.*$gdb_prompt $" {
                pass "step to end of run"
            }
@@ -259,10 +273,10 @@ if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
        pass "No core dumped on quit"
     } else {
        if [ regexp "No such file or directory" $exec_output] {
-           pass "ls: core: No core dumped on quit"
+           pass "ls: core (No core dumped on quit)"
        } else {
            remote_exec build "rm -f core"
-           fail "Core dumped on quit"
+           fail "ls: core (Core dumped on quit)"
        }
     }
 }
index 303c3c58330b33c1a2c820a2897fd07c238577c2..71d937ac81ea797119fc63b3d373ebaccbe7d50c 100644 (file)
@@ -520,6 +520,15 @@ proc gdb_test { args } {
            }
            fail "$errmsg"
            return -1
+       }
+        -re "EXIT code \[0-9\r\n\]+Program exited normally.*$gdb_prompt $" {
+           if ![string match "" $message] then {
+               set errmsg "$message: the program exited"
+           } else {
+               set errmsg "$command: the program exited"
+           }
+           fail "$errmsg"
+           return -1
        }
         -re "The program is not being run.*$gdb_prompt $" {
            if ![string match "" $message] then {
@@ -1605,7 +1614,7 @@ proc gdb_continue_to_end {mssg} {
     # 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\]+Program exited normally\\..*"\
+      "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|)Program exited normally\\..*"\
       "continue until exit at $mssg"
   }
 }
This page took 0.033556 seconds and 4 git commands to generate.