diff options
author | Martin Galvan <martin.galvan@tallertechnologies.com> | 2016-04-18 10:58:14 -0300 |
---|---|---|
committer | Martin Galvan <martin.galvan@tallertechnologies.com> | 2016-04-18 10:58:14 -0300 |
commit | a22df60ad216517bbca4b391bec09f9ded06ab7b (patch) | |
tree | ed1d096713275c5bbe3a117a669bb5f943b9a049 /gdb/configure | |
parent | 0c13f7e559afe5f973a59311b0e401296c48d96c (diff) | |
download | gdb-a22df60ad216517bbca4b391bec09f9ded06ab7b.zip gdb-a22df60ad216517bbca4b391bec09f9ded06ab7b.tar.gz gdb-a22df60ad216517bbca4b391bec09f9ded06ab7b.tar.bz2 |
Fix gdb crash when trying to print the address of a synthetic C++ reference
After compiling a program which uses C++ references some optimizations may
convert the references into synthetic "pointers". Trying to print the address
of one of such synthetic references causes gdb to crash with the following
error:
(gdb) print &ref
/build/buildd/gdb-7.7.1/gdb/dwarf2loc.c:1624: internal-error: Should not be able to create a lazy value with an enclosing type
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Apparently, what was causing it was that value_addr returns a copy of the value
that represents the reference with its type set to T* instead of T&. However,
its enclosing_type is left untouched, which fails a check made in
read_pieced_value. We only see the crash happen for references that are
synthetic because they're treated as pieced values, thus the call to
read_pieced_value.
On a related note, it seems that in general there are all sorts of breakage
when working with synthetic references. This is reported here:
https://sourceware.org/bugzilla/show_bug.cgi?id=19893
gdb/ChangeLog:
2016-04-18 Martin Galvan <martin.galvan@tallertechnologies.com>
* valops.c (value_addr): For C++ references, set the copied value's
enclosing_type as well.
gdb/testsuite/ChangeLog:
2016-04-18 Martin Galvan <martin.galvan@tallertechnologies.com>
* gdb.dwarf2/implref.exp: New file.
Diffstat (limited to 'gdb/configure')
0 files changed, 0 insertions, 0 deletions