* gdb.base/attach.exp: When trying to attach to a nonexistent
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / ena-dis-br.exp
index 6593d824294d28a38d82832d81411bd4c45105e0..93f6707097c258c1ed7b9155f05766a4f80181d9 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+#   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 
 
 # This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
 #
 send_gdb "break marker1\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
           {pass "break marker1"}
   -re "$gdb_prompt $"\
           {fail "break marker1"}
@@ -73,10 +73,14 @@ gdb_expect {
   timeout {fail "(timeout) info break marker1"}
 }
 
+# See the comments in condbreak.exp for "run until breakpoint at marker1" 
+# for an explanation of the xfail below.
 send_gdb "continue\n"
 gdb_expect {
   -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
           {pass "continue to break marker1"}
+  -re "Breakpoint \[0-9\]*, $hex in marker1.*$gdb_prompt $"\
+          {xfail "continue to break marker1"}
   -re "$gdb_prompt $"\
           {fail "continue to break marker1"}
   timeout {fail "(timeout) continue to break marker1"}
@@ -94,7 +98,7 @@ gdb_expect {
 #
 send_gdb "break marker2\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 42.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
           {pass "break marker2"}
   -re "$gdb_prompt $"\
           {fail "break marker2"}
@@ -117,10 +121,14 @@ gdb_expect {
   timeout {fail "(timeout) info auto-disabled break marker2"}
 }
 
+# See the comments in condbreak.exp for "run until breakpoint at marker1" 
+# for an explanation of the xfail below.
 send_gdb "continue\n"
 gdb_expect {
   -re "Breakpoint \[0-9\]*, marker2.*$gdb_prompt $"\
           {pass "continue to auto-disabled break marker2"}
+  -re "Breakpoint \[0-9\]*, $hex in marker2.*$gdb_prompt $"\
+          {xfail "continue to auto-disabled break marker2"}
   -re "$gdb_prompt $"\
           {fail "continue to auto-disabled break marker2"}
   timeout {fail "(timeout) continue to auto-disabled break marker2"}
@@ -137,32 +145,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.
@@ -171,7 +156,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
 send_gdb "break marker3\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 43.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
           {pass "break marker3"}
   -re "$gdb_prompt $"\
           {fail "break marker3"}
@@ -196,7 +181,7 @@ gdb_expect {
 
 send_gdb "continue\n"
 gdb_expect {
-  -re ".*marker3 .*:43.*$gdb_prompt $"\
+  -re ".*marker3 .*:(45|50).*$gdb_prompt $"\
           {pass "continue to auto-deleted break marker3"}
   -re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
           {fail "continue to auto-deleted break marker3"}
@@ -221,7 +206,7 @@ gdb_expect {
 #
 send_gdb "break marker4\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 44.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
           {pass "break marker4"}
   -re "$gdb_prompt $"\
           {fail "break marker4"}
@@ -252,7 +237,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
 send_gdb "break marker1\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
           {pass "break marker1"}
   -re "$gdb_prompt $"\
           {fail "break marker1"}
@@ -321,31 +306,20 @@ 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
 
+# See the comments in condbreak.exp for "run until breakpoint at marker1" 
+# for an explanation of the xfail below.
 send_gdb "continue\n"
 gdb_expect {
   -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
-          {pass "continue to break marker1"}
+          {pass "continue to break marker1, 2nd time"}
+  -re "Breakpoint \[0-9\]*, $hex in marker1.*$gdb_prompt $"\
+          {xfail "continue to break marker1, 2nd time"}
   -re "$gdb_prompt $"\
-          {fail "continue to break marker1"}
-  timeout {fail "(timeout) continue to break marker1"}
+          {fail "continue to break marker1, 2nd time"}
+  timeout {fail "(timeout) continue to break marker1, 2nd time"}
 }
 
 # Verify that we can specify both an ignore count and an auto-delete.
@@ -354,7 +328,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
 send_gdb "break marker1\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
           {pass "break marker1"}
   -re "$gdb_prompt $"\
           {fail "break marker1"}
@@ -386,27 +360,12 @@ 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 {
-  -re ".*marker1 .*:41.*$gdb_prompt $"\
+  -re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
           {pass "continue to ignored & auto-deleted break marker1"}
   -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
           {fail "continue to ignored & auto-deleted break marker1"}
@@ -422,7 +381,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
 send_gdb "break marker1\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
           {pass "break marker1"}
   -re "$gdb_prompt $"\
           {fail "break marker1"}
@@ -445,23 +404,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 {
@@ -479,9 +423,9 @@ gdb_expect {
 #
 if ![runto_main] then { fail "enable/disable break tests suppressed" }
 
-send_gdb "break 64\n"
+send_gdb "break 79\n"
 gdb_expect {
-  -re "Breakpoint \[0-9\]*.*, line 64.*$gdb_prompt $"\
+  -re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
           {pass "prepare to continue with ignore count"}
   -re "$gdb_prompt $"\
           {fail "prepare to continue with ignore count"}
@@ -498,7 +442,7 @@ gdb_expect {
 
 send_gdb "next\n"
 gdb_expect {
-  -re ".*66\[ \t\]*marker1.*$gdb_prompt $"\
+  -re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
           {pass "step after continue with ignore count"}
   -re "$gdb_prompt $"\
           {fail "step after continue with ignore count"}
This page took 0.034084 seconds and 4 git commands to generate.