Recognize names of array types
authorTom Tromey <tromey@adacore.com>
Wed, 4 Nov 2020 15:49:16 +0000 (08:49 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 4 Nov 2020 15:49:19 +0000 (08:49 -0700)
commitd8f62e8447e7ddba311e9a51d1bf36ef533a2745
tree48470d5feac3458a64216979d061fa730602be1d
parent7ff5b9370f4f7c0c75d734aa19b8f020429d4bb5
Recognize names of array types

With -fgnat-encodings=minimal, Gnat will emit DW_TAG_array_type that
has a name -- and this is the only time the name is emitted for the
type.  (For comparison, in C a typedef would be emitted in this
situation.)

This patch changes gdb to recognize the name of an array type.  This
is limited to Ada, to avoid any potential problems if some rogue DWARF
happens to name an array type in some other language, and to avoid
loading unnecessary partial DIEs.

gdb/ChangeLog
2020-11-04  Tom Tromey  <tromey@adacore.com>

* dwarf2/read.c (add_partial_symbol, process_die):
Handle DW_TAG_array_type.
(is_type_tag_for_partial): Add "lang" parameter.
(load_partial_dies, new_symbol): Handle DW_TAG_array_type.

gdb/testsuite/ChangeLog
2020-11-04  Tom Tromey  <tromey@adacore.com>

* gdb.ada/tick_length_array_enum_idx.exp: Add ptype test.
* gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb
(PT_Full): New variable.
* gdb.ada/tick_length_array_enum_idx/pck.adb
(Full_PT): New type.
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
gdb/testsuite/gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb
gdb/testsuite/gdb.ada/tick_length_array_enum_idx/pck.ads