diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-05-08 00:01:14 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-07-12 12:09:53 +0100 |
commit | b86352cfc17fb7f07d5da9efcfd59f8b2bd08eee (patch) | |
tree | dc4d45d16d17b894c3864560ceae7afeec01cfce /gdb/ChangeLog | |
parent | 603490bf53fe1885ef45f9d0fb783b32f8ef6049 (diff) | |
download | gdb-b86352cfc17fb7f07d5da9efcfd59f8b2bd08eee.zip gdb-b86352cfc17fb7f07d5da9efcfd59f8b2bd08eee.tar.gz gdb-b86352cfc17fb7f07d5da9efcfd59f8b2bd08eee.tar.bz2 |
gdb/dwarf: Ensure the target type of ranges is not void
If a DW_TAG_subrange_type DWARF entry has no DW_AT_type then a default
type based on the size of an address on the current target is assumed.
We store this type as the target type for GDB's range types.
Currently GDB can create ranges for which the target type is VOID,
this is incorrect but seems to cause no problems. I believe the reason
this doesn't cause any issues is because the languages (for example
Ada) that actually make use of a ranges target type also have
compilers that generate DWARF that includes a DW_AT_type attribute.
However, gfortran does not include a DW_AT_type, its DWARF instead
relies on the default target type. This isn't currently a problem for
GDB as gfortran doesn't make use of the target type when printing
subranges, but it shouldn't hurt to fix this issue now.
I've added an assert into create_range_type that will catch this issue
if it comes up again.
This was tested on an x86-64/GNU-Linux machine with both the Ada and
gfortran compilers available with both '--target_board=unix' and
'--target_board=unix/-m32'. There are no user visible changes after
this commit.
gdb/ChangeLog:
* dwarf2read.c (read_subrange_index_type): New function.
(read_subrange_type): Move code into new function and call it.
* gdbtypes.c (create_range_type): Add some asserts.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 29b675d..c8c2b40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com> + * dwarf2read.c (read_subrange_index_type): New function. + (read_subrange_type): Move code into new function and call it. + * gdbtypes.c (create_range_type): Add some asserts. + +2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com> + * dwarf2loc.c (dwarf2_evaluate_property): Change return type, and update return statements. * dwarf2loc.h (dwarf2_evaluate_property): Update return type on |