From: Daniel Jacobowitz <drow@mvista.com>
To: Michael Elizabeth Chastain <mec.gnu@mindspring.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa/testsuite] gdb1250.exp: make 'break abort' work with new pending breakpoints
Date: Sun, 29 Feb 2004 17:42:00 -0000 [thread overview]
Message-ID: <20040229174241.GM15749@nevyn.them.org> (raw)
In-Reply-To: <20040209225601.CFC1F4B363@berman.michael-chastain.com>
On Mon, Feb 09, 2004 at 05:56:01PM -0500, Michael Chastain wrote:
> > gdb_breakpoint "main" {allow-pending}
> > runto "main" {allow-pending}
>
> Something like that is okay with me -- exploiting the varargs features
> of TCL rather than adding another proc. I'm not fluent in TCL so
> I definitely have no sense of style in that area.
>
> I should just curl up with the TCL book already.
Something like this is what I had in mind. Does it work for you?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/gdb1250.exp: Use runto {allow-pending}.
* lib/gdb.exp (runto, gdb_breakpoint): Support {allow-pending}.
Index: testsuite/gdb.base/gdb1250.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/gdb1250.exp,v
retrieving revision 1.1
diff -u -p -r1.1 gdb1250.exp
--- testsuite/gdb.base/gdb1250.exp 15 Jul 2003 16:28:21 -0000 1.1
+++ testsuite/gdb.base/gdb1250.exp 29 Feb 2004 17:41:14 -0000
@@ -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
}
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.49
diff -u -p -r1.49 gdb.exp
--- testsuite/lib/gdb.exp 23 Feb 2004 19:27:46 -0000 1.49
+++ testsuite/lib/gdb.exp 29 Feb 2004 17:41:14 -0000
@@ -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;
}
next prev parent reply other threads:[~2004-02-29 17:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-09 22:55 Michael Elizabeth Chastain
2004-02-29 17:42 ` Daniel Jacobowitz [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-03-02 15:48 Michael Elizabeth Chastain
2004-03-19 0:09 ` Michael Elizabeth Chastain
2004-03-24 18:42 ` Daniel Jacobowitz
2004-02-09 22:45 Michael Elizabeth Chastain
2004-02-09 22:51 ` Daniel Jacobowitz
2004-02-09 22:05 Michael Elizabeth Chastain
2004-02-09 22:33 ` Daniel Jacobowitz
2004-02-09 7:23 Michael Elizabeth Chastain
2004-02-09 15:38 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040229174241.GM15749@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mec.gnu@mindspring.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox