continue
}
-send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
- send_gdb "up\n"
- gdb_expect {
- -re ".*main.*$gdb_prompt $" {
- pass "up from marker1"
- }
- -re ".*$gdb_prompt $" {
- fail "up from marker1"
- }
- timeout { fail "up from marker1 (timeout)" }
- }
- }
- -re "$gdb_prompt $" { fail "continue to marker1" }
- timeout { fail "(timeout) continue to marker1" }
- }
-
-
-proc gdb_start_again {} {
-global srcdir
-global subdir
-global binfile
-global gdb_prompt
-global decimal
-
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-source ${binfile}.ci
-
-#
-# set it up at a breakpoint so we can play with the variable values
-#
-if ![runto_main] then {
- perror "couldn't run to breakpoint"
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
continue
}
-send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
- send_gdb "up\n"
- gdb_expect {
- -re ".*main.*$gdb_prompt $" {
- pass "up from marker1"
- }
- -re ".*$gdb_prompt $" {
- fail "up from marker1"
- }
- timeout { fail "up from marker1 (timeout)" }
- }
- }
- -re "$gdb_prompt $" { fail "continue to marker1" }
- timeout { fail "(timeout) continue to marker1" }
+gdb_test "up" ".*main.*" "up from marker1 1"
+
+proc gdb_start_again {} {
+ global srcdir
+ global subdir
+ global binfile
+ global gdb_prompt
+ global decimal
+
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ source ${binfile}.ci
+
+ #
+ # set it up at a breakpoint so we can play with the variable values
+ #
+ if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
}
-}
+ if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+ }
+ gdb_test "up" ".*main.*" "up from marker1 2"
+}
}
-send_gdb "break f\n" ; gdb_expect -re ".*$gdb_prompt $"
-
- send_gdb "cont\n"
- gdb_expect {
- -re "Break.* f \\(\\) at .*:$decimal.*$gdb_prompt $" {
- send_gdb "up\n"
- gdb_expect {
- -re ".*main2.*$gdb_prompt $" {
- pass "up from f"
- }
- -re ".*$gdb_prompt $" {
- fail "up from f"
- }
- timeout { fail "up from f (timeout)" }
- }
- }
- -re "$gdb_prompt $" { fail "continue to f" }
- timeout { fail "(timeout) continue to f" }
- }
+if ![runto 'f'] then {
+ perror "couldn't run to f"
+ continue
+}
+gdb_test "up" ".main2.*" "up from f"
send_gdb "print C\n"
gdb_expect {