aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2read.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9eaa15f..3199eaa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-02 Joel Brobecker <brobecker@adacore.com>
+
+ * dwarf2read.c (read_unspecified_type): Treat
+ DW_TAG_enumeration_type DIEs from Ada units as stubs.
+
2018-01-01 Joel Brobecker <brobecker@adacore.com>
Update copyright year range in all GDB files.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index b4f5cd1..4dbd5c3 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17693,11 +17693,16 @@ read_unspecified_type (struct die_info *die, struct dwarf2_cu *cu)
{
struct type *type;
- /* For now, we only support the C meaning of an unspecified type: void. */
-
type = init_type (cu->objfile, TYPE_CODE_VOID, 0, NULL);
TYPE_NAME (type) = dwarf2_name (die, cu);
+ /* In Ada, an unspecified type is typically used when the description
+ of the type is defered to a different unit. When encountering
+ such a type, we treat it as a stub, and try to resolve it later on,
+ when needed. */
+ if (cu->language == language_ada)
+ TYPE_STUB (type) = 1;
+
return set_die_type (die, type, cu);
}