diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-08-24 16:39:11 +0200 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-08-24 16:39:11 +0200 |
commit | 663c44ac4d4336e99c282705b1d289b365b273d3 (patch) | |
tree | 9cdf5c905060c3a689afa3904cceac78e84059d9 | |
parent | 7073b5b9edc9e06974bd733b7e4b3845d6d6f690 (diff) | |
download | gdb-663c44ac4d4336e99c282705b1d289b365b273d3.zip gdb-663c44ac4d4336e99c282705b1d289b365b273d3.tar.gz gdb-663c44ac4d4336e99c282705b1d289b365b273d3.tar.bz2 |
DWARF-5 Fix DW_FORM_implicit_const
-gdwarf-4:
ptype logical
type = const char [2]
(gdb) PASS: gdb.base/constvars.exp: ptype logical
-gdwarf-5:
ptype logical
type = const char []
(gdb) FAIL: gdb.base/constvars.exp: ptype logical
<2><2fc>: Abbrev Number: 1 (DW_TAG_variable)
<2fd> DW_AT_name : (indirect string, offset: 0x2eb): logical
<301> DW_AT_decl_file : 1
1 DW_TAG_variable [no children]
DW_AT_name DW_FORM_strp
DW_AT_decl_file DW_FORM_implicit_const: 1
During symbol reading, invalid attribute class or form for
'DW_FORM_implicit_const' in '(null)'.
gdb/ChangeLog
2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
PR symtab/22003
* dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
(skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5dba51d..ff40216 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com> + PR symtab/22003 + * dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow) + (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) + (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const. + +2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com> + * dwarf2read.c (build_type_psymtabs_reader): New prototype. (process_psymtab_comp_unit): Accept IS_DEBUG_TYPES. (read_comp_units_from_section): New parameter abbrev_section, use diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 483d8ea..ead4f3c 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -19522,6 +19522,7 @@ dwarf2_const_value_attr (const struct attribute *attr, struct type *type, break; case DW_FORM_sdata: + case DW_FORM_implicit_const: *value = DW_SND (attr); break; @@ -20515,6 +20516,10 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) fprintf_unfiltered (f, "unexpected attribute form: DW_FORM_indirect"); break; + case DW_FORM_implicit_const: + fprintf_unfiltered (f, "constant: %s", + plongest (DW_SND (&die->attrs[i]))); + break; default: fprintf_unfiltered (f, "unsupported attribute form: %d.", die->attrs[i].form); @@ -20606,7 +20611,7 @@ dwarf2_get_ref_die_offset (const struct attribute *attr) static LONGEST dwarf2_get_attr_constant_value (const struct attribute *attr, int default_value) { - if (attr->form == DW_FORM_sdata) + if (attr->form == DW_FORM_sdata || attr->form == DW_FORM_implicit_const) return DW_SND (attr); else if (attr->form == DW_FORM_udata || attr->form == DW_FORM_data1 @@ -20941,6 +20946,7 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off, break; case DW_FORM_sdata: + case DW_FORM_implicit_const: type = die_type (die, cu); result = write_constant_as_bytes (obstack, byte_order, type, DW_SND (attr), len); @@ -21877,6 +21883,9 @@ skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end, } break; + case DW_FORM_implicit_const: + break; + default: { complain: @@ -22518,6 +22527,7 @@ attr_form_is_constant (const struct attribute *attr) case DW_FORM_data2: case DW_FORM_data4: case DW_FORM_data8: + case DW_FORM_implicit_const: return 1; default: return 0; |