aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2001-07-25 22:41:43 +0000
committerMichael Snyder <msnyder@vmware.com>2001-07-25 22:41:43 +0000
commit2b1a1355c52c1ab82d792e6af8061be700bc425a (patch)
treeae8e8acb04a063a082c36b1c4f08ce4a10af5374
parent46bac6de1815656ee140143b2347d7bbdd1f151e (diff)
downloadgdb-2b1a1355c52c1ab82d792e6af8061be700bc425a.zip
gdb-2b1a1355c52c1ab82d792e6af8061be700bc425a.tar.gz
gdb-2b1a1355c52c1ab82d792e6af8061be700bc425a.tar.bz2
2001-07-25 Michael Snyder <msnyder@redhat.com>
* gdb.base/ending-run.exp: Accept "Program exited normally" as legitimate output from stepping out of main.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp84
2 files changed, 56 insertions, 33 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 137be01..5bf1655 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-25 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/ending-run.exp: Accept "Program exited normally" as
+ legitimate output from stepping out of main.
+
2001-07-22 Keith Seitz <keiths@redhat.com>
* lib/gdb.exp (_gdbtk_xvfb_init): If GDB_DISPLAY is
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 1552d36..360edc8 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -140,6 +140,7 @@ if ![gdb_skip_stdio_test "Step to return"] {
set old_timeout $timeout
set timeout 50
+set program_exited 0
send_gdb "next\n"
gdb_expect {
-re "33.*$gdb_prompt $" {
@@ -160,6 +161,11 @@ gdb_expect {
# This is what happens on sparc64-elf ultra.
pass "step out of main"
}
+ -re ".*Program exited normally.*$gdb_prompt $" {
+ # This is what happens on Linux i86 (and I would expect others)
+ set program_exited 1
+ pass "step out of main"
+ }
-re ".*in .nope ().*$gdb_prompt $" {
# This is what happens on Solaris currently -sts 1999-08-25
pass "step out of main on Solaris"
@@ -185,6 +191,11 @@ gdb_expect {
-re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
pass "step out of main 2"
}
+ -re ".*Program exited normally.*$gdb_prompt $" {
+ # This is what happens on Linux i86 (and I would expect others)
+ set program_exited 1
+ pass "step out of main"
+ }
-re ".*in.*currently asm.*$gdb_prompt $" {
pass "step out of main into assembler"
}
@@ -196,41 +207,48 @@ gdb_expect {
}
if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
- send_gdb "n\n"
- gdb_expect {
- -re "Program exited normally.*$gdb_prompt $" {
- # If we actually have debug info for the start function,
- # then we won't get the "Single-stepping until function
- # exit" message.
- pass "step to end of run 1"
- }
- -re ".*Single.*Program exited.*$gdb_prompt $" {
- pass "step to end of run 1"
- }
- -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
- pass "step to end of run 2"
- gdb_test "c" ".*" "continue after exit"
- }
- timeout { fail "(timeout) step to end of run" }
- }
-
- set timeout $old_timeout
-
- gdb_test "n" ".*The program is not being run.*" "don't step after run"
-
- set exec_output [remote_exec host "ls core"]
-
-
- if [ regexp "core not found" $exec_output] {
- pass "No core dumped on quit"
- } else {
- if [ regexp "No such file or directory" $exec_output] {
- pass "ls: core: No core dumped on quit"
+ global program_exited;
+ if {[eval expr $program_exited == 0]} {
+ send_gdb "n\n"
+ gdb_expect {
+ -re "Program exited normally.*$gdb_prompt $" {
+ # If we actually have debug info for the start function,
+ # then we won't get the "Single-stepping until function
+ # exit" message.
+ pass "step to end of run 1"
+ }
+ -re ".*Single.*Program exited.*$gdb_prompt $" {
+ pass "step to end of run 1"
+ }
+ -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
+ pass "step to end of run 2"
+ gdb_test "c" ".*" "continue after exit"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "step to end of run"
+ }
+ timeout {
+ fail "(timeout) step to end of run"
+ }
+ }
+ }
+
+ set timeout $old_timeout
+
+ gdb_test "n" ".*The program is not being run.*" "don't step after run"
+
+ set exec_output [remote_exec host "ls core"]
+
+ if [ regexp "core not found" $exec_output] {
+ pass "No core dumped on quit"
} else {
- remote_exec build "rm -f core"
- fail "Core dumped on quit"
+ if [ regexp "No such file or directory" $exec_output] {
+ pass "ls: core: No core dumped on quit"
+ } else {
+ remote_exec build "rm -f core"
+ fail "Core dumped on quit"
+ }
}
- }
}
#remote_exec build "rm -f ${binfile}"