]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix handling of DW_TAG_unspecified_type for Ada
authorTom Tromey <tromey@adacore.com>
Tue, 13 Jun 2023 15:36:35 +0000 (09:36 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 28 Jun 2023 15:49:22 +0000 (09:49 -0600)
commit6e27b5eb0072902173305d0ce41c33b82f5b2bb3
treecf21d6055d49c3bc432de64a577e216d72a878f4
parent1d2ee87e604319cf6b5ad9934e2bb18cbdc63e1b
Fix handling of DW_TAG_unspecified_type for Ada

Commit 80eaec735e ("[gdb/symtab] Handle named DW_TAG_unspecified_type
DIE") changed the handling of DW_TAG_unspecified_type.  Before this
change, such types were not entered into the symbol table.

It turns out that, when such a type is in the symtab, it can cause
failures in Ada.  In particular, a private type in another package may
be seen locally as "void".

Now, it would probably be better to fix this via check_typedef.
However, that is somewhat difficult given the state of the DWARF
reader -- in particular with gdb_index, this would require expanding
potentially many CUs to find the correct type.

Instead, this patch changes gdb to not enter a symbol for an
unspecified type -- but only for Ada.
gdb/dwarf2/read.c
gdb/testsuite/gdb.ada/py_taft.exp