This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix variable objects for references to pointers
- From: Daniel Jacobowitz <drow at false dot org>
- To: Nick Roberts <nickrob at snap dot net dot nz>
- Cc: Vladimir Prus <ghost at cs dot msu dot su>, gdb-patches at sources dot redhat dot com
- Date: Thu, 4 Jan 2007 09:09:07 -0500
- Subject: Re: [PATCH] Fix variable objects for references to pointers
- References: <17792.55489.274138.854508@kahikatea.snap.net.nz> <E1Gujg6-0003rU-38@zigzag.lvk.cs.msu.su> <17793.7666.771432.41360@kahikatea.snap.net.nz> <20070103225532.GQ17935@nevyn.them.org> <17820.52196.372141.269808@kahikatea.snap.net.nz>
On Thu, Jan 04, 2007 at 10:41:56PM +1300, Nick Roberts wrote:
> 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.
Let's hold off on this for a little bit and use Vlad's new stuff.
The above is better, except you really should use mi_gdb_test even if
you don't care about the result. It's important that every time you
send a command to GDB that produces output, you also consume that
output. Otherwise, you can get this behavior:
-> -break-insert $end_of_proc
-> -exec-continue
<- ^done
<- (gdb)
Oops, that looks like the default case, something must have gone
wrong with -exec-continue. FAIL.
<- ^running
<- ^stopped
<- (gdb)
--
Daniel Jacobowitz
CodeSourcery