aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-11-12 19:54:39 +0000
committerDaniel Jacobowitz <drow@false.org>2009-11-12 19:54:39 +0000
commitb598bfda9b19e4d2b0f2ac646708315e123bdbbb (patch)
treeb898c382920a9c865d4d2539f7a66fa75a9a9e4f /gdb/testsuite
parentd48cc9dd6fbc2e64af32b5ec1680e8255eeb4edd (diff)
downloadgdb-b598bfda9b19e4d2b0f2ac646708315e123bdbbb.zip
gdb-b598bfda9b19e4d2b0f2ac646708315e123bdbbb.tar.gz
gdb-b598bfda9b19e4d2b0f2ac646708315e123bdbbb.tar.bz2
testsuite/
* lib/gdb.exp (gdb_test_multiple): Handle "y or [n]", "[y] or n", and the breakpoint menu. Do not call perror if a prompt is seen. Consume the following GDB prompt. * gdb.cp/method2.exp (test_break): Use gdb_test_multiple. * gdb.cp/namespace.exp: Use gdb_test. * gdb.cp/templates.exp: Use gdb_test. (test_template_breakpoints): Use gdb_test_multiple.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.cp/method2.exp5
-rw-r--r--gdb/testsuite/gdb.cp/namespace.exp30
-rw-r--r--gdb/testsuite/gdb.cp/templates.exp13
-rw-r--r--gdb/testsuite/lib/gdb.exp12
5 files changed, 29 insertions, 41 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b03b420..aed26c8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,15 @@
2009-11-12 Daniel Jacobowitz <dan@codesourcery.com>
+ * lib/gdb.exp (gdb_test_multiple): Handle "y or [n]", "[y] or n",
+ and the breakpoint menu. Do not call perror if a prompt is seen.
+ Consume the following GDB prompt.
+ * gdb.cp/method2.exp (test_break): Use gdb_test_multiple.
+ * gdb.cp/namespace.exp: Use gdb_test.
+ * gdb.cp/templates.exp: Use gdb_test.
+ (test_template_breakpoints): Use gdb_test_multiple.
+
+2009-11-12 Daniel Jacobowitz <dan@codesourcery.com>
+
* gdb.base/break1.c (struct some_struct, values): Move earlier.
(marker4): Reference values.
diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp
index 6181132..d651c74 100644
--- a/gdb/testsuite/gdb.cp/method2.exp
+++ b/gdb/testsuite/gdb.cp/method2.exp
@@ -50,15 +50,12 @@ proc test_break { lang } {
"" \
"setting language $lang"
- send_gdb "break A::method\n"
- gdb_expect {
+ gdb_test_multiple "break A::method" "breaking in method ($lang)" {
-re ".0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. A::method\\(A\\*\\) at .*\[\r\n\]*.3. A::method\\(int\\) at .*\[\r\n\]*\[\r\n\]*.4. A::method\\(\\) at .*\[\r\n\]*> $" {
gdb_test "0" \
"canceled" \
"breaking in method ($lang)"
}
- -re ".*$gdb_prompt $" { fail "breaking in method ($lang)" }
- default { fail "breaking in method ($lang) (timeout)" }
}
}
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 76b1b82..e1ddd50 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -163,14 +163,8 @@ gdb_expect {
# Break on a function in a namespace
-send_gdb "break AAA::xyzq\n"
-gdb_expect {
- -re "Breakpoint.*at $hex: file.*namespace.cc, line 42\\.\r\n$gdb_prompt $" {
- pass "break AAA::xyzq"
- }
- -re ".*$gdb_prompt $" { fail "break AAA::xyzq" }
- timeout { fail "(timeout) break AAA::xyzq" }
-}
+gdb_test "break AAA::xyzq" \
+ "Breakpoint.*at $hex: file.*namespace.cc, line 42\\."
# Call a function in a nested namespace
@@ -194,14 +188,8 @@ gdb_expect {
# Break on a function in a nested namespace
-send_gdb "break BBB::CCC::xyzq\n"
-gdb_expect {
- -re "Breakpoint.*at $hex: file.*namespace.cc, line 58\\.\r\n$gdb_prompt $" {
- pass "break BBB::CCC::xyzq"
- }
- -re ".*$gdb_prompt $" { fail "break BBB::CCC::xyzq" }
- timeout { fail "(timeout) break BBB::CCC::xyzq" }
-}
+gdb_test "break BBB::CCC::xyzq" \
+ "Breakpoint.*at $hex: file.*namespace.cc, line 58\\."
# Print address of a function in a class in a namespace
@@ -225,14 +213,8 @@ gdb_expect {
# Break on a function in a class in a namespace
-send_gdb "break BBB::Class::xyzq\n"
-gdb_expect {
- -re "Breakpoint.*at $hex: file.*namespace.cc, line 63\\.\r\n$gdb_prompt $" {
- pass "break BBB::Class::xyzq"
- }
- -re ".*$gdb_prompt $" { fail "break BBB::Class::xyzq" }
- timeout { fail "(timeout) break BBB::Class::xyzq" }
-}
+gdb_test "break BBB::Class::xyzq" \
+ "Breakpoint.*at $hex: file.*namespace.cc, line 63\\."
# Test to see if the appropriate namespaces are in scope when trying
# to print out stuff from within a function defined within a
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 487186a..5e16b1b 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -112,8 +112,7 @@ proc test_template_breakpoints {} {
global srcdir
global hp_aCC_compiler
- send_gdb "break T5<int>::T5\n"
- gdb_expect {
+ gdb_test_multiple "break T5<int>::T5" "constructor breakpoint" {
-re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5<int>::T5\\(int\\) at .*\[\r\n\]*.3. T5<int>::T5\\((T5<int> const|const T5<int>) ?&\\) at .*\[\r\n\]*> $" {
gdb_test "0" \
"canceled" \
@@ -135,8 +134,6 @@ proc test_template_breakpoints {} {
"nonsense intended to insure that this test fails" \
"constructor breakpoint (bad menu choices)"
}
- -re ".*$gdb_prompt $" { fail "constructor breakpoint" }
- default { fail "constructor breakpoint (timeout)" }
}
# See CLLbs14792
@@ -546,9 +543,5 @@ gdb_expect {
# djb - 06-03-2000
# Now should work fine
-send_gdb "break Garply<Garply<char> >::garply\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" }
- -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" }
- timeout { fail "break Garply<Garply<char> >::garply (timeout)" }
-}
+gdb_test "break Garply<Garply<char> >::garply" \
+ "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index c9ce905..b5e55ec 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -763,10 +763,16 @@ proc gdb_test_multiple { command message user_code } {
fail "$message"
set result -1
}
- -re "\\(y or n\\) " {
+ -re "\\((y or n|y or \\\[n\\\]|\\\[y\\\] or n)\\) " {
send_gdb "n\n"
- perror "Got interactive prompt."
- fail "$message"
+ gdb_expect -re "$gdb_prompt $"
+ fail "$message (got interactive prompt)"
+ set result -1
+ }
+ -re "\\\[0\\\] cancel\r\n\\\[1\\\] all.*\r\n> $" {
+ send_gdb "0\n"
+ gdb_expect -re "$gdb_prompt $"
+ fail "$message (got breakpoint menu)"
set result -1
}
eof {