From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/dbghelp_private.h | 6 +++--- dlls/dbghelp/dwarf.c | 6 +++++- dlls/dbghelp/msc.c | 10 ++++++++-- dlls/dbghelp/stabs.c | 7 +++++-- dlls/dbghelp/type.c | 5 ++--- 5 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 2d7d84f017e..5979eb7955a 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -930,9 +930,9 @@ extern BOOL symt_add_udt_element(struct module* module, extern struct symt_enum* symt_new_enum(struct module* module, const char* typename, struct symt* basetype); -extern BOOL symt_add_enum_element(struct module* module, - struct symt_enum* enum_type, - const char* name, int value); +extern BOOL symt_add_enum_element(struct module* module, + struct symt_enum* enum_type, + const char* name, const VARIANT *value); extern struct symt_array* symt_new_array(struct module* module, int min, DWORD count, struct symt* base, struct symt* index); diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 10549a11579..e15242f01a8 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -1838,6 +1838,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_debug_info_t* di, static void dwarf2_parse_enumerator(dwarf2_debug_info_t* di, struct symt_enum* parent) { + VARIANT v; struct attribute name; struct attribute value;
@@ -1845,7 +1846,10 @@ static void dwarf2_parse_enumerator(dwarf2_debug_info_t* di,
if (!dwarf2_find_attribute(di, DW_AT_name, &name)) return; if (!dwarf2_find_attribute(di, DW_AT_const_value, &value)) value.u.svalue = 0; - symt_add_enum_element(di->unit_ctx->module_ctx->module, parent, name.u.string, value.u.svalue); + V_VT(&v) = VT_I4; + V_I4(&v) = value.u.svalue; + + symt_add_enum_element(di->unit_ctx->module_ctx->module, parent, name.u.string, &v);
if (dwarf2_get_di_children(di)) FIXME("Unsupported children\n"); } diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 51025242879..18080768fad 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -891,19 +891,25 @@ static BOOL codeview_add_type_enum_field_list(struct codeview_type_parse* ctp, { case LF_ENUMERATE_V1: { + VARIANT v; int value, vlen = numeric_leaf(&value, type->enumerate_v1.data); const struct p_string* p_name = (const struct p_string*)&type->enumerate_v1.data[vlen]; + V_VT(&v) = VT_I4; + V_I4(&v) = value;
- symt_add_enum_element(ctp->module, symt, terminate_string(p_name), value); + symt_add_enum_element(ctp->module, symt, terminate_string(p_name), &v); ptr += 2 + 2 + vlen + (1 + p_name->namelen); break; } case LF_ENUMERATE_V3: { + VARIANT v; int value, vlen = numeric_leaf(&value, type->enumerate_v3.data); const char* name = (const char*)&type->enumerate_v3.data[vlen]; + V_VT(&v) = VT_I4; + V_I4(&v) = value;
- symt_add_enum_element(ctp->module, symt, name, value); + symt_add_enum_element(ctp->module, symt, name, &v); ptr += 2 + 2 + vlen + (1 + strlen(name)); break; } diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index 2f3ee9fff4e..d02f320e281 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -718,9 +718,10 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, return 0; }
-static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, +static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, struct symt_enum* edt) { + VARIANT v; LONG_PTR value; int idx;
@@ -730,7 +731,9 @@ static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, PTS_ABORTIF(ptd, stabs_pts_read_id(ptd) == -1); PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &value) == -1); PTS_ABORTIF(ptd, *ptd->ptr++ != ','); - symt_add_enum_element(ptd->module, edt, ptd->buf + idx, value); + V_VT(&v) = VT_I4; + V_I4(&v) = value; + symt_add_enum_element(ptd->module, edt, ptd->buf + idx, &v); ptd->idx = idx; } ptd->ptr++; diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 7e9bb44e690..a3ad80aacbb 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -342,7 +342,7 @@ struct symt_enum* symt_new_enum(struct module* module, const char* typename, }
BOOL symt_add_enum_element(struct module* module, struct symt_enum* enum_type, - const char* name, int value) + const char* name, const VARIANT *variant) { struct symt_data* e; struct symt** p; @@ -357,8 +357,7 @@ BOOL symt_add_enum_element(struct module* module, struct symt_enum* enum_type, e->kind = DataIsConstant; e->container = &enum_type->symt; e->type = enum_type->base_type; - V_VT(&e->u.value) = VT_I4; - V_I4(&e->u.value) = value; + e->u.value = *variant;
p = vector_add(&enum_type->vchildren, &module->pool); if (!p) return FALSE; /* FIXME we leak e */