diff --git a/ctf_loader.c b/ctf_loader.c index db3d606..47c5818 100644 --- a/ctf_loader.c +++ b/ctf_loader.c @@ -600,7 +600,7 @@ static int create_new_enumeration(struct ctf_state *sp, void *ptr, struct type *enumeration = type__new(DW_TAG_enumeration_type, ctf_string(ctf__get32(sp->ctf, &tp->base.ctf_name), sp), - sizeof(int)); /* FIXME: is this always the case? */ + sizeof(int) * 8); /* FIXME: is this always the case? */ if (enumeration == NULL) oom("enumeration"); diff --git a/dwarf_loader.c b/dwarf_loader.c index 9e5dec2..5a854df 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -1033,6 +1033,8 @@ static struct tag *die__create_new_enumeration(Dwarf_Die *die) if (enumeration->size == 0) enumeration->size = sizeof(int) * 8; + else + enumeration->size *= 8; if (!dwarf_haschildren(die) || dwarf_child(die, &child) != 0) { /* Seen on libQtCore.so.4.3.4.debug, diff --git a/dwarves.c b/dwarves.c index 58ab86f..26fd69a 100644 --- a/dwarves.c +++ b/dwarves.c @@ -344,7 +344,7 @@ reevaluate: } goto reevaluate; case DW_TAG_enumeration_type: - member_size = tag__type(type)->size; + member_size = tag__type(type)->size / 8; break; } @@ -924,7 +924,7 @@ size_t tag__size(const struct tag *self, const struct cu *cu) case DW_TAG_pointer_type: case DW_TAG_reference_type: return cu->addr_size; case DW_TAG_base_type: return base_type__size(self); - case DW_TAG_enumeration_type: return tag__type(self)->size; + case DW_TAG_enumeration_type: return tag__type(self)->size / 8; } if (self->type == 0) { /* struct class: unions, structs */