{
tdef * tdef_ptr=(tdef*)type->entry_ptr;
if (op==GETTYPE||op==GETJUSTTYPE) {
- char *typename=printname(tdef_ptr->target_ptr,op);
- return typename;
+ if (tdef_ptr->target_ptr==NULL)
+ return tdef_ptr->name;
+ if (tdef_ptr->target_ptr->tag_name==DW_TAG_union_type||
+ tdef_ptr->target_ptr->tag_name==DW_TAG_structure_type) {
+ collection_type *ctype=(collection_type*)tdef_ptr->target_ptr->entry_ptr;
+ if (ctype->name!=NULL)
+ return ctype->name;
+ ctype->name=tdef_ptr->name;
+ return tdef_ptr->name;
+ }
+ char *typename=printname(tdef_ptr->target_ptr,op);
+ return typename;
}
}
break;
collection_type *ctype=(collection_type*)type->entry_ptr;
if (op==GETTYPE&&ctype->name==NULL&&assigntype) {
ctype->name=(char*)malloc(100);
- sprintf(ctype->name,"TYPE%ld",typecount++);
+ sprintf(ctype->name,"unnamed_0x%lx",type->ID);
}
if (op==GETTYPE)
return ctype->name;
if (op==GETJUSTTYPE&&ctype->name==NULL&&assigntype) {
ctype->name=(char*)malloc(100);
- sprintf(ctype->name,"TYPE%ld",typecount++);
+ sprintf(ctype->name,"unnamed_0x%lx",type->ID);
}
if (op==GETJUSTTYPE)
return ctype->name;
case DW_AT_name:
return (tag_is_collection_type(tag) ||
tag_is_member(tag) ||
+ tag==DW_TAG_typedef||
tag_is_enumerator(tag) ||
tag_is_function(tag) ||
tag_is_formal_parameter(tag) ||
((enumerator*)e->entry_ptr)->name = strdup(str);
return 1;
}
+ else if (tag==DW_TAG_typedef)
+ {
+ ((tdef*)e->entry_ptr)->name = strdup(str);
+ return 1;
+ }
else if (tag_is_collection_type(tag))
{
((collection_type*)e->entry_ptr)->name = strdup(str);
} modifier_type;
typedef struct
-{
+{
unsigned long target_ID; // ID of the entry that contains the type that this modifies
unsigned long upperbound;
dwarf_entry* target_ptr; // Type that this entry modifies (DW_AT_type)
} array_bound;
typedef struct
-{
+{
unsigned long target_ID; // ID of the entry that contains the type that this modifies
+ char *name;
dwarf_entry* target_ptr; // Type that this entry modifies (DW_AT_type)
} tdef;
typedef struct
-{
+{
unsigned long target_ID; // ID of the entry that contains the type that this modifies
dwarf_entry* target_ptr; // Type that this entry modifies (DW_AT_type)
} consttype;
typedef struct
-{
+{
unsigned long target_ID; // ID of the entry that contains the type that this modifies
dwarf_entry* target_ptr; // Type that this entry modifies (DW_AT_type)
long data_member_location; // Addr offset relative to struct head