aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-03-24 18:41:50 +0000
committerDaniel Jacobowitz <drow@false.org>2004-03-24 18:41:50 +0000
commit78a1a89446001cbf31afab01607aa6be84a3835d (patch)
tree20c88dc3bdcbc7e8ed0c7fbee969eb0303e2b740 /gdb/testsuite
parent920e3419642574eddd166f0741753a7d7dd804b4 (diff)
downloadgdb-78a1a89446001cbf31afab01607aa6be84a3835d.zip
gdb-78a1a89446001cbf31afab01607aa6be84a3835d.tar.gz
gdb-78a1a89446001cbf31afab01607aa6be84a3835d.tar.bz2
* gdb.base/gdb1250.exp: Use runto {allow-pending}.
* lib/gdb.exp (runto, gdb_breakpoint): Support {allow-pending}.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/gdb1250.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp25
3 files changed, 26 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6c85be8..2b2d4b4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/gdb1250.exp: Use runto {allow-pending}.
+ * lib/gdb.exp (runto, gdb_breakpoint): Support {allow-pending}.
+
2004-03-22 Andrew Cagney <cagney@redhat.com>
* gdb.base/watchpoint.exp (test_stepping): Delete bogus XFAILs
diff --git a/gdb/testsuite/gdb.base/gdb1250.exp b/gdb/testsuite/gdb.base/gdb1250.exp
index 60a6f59..4ffdf2b 100644
--- a/gdb/testsuite/gdb.base/gdb1250.exp
+++ b/gdb/testsuite/gdb.base/gdb1250.exp
@@ -42,7 +42,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-if ![runto abort] then {
+if ![runto abort {allow-pending}] then {
perror "couldn't run to breakpoint"
continue
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 72d9143..f49cbbf 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -265,18 +265,32 @@ proc gdb_run_cmd {args} {
}
}
-proc gdb_breakpoint { function } {
+# Set a breakpoint at FUNCTION. If there is an additional argument it is
+# a list of options; the only currently supported option is allow-pending.
+
+proc gdb_breakpoint { function args } {
global gdb_prompt
global decimal
+ set pending_response n
+ if {[lsearch -exact [lindex $args 0] allow-pending] != -1} {
+ set pending_response y
+ }
+
send_gdb "break $function\n"
# The first two regexps are what we get with -g, the third is without -g.
gdb_expect 30 {
-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
+ -re "Breakpoint \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" {
+ if {$pending_response == "n"} {
+ fail "setting breakpoint at $function"
+ return 0
+ }
+ }
-re "Make breakpoint pending.*y or \\\[n\\\]. $" {
- send_gdb "n\n"
+ send_gdb "$pending_response\n"
exp_continue
}
-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
@@ -289,15 +303,16 @@ proc gdb_breakpoint { function } {
# Since this is the only breakpoint that will be set, if it stops
# at a breakpoint, we will assume it is the one we want. We can't
# just compare to "function" because it might be a fully qualified,
-# single quoted C++ function specifier.
+# single quoted C++ function specifier. If there's an additional argument,
+# pass it to gdb_breakpoint.
-proc runto { function } {
+proc runto { function args } {
global gdb_prompt
global decimal
delete_breakpoints
- if ![gdb_breakpoint $function] {
+ if ![gdb_breakpoint $function [lindex $args 0]] {
return 0;
}