aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/ena-dis-br.exp
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
committerStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
commit7a292a7adf506b866905b06b3024c0fd411c4583 (patch)
tree5b208bb48269b8a82d5c3a5f19c87b45a62a22f4 /gdb/testsuite/gdb.base/ena-dis-br.exp
parent1996fae84682e8ddd146215dd2959ad1ec924c09 (diff)
downloadgdb-7a292a7adf506b866905b06b3024c0fd411c4583.zip
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.gz
gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.bz2
import gdb-19990422 snapshot
Diffstat (limited to 'gdb/testsuite/gdb.base/ena-dis-br.exp')
-rw-r--r--gdb/testsuite/gdb.base/ena-dis-br.exp112
1 files changed, 34 insertions, 78 deletions
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 6593d82..f5656d8 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -38,6 +38,30 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+proc rerun_to_main {} {
+ global gdb_prompt
+
+ if [target_info exists use_gdb_stub] {
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint .*main .*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ } else {
+ send_gdb "run\n"
+ gdb_expect {
+ -re "Starting program.*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ }
+}
+
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
@@ -137,32 +161,9 @@ gdb_expect {
# Verify that we don't stop at a disabled breakpoint.
#
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop"}
- -re "$gdb_prompt $"\
- {fail "no stop"}
- timeout {fail "(timeout) no stop"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
-
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at auto-disabled break marker2"}
- -re "$gdb_prompt $"\
- {fail "no stop at auto-disabled break marker2"}
- timeout {fail "(timeout) no stop at auto-disabled break marker2"}
-}
+gdb_continue_to_end "no stop"
+rerun_to_main
+gdb_continue_to_end "no stop at auto-disabled break marker2"
# Verify that we can set a breakpoint to be self-deleting after
# the first time it triggers.
@@ -321,23 +322,8 @@ gdb_expect {
timeout {fail "(timeout) info ignored break marker1"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored break marker1"}
- timeout {fail "(timeout) no stop at ignored break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored break marker1"
+rerun_to_main
send_gdb "continue\n"
gdb_expect {
@@ -386,23 +372,8 @@ gdb_expect {
timeout {fail "(timeout) info break marker2"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored & auto-deleted break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored & auto-deleted break marker1"}
- timeout {fail "(timeout) no stop at ignored & auto-deleted break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored & auto-deleted break marker1"
+rerun_to_main
send_gdb "continue\n"
gdb_expect {
@@ -445,23 +416,8 @@ gdb_expect {
timeout {fail "(timeout) disable break marker1"}
}
-send_gdb "continue\n"
-gdb_expect {
- -re ".*Program exited normally.*$gdb_prompt $"\
- {pass "no stop at ignored & disabled break marker1"}
- -re "$gdb_prompt $"\
- {fail "no stop at ignored & disabled break marker1"}
- timeout {fail "(timeout) no stop at ignored & disabled break marker1"}
-}
-
-send_gdb "run\n"
-gdb_expect {
- -re "Starting program.*$gdb_prompt $"\
- {pass "rerun to main"}
- -re "$gdb_prompt $"\
- {fail "rerun to main"}
- timeout {fail "(timeout) rerun to main"}
-}
+gdb_continue_to_end "no stop at ignored & disabled break marker1"
+rerun_to_main
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {