aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Chastain <mec@google.com>2001-03-16 17:59:58 +0000
committerMichael Chastain <mec@google.com>2001-03-16 17:59:58 +0000
commitb6c11a24b3d97163eafac1d5fd25f50aa0f02b76 (patch)
tree6d5fba0329eefa4a4e6a0e5fa8fa428b1e35938b
parentd1659392961b127fabe36ac18c1b399915ad6bd4 (diff)
downloadgdb-b6c11a24b3d97163eafac1d5fd25f50aa0f02b76.zip
gdb-b6c11a24b3d97163eafac1d5fd25f50aa0f02b76.tar.gz
gdb-b6c11a24b3d97163eafac1d5fd25f50aa0f02b76.tar.bz2
2001-02-24 Michael Chastain <chastain@redhat.com>
* gdb.c++/ref-types.exp: Change handwritten code to library function 'runto'.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.c++/ref-types.exp111
2 files changed, 39 insertions, 77 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 023218b..b1f3dfb 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-24 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/ref-types.exp: Change handwritten code to library
+ function 'runto'.
+
2001-03-16 Orjan Friberg <orjanf@axis.com>
* gdb.base/signals.exp: Set count to 0 explicitly.
diff --git a/gdb/testsuite/gdb.c++/ref-types.exp b/gdb/testsuite/gdb.c++/ref-types.exp
index 35b0ed0..dd06f02 100644
--- a/gdb/testsuite/gdb.c++/ref-types.exp
+++ b/gdb/testsuite/gdb.c++/ref-types.exp
@@ -54,70 +54,41 @@ if ![runto_main] then {
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"
+}
@@ -290,26 +261,12 @@ gdb_expect {
}
-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 {