This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/19893] Synthetic pointers created from C++ references are broken
- From: "martin.galvan at tallertechnologies dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 08 Apr 2016 18:41:14 +0000
- Subject: [Bug c++/19893] Synthetic pointers created from C++ references are broken
- Auto-submitted: auto-generated
- References: <bug-19893-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19893
--- Comment #3 from Martin Galvan <martin.galvan at tallertechnologies dot com> ---
Hi everyone,
I've fixed cases 2 and 3 by implementing pieced_value_funcs.coerce_ref as a
wrapper for indirect_pieced_value that works only for synthetic references. I
changed the check in indirect_pieced_value so that it works with both
TYPE_CODE_PTR and TYPE_CODE_REF, since gdb always assumes they're both
pointers.
While that seems to work, there's an issue: right now
pieced_value_funcs.coerce_ref takes a const value which represents the
reference, while indirect_pieced_value's argument isn't const. Dwelling deeper
I saw that this is correct: indirect_pieced_value needs to fetch the value's
contents (i.e. the pointer's value), which ends up calling value_fetch_lazy.
However, this breaks my approach unless I de-const the value all the way up
from pieced_value_funcs.coerce_ref (which is ugly, especially when done on
printing functions).
How could I go about doing this differently? Is there something I'm missing
here?
--
You are receiving this mail because:
You are on the CC list for the bug.