diff options
author | Tom Tromey <tromey@adacore.com> | 2020-11-04 08:49:16 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-11-04 08:49:19 -0700 |
commit | d8f62e8447e7ddba311e9a51d1bf36ef533a2745 (patch) | |
tree | 48470d5feac3458a64216979d061fa730602be1d /gdb/testsuite | |
parent | 7ff5b9370f4f7c0c75d734aa19b8f020429d4bb5 (diff) | |
download | gdb-d8f62e8447e7ddba311e9a51d1bf36ef533a2745.zip gdb-d8f62e8447e7ddba311e9a51d1bf36ef533a2745.tar.gz gdb-d8f62e8447e7ddba311e9a51d1bf36ef533a2745.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite')
4 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fe97b07..745413a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,13 @@ 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. + +2020-11-04 Tom Tromey <tromey@adacore.com> + * gdb.ada/array_of_variant.exp: New file. * gdb.ada/array_of_variant/p.adb: New file. * gdb.ada/array_of_variant/pck.ads: New file. diff --git a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp index 52715cf..6dd01ac 100644 --- a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp +++ b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp @@ -41,3 +41,4 @@ gdb_test "ptype vars'length" "type = <$decimal-byte integer>" gdb_test "ptype full_table'length" "type = <$decimal-byte integer>" gdb_test "ptype primary_table'length" "type = <$decimal-byte integer>" gdb_test "ptype variable_table'length" "type = <$decimal-byte integer>" +gdb_test "ptype full_pt'length" "type = <$decimal-byte integer>" diff --git a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb index 934a7f8..0b2584f 100644 --- a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb +++ b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/foo_n207_004.adb @@ -20,9 +20,11 @@ procedure Foo_n207_004 is Prim : Primary_Table := (True, False, False); Cold : Variable_Table := (Green => False, Blue => True, White => True); Vars : Variable_Table := New_Variable_Table (Low => Red, High => Green); + PT_Full : Full_PT := (False, True, False, True, False); begin Do_Nothing (Full'Address); -- STOP Do_Nothing (Prim'Address); Do_Nothing (Cold'Address); Do_Nothing (Vars'Address); + Do_Nothing (PT_Full'Address); end Foo_n207_004; diff --git a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/pck.ads b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/pck.ads index 112caf1..461bee5 100644 --- a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/pck.ads +++ b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx/pck.ads @@ -21,6 +21,9 @@ package Pck is type Primary_Table is array (Color range Red .. Blue) of Boolean; type Variable_Table is array (Color range <>) of Boolean; + type Full_PT is array (Color) of Boolean; + pragma Pack (Full_PT); + function New_Variable_Table (Low: Color; High: Color) return Variable_Table; procedure Do_Nothing (A : System.Address); |