+Sun Oct 6 22:43:06 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * dwarf2read.c (read_tag_reference_type): New fn.
+ (read_type_die): Call it.
+ (dwarf_attr): Also look in the DIEs referred to by specification
+ or abstract_origin attributes.
+
Wed Oct 2 22:07:16 1996 Fred Fish <fnf@cygnus.com>
* inferior.h (IN_SIGTRAMP): Pass pc to SIGTRAMP_START and
die->type = type;
}
+/* Extract all information from a DW_TAG_reference_type DIE and add to
+ the user defined type vector. */
+
+static void
+read_tag_reference_type (die, objfile)
+ struct die_info *die;
+ struct objfile *objfile;
+{
+ struct type *type, *pointed_to_type;
+ struct attribute *attr;
+
+ if (die->type)
+ {
+ return;
+ }
+
+ pointed_to_type = die_type (die, objfile);
+
+ type = dwarf_alloc_type (objfile);
+ TYPE_TARGET_TYPE (type) = pointed_to_type;
+ TYPE_OBJFILE (type) = objfile;
+ attr = dwarf_attr (die, DW_AT_byte_size);
+ if (attr)
+ {
+ TYPE_LENGTH (type) = DW_UNSND (attr);
+ }
+ else
+ {
+ TYPE_LENGTH (type) = address_size;
+ }
+ TYPE_CODE (type) = TYPE_CODE_REF;
+ TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
+
+ TYPE_REFERENCE_TYPE (pointed_to_type) = type;
+ die->type = type;
+}
+
static void
read_tag_const_type (die, objfile)
struct die_info *die;
unsigned int name;
{
unsigned int i;
+ struct attribute *spec = NULL;
for (i = 0; i < die->num_attrs; ++i)
{
{
return &die->attrs[i];
}
+ if (die->attrs[i].name == DW_AT_specification
+ || die->attrs[i].name == DW_AT_abstract_origin)
+ spec = &die->attrs[i];
}
+ if (spec)
+ return dwarf_attr (follow_die_ref (DW_UNSND (spec)), name);
+
return NULL;
}
case DW_TAG_pointer_type:
read_tag_pointer_type (die, objfile);
break;
+ case DW_TAG_reference_type:
+ read_tag_reference_type (die, objfile);
+ break;
case DW_TAG_const_type:
read_tag_const_type (die, objfile);
break;