From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: Vladimir Prus <ghost@cs.msu.su>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fix variable objects for references to pointers
Date: Thu, 04 Jan 2007 09:42:00 -0000 [thread overview]
Message-ID: <17820.52196.372141.269808@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20070103225532.GQ17935@nevyn.them.org>
> > + set end_of_proc [gdb_get_line_number "return 99;"]
> > + send_gdb "-exec-next 4\n"
> > + gdb_expect {
> > + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"reference_to_pointer\",args=\\\[\\\],file=\".*${srcfile}\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$end_of_proc\"\}\r\n$mi_gdb_prompt$" {
> > + pass "4xnext to return 99"
> > + }
> > + timeout { fail "4xnext in reference_to_pointer (timeout)" }
> > + }
>
> Using send_gdb / gdb_expect this way is a problem. If anything goes
> wrong, then the test will sit until it times out. There's only
> one pattern, so you could use mi_gdb_test. "-exec-next 4"
> isn't great either; compiler changes or test changes can easily
> make you end up somewhere unexpected.
>
> This line isn't testing anything you're interested in, right?
> Then you can just put a breakpoint in the right place and run
> to that breakpoint. I'd recommend mi_continue_to. I don't
> see a convenient helper in mi-support.exp to set the breakpoint, but
> there's an example in mi-var-cmd.exp.
Something like below?
set end_of_proc [gdb_get_line_number "return 99;"]
send_gdb "-break-insert $end_of_proc\n"
mi_continue_to ".*" reference_to_pointer "" ".*${srcfile}" $end_of_proc \
"continue to return 99"
Other tests seem to use mi_gdb_test for -break-insert but I'm not interested in
the result and mi_continue presumably sifts through the output until it reaches
something it recognises. I'm also not that interested in the breakpoint
number so I've used a wildcard for future-proofing.
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2007-01-04 9:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 4:58 Nick Roberts
2006-12-14 6:03 ` Vladimir Prus
2006-12-14 9:53 ` Nick Roberts
2006-12-21 15:25 ` Vladimir Prus
2006-12-21 22:38 ` Nick Roberts
2007-01-03 22:55 ` Daniel Jacobowitz
2007-01-04 9:42 ` Nick Roberts [this message]
2007-01-04 11:56 ` Vladimir Prus
2007-01-04 14:09 ` Daniel Jacobowitz
2007-01-04 22:30 ` Nick Roberts
2007-01-04 22:33 ` Daniel Jacobowitz
2007-01-03 22:49 ` 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=17820.52196.372141.269808@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=ghost@cs.msu.su \
/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