Commit cf1cd335 authored by Alexandre Julliard's avatar Alexandre Julliard

dbghelp: Support pointer types of various sizes.

parent 06f76236
......@@ -287,6 +287,7 @@ struct symt_pointer
{
struct symt symt;
struct symt* pointsto;
unsigned long size;
};
struct symt_typedef
......@@ -724,7 +725,8 @@ extern BOOL symt_add_function_signature_parameter(struct module* module,
struct symt* param);
extern struct symt_pointer*
symt_new_pointer(struct module* module,
struct symt* ref_type);
struct symt* ref_type,
unsigned long size);
extern struct symt_typedef*
symt_new_typedef(struct module* module, struct symt* ref,
const char* name);
......@@ -1098,13 +1098,13 @@ static struct symt* dwarf2_parse_pointer_type(dwarf2_parse_context_t* ctx,
TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di));
if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 0;
if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = sizeof(void *);
if (!(ref_type = dwarf2_lookup_type(ctx, di)))
{
ref_type = ctx->symt_cache[sc_void];
assert(ref_type);
}
di->symt = &symt_new_pointer(ctx->module, ref_type)->symt;
di->symt = &symt_new_pointer(ctx->module, ref_type, size.u.uvalue)->symt;
if (di->abbrev->have_child) FIXME("Unsupported children\n");
return di->symt;
}
......@@ -1199,7 +1199,7 @@ static struct symt* dwarf2_parse_reference_type(dwarf2_parse_context_t* ctx,
ref_type = dwarf2_lookup_type(ctx, di);
/* FIXME: for now, we hard-wire C++ references to pointers */
di->symt = &symt_new_pointer(ctx->module, ref_type)->symt;
di->symt = &symt_new_pointer(ctx->module, ref_type, sizeof(void *))->symt;
if (di->abbrev->have_child) FIXME("Unsupported children\n");
......
......@@ -848,7 +848,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ
case '*':
case '&':
PTS_ABORTIF(ptd, stabs_pts_read_type_def(ptd, NULL, &ref_dt) == -1);
new_dt = &symt_new_pointer(ptd->module, ref_dt)->symt;
new_dt = &symt_new_pointer(ptd->module, ref_dt, sizeof(void*))->symt;
break;
case 'k': /* 'const' modifier */
case 'B': /* 'volatile' modifier */
......
......@@ -356,7 +356,7 @@ BOOL symt_add_function_signature_parameter(struct module* module,
return TRUE;
}
struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type)
struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, unsigned long size)
{
struct symt_pointer* sym;
......@@ -364,6 +364,7 @@ struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_ty
{
sym->symt.tag = SymTagPointerType;
sym->pointsto = ref_type;
sym->size = size;
symt_add_type(module, &sym->symt);
}
return sym;
......@@ -639,7 +640,7 @@ BOOL symt_get_info(struct module* module, const struct symt* type,
X(DWORD64) = ((const struct symt_function*)type)->size;
break;
case SymTagPointerType:
X(DWORD64) = sizeof(void*);
X(DWORD64) = ((const struct symt_pointer*)type)->size;
break;
case SymTagUDT:
X(DWORD64) = ((const struct symt_udt*)type)->size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment