From 8d56b202ddc9ada7b9546f6941e021a8cb628c42 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 12 Jun 2013 20:11:49 +0000 Subject: [PATCH] Handle DW_TAG_unspecified_type 2011-11-14 Jim Ingham * dwarf2read.c (read_type_die): Handle DW_TAG_unspecified_type. (read_tag_unspecified_type): New function, add a type for the DW_TAG_unspecified_type die. Obtained from: Apple, gdb-1752 --- contrib/gdb/gdb/dwarf2read.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/contrib/gdb/gdb/dwarf2read.c b/contrib/gdb/gdb/dwarf2read.c index 2e2737de0011..72f5ddede09c 100644 --- a/contrib/gdb/gdb/dwarf2read.c +++ b/contrib/gdb/gdb/dwarf2read.c @@ -825,6 +825,8 @@ static void read_array_type (struct die_info *, struct dwarf2_cu *); static void read_tag_pointer_type (struct die_info *, struct dwarf2_cu *); +static void read_tag_unspecified_type (struct die_info *, struct dwarf2_cu *); + static void read_tag_ptr_to_member_type (struct die_info *, struct dwarf2_cu *); @@ -3721,6 +3723,27 @@ read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu) die->type = type; } +static void +read_tag_unspecified_type (struct die_info *die, struct dwarf2_cu *cu) +{ + struct objfile *objfile = cu->objfile; + struct type *type; + struct attribute *attr; + + if (die->type) + { + return; + } + + type = alloc_type (objfile); + TYPE_LENGTH (type) = 0; + attr = dwarf2_attr (die, DW_AT_name, cu); + if (attr && DW_STRING (attr)) + TYPE_NAME (type) = DW_STRING (attr); + + die->type = type; +} + static void read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu) { @@ -6094,6 +6117,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_pointer_type: read_tag_pointer_type (die, cu); break; + case DW_TAG_unspecified_type: + read_tag_unspecified_type (die, cu); + break; case DW_TAG_ptr_to_member_type: read_tag_ptr_to_member_type (die, cu); break;