diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 0e5c1826108..2906a5df6c3 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -270,8 +270,8 @@ struct symt_basic struct symt_enum { struct symt symt; + struct hash_table_elt hash_elt; struct symt* base_type; - const char* name; struct vector vchildren; }; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 56673a7e4c4..da4fc1a0a9d 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -88,7 +88,7 @@ const char* symt_get_name(const struct symt* sym) case SymTagLabel: return ((const struct symt_hierarchy_point*)sym)->hash_elt.name; case SymTagThunk: return ((const struct symt_thunk*)sym)->hash_elt.name; /* hierarchy tree */ - case SymTagEnum: return ((const struct symt_enum*)sym)->name; + case SymTagEnum: return ((const struct symt_enum*)sym)->hash_elt.name; case SymTagTypedef: return ((const struct symt_typedef*)sym)->hash_elt.name; case SymTagUDT: return ((const struct symt_udt*)sym)->hash_elt.name; case SymTagCompiland: return source_get(((const struct symt_compiland*)sym)->container->module, @@ -307,12 +307,19 @@ struct symt_enum* symt_new_enum(struct module* module, const char* typename, { struct symt_enum* sym; + TRACE_(dbghelp_symt)("Adding enum %s:%s\n", + debugstr_w(module->module.ModuleName), typename); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { sym->symt.tag = SymTagEnum; - sym->name = (typename) ? pool_strdup(&module->pool, typename) : NULL; + if (typename) + { + sym->hash_elt.name = pool_strdup(&module->pool, typename); + hash_table_add(&module->ht_types, &sym->hash_elt); + } else sym->hash_elt.name = NULL; sym->base_type = basetype; vector_init(&sym->vchildren, sizeof(struct symt*), 8); + symt_add_type(module, &sym->symt); } return sym; }