From e08b80a752591fad87127952858875831fd9d934 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Thu, 2 Sep 2021 11:22:32 +0200 Subject: [PATCH] dbghelp: Mostly get rid of symt_cache in dwarf debug information. Signed-off-by: Eric Pouech Signed-off-by: Alexandre Julliard --- dlls/dbghelp/dwarf.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 335c4a4e4ae..4503e42a227 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -164,10 +164,7 @@ typedef struct dwarf2_traverse_context_s /* symt_cache indexes */ #define sc_void 0 -#define sc_int1 1 -#define sc_int2 2 -#define sc_int4 3 -#define sc_num 4 +#define sc_num 1 typedef struct dwarf2_parse_context_s { @@ -181,7 +178,7 @@ typedef struct dwarf2_parse_context_s struct sparse_array debug_info_table; ULONG_PTR load_offset; ULONG_PTR ref_offset; - struct symt* symt_cache[sc_num]; /* void, int1, int2, int4 */ + struct symt* symt_cache[sc_num]; /* void */ char* cpp_name; } dwarf2_parse_context_t; @@ -1166,7 +1163,6 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx, struct attribute size; struct attribute encoding; enum BasicType bt; - int cache_idx = -1; if (di->symt) return di->symt; TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); @@ -1190,24 +1186,6 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx, default: bt = btNoType; break; } di->symt = &symt_new_basic(ctx->module, bt, name.u.string, size.u.uvalue)->symt; - switch (bt) - { - case btVoid: - assert(size.u.uvalue == 0); - cache_idx = sc_void; - break; - case btInt: - switch (size.u.uvalue) - { - case 1: cache_idx = sc_int1; break; - case 2: cache_idx = sc_int2; break; - case 4: cache_idx = sc_int4; break; - } - break; - default: break; - } - if (cache_idx != -1 && !ctx->symt_cache[cache_idx]) - ctx->symt_cache[cache_idx] = di->symt; if (dwarf2_get_di_children(ctx, di)) FIXME("Unsupported children\n"); return di->symt; @@ -1269,7 +1247,7 @@ static struct symt* dwarf2_parse_array_type(dwarf2_parse_context_t* ctx, { /* fake an array with unknown size */ /* FIXME: int4 even on 64bit machines??? */ - idx_type = ctx->symt_cache[sc_int4]; + idx_type = &symt_new_basic(ctx->module, btInt, "int", 4)->symt; min.u.uvalue = 0; cnt.u.uvalue = 0; } @@ -1347,9 +1325,6 @@ static struct symt* dwarf2_parse_unspecified_type(dwarf2_parse_context_t* ctx, basic = symt_new_basic(ctx->module, btVoid, name.u.string, size.u.uvalue); di->symt = &basic->symt; - if (!ctx->symt_cache[sc_void]) - ctx->symt_cache[sc_void] = di->symt; - if (dwarf2_get_di_children(ctx, di)) FIXME("Unsupported children\n"); return di->symt; }