diff --git a/dwarf_loader.c b/dwarf_loader.c index 21284ed..7148176 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -798,7 +798,7 @@ static int tag__recode_dwarf_bitfield(struct tag *tag, struct cu *cu, uint16_t b * the dwarf_cu as in dwarf there are no such things * as enumeration_types of less than 8 bits, etc. */ - recoded = cu__find_enumeration_by_sname_and_size(cu, sname, bit_size, &short_id); + recoded = cu__find_enumeration_by_name_and_size(cu, name, bit_size, &short_id); if (recoded != NULL) return short_id; diff --git a/dwarves.c b/dwarves.c index 602c928..ff66c93 100644 --- a/dwarves.c +++ b/dwarves.c @@ -758,15 +758,13 @@ struct tag *cu__find_base_type_by_sname_and_size(const struct cu *cu, return NULL; } -struct tag *cu__find_enumeration_by_sname_and_size(const struct cu *cu, - strings_t sname, - uint16_t bit_size, - type_id_t *idp) +struct tag *cu__find_enumeration_by_name_and_size(const struct cu *cu, const char *name, + uint16_t bit_size, type_id_t *idp) { uint32_t id; struct tag *pos; - if (sname == 0) + if (name == NULL) return NULL; cu__for_each_type(cu, id, pos) { @@ -774,7 +772,7 @@ struct tag *cu__find_enumeration_by_sname_and_size(const struct cu *cu, const struct type *t = tag__type(pos); if (t->size == bit_size && - t->namespace.name == sname) { + strcmp(type__name(t, cu), name) == 0) { if (idp != NULL) *idp = id; return pos; diff --git a/dwarves.h b/dwarves.h index b32f17b..37ddb43 100644 --- a/dwarves.h +++ b/dwarves.h @@ -356,10 +356,8 @@ struct tag *cu__find_base_type_by_sname_and_size(const struct cu *cu, uint16_t bit_size, type_id_t *idp); struct tag *cu__find_enumeration_by_name(const struct cu *cu, const char *name, type_id_t *idp); -struct tag *cu__find_enumeration_by_sname_and_size(const struct cu *cu, - strings_t sname, - uint16_t bit_size, - type_id_t *idp); +struct tag *cu__find_enumeration_by_name_and_size(const struct cu *cu, const char* name, + uint16_t bit_size, type_id_t *idp); struct tag *cu__find_first_typedef_of_type(const struct cu *cu, const type_id_t type); struct tag *cu__find_function_by_name(const struct cu *cu, const char *name);