diff options
author | Tom de Vries <tdevries@suse.de> | 2018-07-18 18:33:07 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2018-07-26 00:08:52 +0200 |
commit | 506f5c41cab71dbc3e562ba367d2dc6b355b64a6 (patch) | |
tree | afac2c997fbf4e93388029a4386a1f7991261ce5 | |
parent | 16f808ec99b141bf03091d3b309a335c68d4e9e0 (diff) | |
download | gdb-506f5c41cab71dbc3e562ba367d2dc6b355b64a6.zip gdb-506f5c41cab71dbc3e562ba367d2dc6b355b64a6.tar.gz gdb-506f5c41cab71dbc3e562ba367d2dc6b355b64a6.tar.bz2 |
[gdb/symtab] Warn about unresolved DW_AT_upper_bound/DW_AT_count
This patch generates a warning if DW_AT_upper_bound or DW_AT_count is defined,
but can't be translated. This is triggered for current gcc in lto mode for
vla test-cases.
Build and reg-tested on x86_64-linux.
2018-07-26 Tom de Vries <tdevries@suse.de>
* dwarf2read.c (read_subrange_type): Warn if DW_AT_upper_bound or
DW_AT_count can't be translated to a dynamic prop.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 19 |
2 files changed, 22 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d6d96db..ee5c9ea 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-07-26 Tom de Vries <tdevries@suse.de> + + * dwarf2read.c (read_subrange_type): Warn if DW_AT_upper_bound or + DW_AT_count can't be translated to a dynamic prop. + 2018-07-25 Tom de Vries <tdevries@suse.de> * dwarf2loc.c (dwarf2_locexpr_baton_eval): Wrap ctx.eval call in diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 45280fe..de6b9f1 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -17626,10 +17626,11 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) sect_offset_str (die->sect_off), objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); - attr = dwarf2_attr (die, DW_AT_upper_bound, cu); + struct attribute *attr_ub, *attr_count; + attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); if (!attr_to_dynamic_prop (attr, die, cu, &high)) { - attr = dwarf2_attr (die, DW_AT_count, cu); + attr = attr_count = dwarf2_attr (die, DW_AT_count, cu); if (attr_to_dynamic_prop (attr, die, cu, &high)) { /* If bounds are constant do the final calculation here. */ @@ -17638,6 +17639,20 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) else high_bound_is_count = 1; } + else + { + if (attr_ub != NULL) + complaint (_("Unresolved DW_AT_upper_bound " + "- DIE at %s [in module %s]"), + sect_offset_str (die->sect_off), + objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); + if (attr_count != NULL) + complaint (_("Unresolved DW_AT_count " + "- DIE at %s [in module %s]"), + sect_offset_str (die->sect_off), + objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); + } + } /* Dwarf-2 specifications explicitly allows to create subrange types |