diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ending-run.exp | 46 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 11 |
3 files changed, 45 insertions, 17 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ef64d4f..34c4a23 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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. diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index df6a708..656601e 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -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)" } } } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 303c3c5..71d937a 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -521,6 +521,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 { set errmsg "$message: the program is no longer running" @@ -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" } } |