[Bug rust/21484] watch -location does not work with rust

tromey at sourceware dot org sourceware-bugzilla@sourceware.org
Mon May 15 05:02:00 GMT 2017


--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This bug turns out to be surprisingly hard.

Location watchpoints try to set the language to C when the
expression is rewritten to *(TYPE*)ADDR.
However, this doesn't actually work, because nothing forces
the re-parse to be done in C.

Making the obvious change there also doesn't work -- it regresses
gdb.dlang/watch-loc.exp, which makes sense, because what happens
then is that gdb tries to parse a D type using the C parser.

My next idea was to change breakpoint.c to create an equivalent
expression without using the parser.  But here the problem is
how to re-parse the type string when resetting breakpoints.
There's no existing API (other than the language parser), AFAIK,
that can always parse the output of type_to_string.

And, if you're going to use the language parser anyway... I guess
we might as well just make the rewriter a lang hook.  So, that's
my current plan.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Gdb-prs mailing list