diff options
author | Tom Tromey <tromey@adacore.com> | 2021-06-04 13:51:23 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-06-04 13:51:23 -0600 |
commit | 386de171cbffa86e804057030f3d64a404279f43 (patch) | |
tree | fb9c127f3c004533fa43110baa467b7405e323ce /gdb/ChangeLog | |
parent | 4351271e9c98553900f6ae3cbcaaa75198909daa (diff) | |
download | fsf-binutils-gdb-386de171cbffa86e804057030f3d64a404279f43.zip fsf-binutils-gdb-386de171cbffa86e804057030f3d64a404279f43.tar.gz fsf-binutils-gdb-386de171cbffa86e804057030f3d64a404279f43.tar.bz2 |
Add PROP_VARIABLE_NAME
With -fgnat-encodings=minimal, an internal version (these patches will
be upstreamed in the near future) of the Ada compiler can emit DWARF
for an array where the bound comes from a variable, like:
<1><12a7>: Abbrev Number: 7 (DW_TAG_array_type)
<12a8> DW_AT_name : (indirect string, offset: 0x1ae9): pck__my_array
[...]
<2><12b4>: Abbrev Number: 8 (DW_TAG_subrange_type)
<12b5> DW_AT_type : <0x1294>
<12b9> DW_AT_upper_bound : <0x1277>
With the upper bound DIE being:
<1><1277>: Abbrev Number: 2 (DW_TAG_variable)
<1278> DW_AT_name : (indirect string, offset: 0x1a4d): pck__my_length___U
<127c> DW_AT_type : <0x128f>
<1280> DW_AT_external : 1
<1280> DW_AT_artificial : 1
<1280> DW_AT_declaration : 1
Note that the variable is just a declaration -- in this situation, the
variable comes from another compilation unit, and must be found when
trying to compute the array bound.
This patch adds a new PROP_VARIABLE_NAME kind, to enable this search.
This same scenario can occur with DW_OP_GNU_variable_value, so this
patch adds support for that as well.
gdb/ChangeLog
2021-06-04 Tom Tromey <tromey@adacore.com>
* dwarf2/read.h (dwarf2_fetch_die_type_sect_off): Add 'var_name'
parameter.
* dwarf2/loc.c (dwarf2_evaluate_property) <case
PROP_VARIABLE_NAME>: New case.
(compute_var_value): New function.
(sect_variable_value): Use compute_var_value.
* dwarf2/read.c (attr_to_dynamic_prop): Handle DW_TAG_variable.
(var_decl_name): New function.
(dwarf2_fetch_die_type_sect_off): Add 'var_name' parameter.
* gdbtypes.h (enum dynamic_prop_kind) <PROP_VARIABLE_NAME>: New
constant.
(union dynamic_prop_data) <variable_name>: New member.
(struct dynamic_prop) <variable_name, set_variable_name>: New
methods.
gdb/testsuite/ChangeLog
2021-06-04 Tom Tromey <tromey@adacore.com>
* gdb.ada/array_of_symbolic_length.exp: New file.
* gdb.ada/array_of_symbolic_length/foo.adb: New file.
* gdb.ada/array_of_symbolic_length/gl.adb: New file.
* gdb.ada/array_of_symbolic_length/gl.ads: New file.
* gdb.ada/array_of_symbolic_length/pck.adb: New file.
* gdb.ada/array_of_symbolic_length/pck.ads: New file.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 99e935a..8ebb552 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +2021-06-04 Tom Tromey <tromey@adacore.com> + + * dwarf2/read.h (dwarf2_fetch_die_type_sect_off): Add 'var_name' + parameter. + * dwarf2/loc.c (dwarf2_evaluate_property) <case + PROP_VARIABLE_NAME>: New case. + (compute_var_value): New function. + (sect_variable_value): Use compute_var_value. + * dwarf2/read.c (attr_to_dynamic_prop): Handle DW_TAG_variable. + (var_decl_name): New function. + (dwarf2_fetch_die_type_sect_off): Add 'var_name' parameter. + * gdbtypes.h (enum dynamic_prop_kind) <PROP_VARIABLE_NAME>: New + constant. + (union dynamic_prop_data) <variable_name>: New member. + (struct dynamic_prop) <variable_name, set_variable_name>: New + methods. + 2021-06-04 Andrew Burgess <andrew.burgess@embecosm.com> * remote.c (remote_target) |