One major change of Dwarf3/4 over Dwarf2 is that the size of some attributes (like addresses among others) is parametrized at the level of a compilation unit.
Current dbghelp code stores such CU header parameters at the module's level (assuming it's the same across all CU:s of a module).
This serie: - mainly changes the internal data model by attaching those parameters at the CU level (except for .eh_frame section) - it also allows to enable loading of dwarf3/4 debug info if the DBGHELP_DWARF_VERSION environment variable is set to 3 or 4.
I don't recommend at this stage using this variable; it's better to delay until next serie (which shall cover the rest of the syntaxic changes in dwarf format; more series afterwards will cover more semantic changes and extensions).
A+
---
Eric Pouech (10): dbghelp{dwarf}: Allow tweaking from env variable which DWARF version is to be loaded. dbghelp{dwarf}: introdicting dwarf2_cuhead_s a structure to hold compilation unit parsing info dbghelp{dwarf}: share compilation unit header information dbghelp{dwarf}: add word size parameter to parse_addr() internal function dbghelp{dwarf}: now pass dwarf2_cuhead_t for addr details to swallow_attribute dbghelp{dwarf}: now passing a parse_cuhead_t to compute_location() dbghelp{dwarf}: passing word_size as a parameter to a couple of frame related functions dbghelp{dwarf}: now using word_size from cuhead_t dbghelp{dwarf}: passing dwarf2_cuhead_t to lookuploclist() dbghelp{dwarf}: initialize module's word_size at module load time
dlls/dbghelp/dbghelp_private.h | 1 + dlls/dbghelp/dwarf.c | 167 ++++++++++++++++++++------------- dlls/dbghelp/symbol.c | 1 + 3 files changed, 103 insertions(+), 66 deletions(-)
This is a temporary feature while implementing the required bits for Dwarf3 and Dwarf4 format.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index af84fb660b8..7133d489c28 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2344,6 +2344,8 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, unsigned short cu_version; ULONG_PTR cu_abbrev_offset; BOOL ret = FALSE; + /* FIXME this is a temporary configuration while adding support for dwarf3&4 bits */ + static LONG max_supported_dwarf_version = 0;
cu_length = dwarf2_parse_u4(mod_ctx); cu_ctx.data = mod_ctx->data; @@ -2360,10 +2362,21 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, TRACE("- abbrev_offset: %lu\n", cu_abbrev_offset); TRACE("- word_size: %u\n", cu_ctx.word_size);
- if (cu_version != 2) + if (max_supported_dwarf_version == 0) { - WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2.\n", - cu_version); + char* env = getenv("DBGHELP_DWARF_VERSION"); + LONG v = env ? atol(env) : 2; + max_supported_dwarf_version = (v >= 2 && v <= 4) ? v : 2; + } + + if (cu_version < 2 || cu_version > max_supported_dwarf_version) + { + if (max_supported_dwarf_version > 2) + WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2 up to %u.\n", + cu_version, max_supported_dwarf_version); + else + WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2.\n", + cu_version); return FALSE; }
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 7133d489c28..abc011ad2e4 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -167,6 +167,12 @@ typedef struct dwarf2_traverse_context_s #define sc_unknown 1 #define sc_num 2
+typedef struct dwarf2_cuhead_s +{ + unsigned char word_size; /* size of a word on target machine */ + unsigned char version; +} dwarf2_cuhead_t; + typedef struct dwarf2_parse_context_s { const dwarf2_section_t* sections; @@ -181,6 +187,7 @@ typedef struct dwarf2_parse_context_s ULONG_PTR ref_offset; struct symt* symt_cache[sc_num]; /* void, unknown */ char* cpp_name; + dwarf2_cuhead_t head; } dwarf2_parse_context_t;
/* stored in the dbghelp's module internal structure for later reuse */ @@ -2341,7 +2348,6 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, dwarf2_traverse_context_t cu_ctx; const unsigned char* comp_unit_start = mod_ctx->data; ULONG_PTR cu_length; - unsigned short cu_version; ULONG_PTR cu_abbrev_offset; BOOL ret = FALSE; /* FIXME this is a temporary configuration while adding support for dwarf3&4 bits */ @@ -2351,16 +2357,16 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, cu_ctx.data = mod_ctx->data; cu_ctx.end_data = mod_ctx->data + cu_length; mod_ctx->data += cu_length; - cu_version = dwarf2_parse_u2(&cu_ctx); + ctx.head.version = dwarf2_parse_u2(&cu_ctx); cu_abbrev_offset = dwarf2_parse_u4(&cu_ctx); - cu_ctx.word_size = dwarf2_parse_byte(&cu_ctx); + ctx.head.word_size = cu_ctx.word_size = dwarf2_parse_byte(&cu_ctx);
TRACE("Compilation Unit Header found at 0x%x:\n", (int)(comp_unit_start - sections[section_debug].address)); TRACE("- length: %lu\n", cu_length); - TRACE("- version: %u\n", cu_version); + TRACE("- version: %u\n", ctx.head.version); TRACE("- abbrev_offset: %lu\n", cu_abbrev_offset); - TRACE("- word_size: %u\n", cu_ctx.word_size); + TRACE("- word_size: %u\n", ctx.head.word_size);
if (max_supported_dwarf_version == 0) { @@ -2369,14 +2375,14 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, max_supported_dwarf_version = (v >= 2 && v <= 4) ? v : 2; }
- if (cu_version < 2 || cu_version > max_supported_dwarf_version) + if (ctx.head.version < 2 || ctx.head.version > max_supported_dwarf_version) { if (max_supported_dwarf_version > 2) WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2 up to %u.\n", - cu_version, max_supported_dwarf_version); + ctx.head.version, max_supported_dwarf_version); else WARN("%u DWARF version unsupported. Wine dbghelp only support DWARF 2.\n", - cu_version); + ctx.head.version); return FALSE; }
Now storing cu information for dwarf content - in each compiland - and queue the unique one's inside the module
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dbghelp_private.h | 1 + dlls/dbghelp/dwarf.c | 25 +++++++++++++++++++++++++ dlls/dbghelp/symbol.c | 1 + 3 files changed, 27 insertions(+)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index f9191ae1205..2d4efafd041 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -179,6 +179,7 @@ struct symt_compiland ULONG_PTR address; unsigned source; struct vector vchildren; /* global variables & functions */ + void* user; /* when debug info provider needs to store information */ };
struct symt_data diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index abc011ad2e4..c102439773d 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -193,6 +193,8 @@ typedef struct dwarf2_parse_context_s /* stored in the dbghelp's module internal structure for later reuse */ struct dwarf2_module_info_s { + dwarf2_cuhead_t** cuheads; + unsigned num_cuheads; dwarf2_section_t debug_loc; dwarf2_section_t debug_frame; dwarf2_section_t eh_frame; @@ -2336,6 +2338,26 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, return TRUE; }
+unsigned dwarf2_cache_cuhead(struct dwarf2_module_info_s* module, struct symt_compiland* c, const dwarf2_cuhead_t* head) +{ + dwarf2_cuhead_t* ah; + unsigned i; + for (i = 0; i < module->num_cuheads; ++i) + { + if (memcmp(module->cuheads[i], head, sizeof(*head)) == 0) + { + c->user = module->cuheads[i]; + return TRUE; + } + } + if (!(ah = pool_alloc(&c->container->module->pool, sizeof(*head)))) return FALSE; + memcpy(ah, head, sizeof(*head)); + module->cuheads = realloc(module->cuheads, ++module->num_cuheads * sizeof(head)); + module->cuheads[module->num_cuheads - 1] = ah; + c->user = ah; + return TRUE; +} + static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, struct module* module, const struct elf_thunk_area* thunks, @@ -3476,6 +3498,7 @@ static void dwarf2_module_remove(struct process* pcs, struct module_format* modf { dwarf2_fini_section(&modfmt->u.dwarf2_info->debug_loc); dwarf2_fini_section(&modfmt->u.dwarf2_info->debug_frame); + free(modfmt->u.dwarf2_info->cuheads); HeapFree(GetProcessHeap(), 0, modfmt); }
@@ -3542,6 +3565,8 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, dwarf2_init_section(&dwarf2_modfmt->u.dwarf2_info->debug_loc, fmap, ".debug_loc", ".zdebug_loc", NULL); dwarf2_init_section(&dwarf2_modfmt->u.dwarf2_info->debug_frame, fmap, ".debug_frame", ".zdebug_frame", NULL); dwarf2_modfmt->u.dwarf2_info->eh_frame = eh_frame; + dwarf2_modfmt->u.dwarf2_info->cuheads = NULL; + dwarf2_modfmt->u.dwarf2_info->num_cuheads = 0;
while (mod_ctx.data < mod_ctx.end_data) { diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 8f192662b7d..28c906c10a3 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -210,6 +210,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, sym->address = address; sym->source = src_idx; vector_init(&sym->vchildren, sizeof(struct symt*), 32); + sym->user = NULL; } return sym; }
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index c102439773d..75ba89bb8be 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -351,13 +351,18 @@ static ULONG_PTR dwarf2_get_addr(const unsigned char* ptr, unsigned word_size) return ret; }
-static ULONG_PTR dwarf2_parse_addr(dwarf2_traverse_context_t* ctx) +static inline ULONG_PTR dwarf2_parse_addr(dwarf2_traverse_context_t* ctx, unsigned word_size) { - ULONG_PTR ret = dwarf2_get_addr(ctx->data, ctx->word_size); - ctx->data += ctx->word_size; + ULONG_PTR ret = dwarf2_get_addr(ctx->data, word_size); + ctx->data += word_size; return ret; }
+static inline ULONG_PTR dwarf2_parse_addr_head(dwarf2_traverse_context_t* ctx, const dwarf2_cuhead_t* head) +{ + return dwarf2_parse_addr(ctx, head->word_size); +} + static const char* dwarf2_debug_traverse_ctx(const dwarf2_traverse_context_t* ctx) { return wine_dbg_sprintf("ctx(%p)", ctx->data); @@ -714,7 +719,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st else switch (op) { case DW_OP_nop: break; - case DW_OP_addr: stack[++stk] = dwarf2_parse_addr(ctx); break; + case DW_OP_addr: stack[++stk] = dwarf2_parse_addr(ctx, ctx->word_size); break; case DW_OP_const1u: stack[++stk] = dwarf2_parse_byte(ctx); break; case DW_OP_const1s: stack[++stk] = dwarf2_parse_byte(ctx); break; case DW_OP_const2u: stack[++stk] = dwarf2_parse_u2(ctx); break; @@ -1050,10 +1055,10 @@ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_in
*plow = ULONG_MAX; *phigh = 0; - while (traverse.data + 2 * traverse.word_size < traverse.end_data) + while (traverse.data + 2 * ctx->head.word_size < traverse.end_data) { - low = dwarf2_parse_addr(&traverse); - high = dwarf2_parse_addr(&traverse); + low = dwarf2_parse_addr_head(&traverse, &ctx->head); + high = dwarf2_parse_addr_head(&traverse, &ctx->head); if (low == 0 && high == 0) break; if (low == ULONG_MAX) FIXME("unsupported yet (base address selection)\n"); if (low < *plow) *plow = low; @@ -2304,7 +2309,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, end_sequence = TRUE; break; case DW_LNE_set_address: - address = ctx->load_offset + dwarf2_parse_addr(&traverse); + address = ctx->load_offset + dwarf2_parse_addr_head(&traverse, &ctx->head); break; case DW_LNE_define_file: FIXME("not handled define file %s\n", debugstr_a((char *)traverse.data)); @@ -2609,7 +2614,7 @@ static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t* ctx, u switch (encoding & 0x0f) { case DW_EH_PE_native: - return base + dwarf2_parse_addr(ctx); + return base + dwarf2_parse_addr(ctx, ctx->word_size); case DW_EH_PE_leb128: return base + dwarf2_leb128_as_unsigned(ctx); case DW_EH_PE_data2: @@ -3108,7 +3113,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w else switch (opcode) { case DW_OP_nop: break; - case DW_OP_addr: stack[++sp] = dwarf2_parse_addr(&ctx); break; + case DW_OP_addr: stack[++sp] = dwarf2_parse_addr(&ctx, ctx.word_size); break; case DW_OP_const1u: stack[++sp] = dwarf2_parse_byte(&ctx); break; case DW_OP_const1s: stack[++sp] = (signed char)dwarf2_parse_byte(&ctx); break; case DW_OP_const2u: stack[++sp] = dwarf2_parse_u2(&ctx); break;
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 75ba89bb8be..77281087ad3 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -451,6 +451,7 @@ static void dwarf2_parse_abbrev_set(dwarf2_traverse_context_t* abbrev_ctx, }
static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, + const dwarf2_cuhead_t* head, const dwarf2_abbrev_entry_attr_t* abbrev_attr) { unsigned step; @@ -461,7 +462,7 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx, { case DW_FORM_flag_present: step = 0; break; case DW_FORM_ref_addr: - case DW_FORM_addr: step = ctx->word_size; break; + case DW_FORM_addr: step = head->word_size; break; case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_ref1: step = 1; break; @@ -497,8 +498,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, { case DW_FORM_ref_addr: case DW_FORM_addr: - attr->u.uvalue = dwarf2_get_addr(data, - ctx->module->format_info[DFI_DWARF]->u.dwarf2_info->word_size); + attr->u.uvalue = dwarf2_get_addr(data, ctx->head.word_size); TRACE("addr<0x%lx>\n", attr->u.uvalue); break;
@@ -1129,7 +1129,7 @@ static BOOL dwarf2_read_one_debug_info(dwarf2_parse_context_t* ctx, for (i = 0, attr = abbrev->attrs; attr; i++, attr = attr->next) { di->data[i] = traverse->data; - dwarf2_swallow_attribute(traverse, attr); + dwarf2_swallow_attribute(traverse, &ctx->head, attr); } } else di->data = NULL;
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 77281087ad3..d30fe27e513 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -662,7 +662,8 @@ static unsigned dwarf2_map_register(int regno, const struct module* module) }
static enum location_error -compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, struct location* loc, +compute_location(const struct module *module, const dwarf2_cuhead_t* head, + dwarf2_traverse_context_t* ctx, struct location* loc, HANDLE hproc, const struct location* frame) { DWORD_PTR tmp, stack[64]; @@ -719,7 +720,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st else switch (op) { case DW_OP_nop: break; - case DW_OP_addr: stack[++stk] = dwarf2_parse_addr(ctx, ctx->word_size); break; + case DW_OP_addr: stack[++stk] = dwarf2_parse_addr_head(ctx, head); break; case DW_OP_const1u: stack[++stk] = dwarf2_parse_byte(ctx); break; case DW_OP_const1s: stack[++stk] = dwarf2_parse_byte(ctx); break; case DW_OP_const2u: stack[++stk] = dwarf2_parse_u2(ctx); break; @@ -828,7 +829,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st DWORD_PTR addr = stack[stk--]; DWORD_PTR deref = 0;
- if (!ReadProcessMemory(hproc, (void*)addr, &deref, ctx->word_size, NULL)) + if (!ReadProcessMemory(hproc, (void*)addr, &deref, head->word_size, NULL)) { WARN("Couldn't read memory at %lx\n", addr); return loc_err_cant_read; @@ -868,7 +869,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st case 1: stack[++stk] = *(unsigned char*)&deref; break; case 2: stack[++stk] = *(unsigned short*)&deref; break; case 4: stack[++stk] = *(DWORD*)&deref; break; - case 8: if (ctx->word_size >= derefsize) stack[++stk] = deref; break; + case 8: if (head->word_size >= derefsize) stack[++stk] = deref; break; } } else @@ -935,7 +936,7 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, lctx.end_data = xloc.u.block.ptr + xloc.u.block.size; lctx.word_size = ctx->module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
- err = compute_location(ctx->module, &lctx, loc, NULL, frame); + err = compute_location(ctx->module, &ctx->head, &lctx, loc, NULL, frame); if (err < 0) { loc->kind = loc_error; @@ -948,7 +949,7 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, *ptr = xloc.u.block.size; memcpy(ptr + 1, xloc.u.block.ptr, xloc.u.block.size); loc->offset = (ULONG_PTR)ptr; - compute_location(ctx->module, &lctx, loc, NULL, frame); + compute_location(ctx->module, &ctx->head, &lctx, loc, NULL, frame); } } return TRUE; @@ -2504,6 +2505,17 @@ static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE return FALSE; }
+static const dwarf2_cuhead_t* get_cuhead_from_func(const struct symt_function* func) +{ + if (func && symt_check_tag(func->container, SymTagCompiland)) + { + struct symt_compiland* c = (struct symt_compiland*)func->container; + return (const dwarf2_cuhead_t*)c->user; + } + FIXME("Should have a compilation unit head\n"); + return NULL; +} + static enum location_error loc_compute_frame(struct process* pcs, const struct module_format* modfmt, const struct symt_function* func, @@ -2535,7 +2547,8 @@ static enum location_error loc_compute_frame(struct process* pcs, modfmt->u.dwarf2_info->debug_loc.address + pframe->offset, ip, &lctx)) return loc_err_out_of_scope; - if ((err = compute_location(modfmt->module, &lctx, frame, pcs->handle, NULL)) < 0) return err; + if ((err = compute_location(modfmt->module, get_cuhead_from_func(func), + &lctx, frame, pcs->handle, NULL)) < 0) return err; if (frame->kind >= loc_user) { WARN("Couldn't compute runtime frame location\n"); @@ -3364,7 +3377,8 @@ static void dwarf2_location_compute(struct process* pcs, } do_compute: /* now get the variable */ - err = compute_location(modfmt->module, &lctx, loc, pcs->handle, &frame); + err = compute_location(modfmt->module, get_cuhead_from_func(func), + &lctx, loc, pcs->handle, &frame); break; case loc_register: case loc_regrel:
(dwarf2_parse_augmentation_ptr, parse_cie_details)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index d30fe27e513..8189199453c 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2605,7 +2605,7 @@ struct frame_info struct frame_state state_stack[MAX_SAVED_STATES]; };
-static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t* ctx, unsigned char encoding) +static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t* ctx, unsigned char encoding, unsigned char word_size) { ULONG_PTR base;
@@ -2627,7 +2627,7 @@ static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t* ctx, u switch (encoding & 0x0f) { case DW_EH_PE_native: - return base + dwarf2_parse_addr(ctx, ctx->word_size); + return base + dwarf2_parse_addr(ctx, word_size); case DW_EH_PE_leb128: return base + dwarf2_leb128_as_unsigned(ctx); case DW_EH_PE_data2: @@ -2650,7 +2650,7 @@ static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t* ctx, u } }
-static BOOL parse_cie_details(dwarf2_traverse_context_t* ctx, struct frame_info* info) +static BOOL parse_cie_details(dwarf2_traverse_context_t* ctx, struct frame_info* info, unsigned char word_size) { unsigned char version; const char* augmentation; @@ -2707,7 +2707,7 @@ static BOOL parse_cie_details(dwarf2_traverse_context_t* ctx, struct frame_info* unsigned char encoding = dwarf2_parse_byte(ctx); /* throw away the indirect bit, as we don't care for the result */ encoding &= ~DW_EH_PE_indirect; - dwarf2_parse_augmentation_ptr(ctx, encoding); /* handler */ + dwarf2_parse_augmentation_ptr(ctx, encoding, word_size); /* handler */ continue; } case 'R': @@ -2736,6 +2736,7 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt ULONG_PTR start, range; unsigned cie_id; const BYTE* start_data = fde_ctx->data; + unsigned char word_size = module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
cie_id = in_eh_frame ? 0 : DW_CIE_ID; /* skip 0-padding at beginning of section (alignment) */ @@ -2758,7 +2759,7 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt { last_cie_ptr = fde_ctx->data - 8; /* we need some bits out of the CIE in order to parse all contents */ - if (!parse_cie_details(fde_ctx, info)) return FALSE; + if (!parse_cie_details(fde_ctx, info, word_size)) return FALSE; cie_ctx->data = fde_ctx->data; cie_ctx->end_data = ptr_blk; cie_ctx->word_size = fde_ctx->word_size; @@ -2779,10 +2780,10 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt (unsigned)(fde_ctx->data - start_data)); return FALSE; } - if (!parse_cie_details(cie_ctx, info)) return FALSE; + if (!parse_cie_details(cie_ctx, info, word_size)) return FALSE; } - start = delta + dwarf2_parse_augmentation_ptr(fde_ctx, info->fde_encoding); - range = dwarf2_parse_augmentation_ptr(fde_ctx, info->fde_encoding & 0x0F); + start = delta + dwarf2_parse_augmentation_ptr(fde_ctx, info->fde_encoding, word_size); + range = dwarf2_parse_augmentation_ptr(fde_ctx, info->fde_encoding & 0x0F, word_size);
if (addr >= start && addr < start + range) { @@ -2851,7 +2852,8 @@ static void execute_cfa_instructions(struct module* module, dwarf2_traverse_cont break; case DW_CFA_set_loc: { - ULONG_PTR loc = dwarf2_parse_augmentation_ptr(ctx, info->fde_encoding); + ULONG_PTR loc = dwarf2_parse_augmentation_ptr(ctx, info->fde_encoding, + module->format_info[DFI_DWARF]->u.dwarf2_info->word_size); TRACE("%lx: DW_CFA_set_loc %lx\n", info->ip, loc); info->ip = loc; break; @@ -3126,7 +3128,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w else switch (opcode) { case DW_OP_nop: break; - case DW_OP_addr: stack[++sp] = dwarf2_parse_addr(&ctx, ctx.word_size); break; + case DW_OP_addr: stack[++sp] = dwarf2_parse_addr(&ctx, module->format_info[DFI_DWARF]->u.dwarf2_info->word_size); break; case DW_OP_const1u: stack[++sp] = dwarf2_parse_byte(&ctx); break; case DW_OP_const1s: stack[++sp] = (signed char)dwarf2_parse_byte(&ctx); break; case DW_OP_const2u: stack[++sp] = dwarf2_parse_u2(&ctx); break; @@ -3139,7 +3141,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w case DW_OP_consts: stack[++sp] = dwarf2_leb128_as_signed(&ctx); break; case DW_OP_deref: tmp = 0; - if (!sw_read_mem(csw, stack[sp], &tmp, ctx.word_size)) + if (!sw_read_mem(csw, stack[sp], &tmp, module->format_info[DFI_DWARF]->u.dwarf2_info->word_size)) { ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); tmp = 0; @@ -3177,7 +3179,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w case DW_OP_bra: tmp = (short)dwarf2_parse_u2(&ctx); if (!stack[sp--]) ctx.data += tmp; break; case DW_OP_GNU_encoded_addr: tmp = dwarf2_parse_byte(&ctx); - stack[++sp] = dwarf2_parse_augmentation_ptr(&ctx, tmp); + stack[++sp] = dwarf2_parse_augmentation_ptr(&ctx, tmp, module->format_info[DFI_DWARF]->u.dwarf2_info->word_size); break; case DW_OP_regx: stack[++sp] = get_context_reg(module, csw, context, dwarf2_leb128_as_unsigned(&ctx)); @@ -3321,7 +3323,7 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, end = fde_ctx.data + len; } else end = NULL; - dwarf2_parse_augmentation_ptr(&fde_ctx, info.lsda_encoding); /* handler_data */ + dwarf2_parse_augmentation_ptr(&fde_ctx, info.lsda_encoding, modfmt->u.dwarf2_info->word_size); /* handler_data */ if (end) fde_ctx.data = end;
execute_cfa_instructions(pair.effective, &fde_ctx, ip, &info);
Removed word_size from traverse context and make use of cuhead_t's equivalent field instead
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 8189199453c..a2ee44c6af4 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -159,7 +159,6 @@ typedef struct dwarf2_traverse_context_s { const unsigned char* data; const unsigned char* end_data; - unsigned char word_size; } dwarf2_traverse_context_t;
/* symt_cache indexes */ @@ -934,7 +933,6 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx,
lctx.data = xloc.u.block.ptr; lctx.end_data = xloc.u.block.ptr + xloc.u.block.size; - lctx.word_size = ctx->module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
err = compute_location(ctx->module, &ctx->head, &lctx, loc, NULL, frame); if (err < 0) @@ -1052,7 +1050,6 @@ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_in traverse.data = ctx->sections[section_ranges].address + range.u.uvalue; traverse.end_data = ctx->sections[section_ranges].address + ctx->sections[section_ranges].size; - traverse.word_size = ctx->module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
*plow = ULONG_MAX; *phigh = 0; @@ -2179,7 +2176,6 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, } traverse.data = sections[section_line].address + offset; traverse.end_data = traverse.data + 4; - traverse.word_size = ctx->module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
length = dwarf2_parse_u4(&traverse); traverse.end_data = sections[section_line].address + offset + length; @@ -2387,7 +2383,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, mod_ctx->data += cu_length; ctx.head.version = dwarf2_parse_u2(&cu_ctx); cu_abbrev_offset = dwarf2_parse_u4(&cu_ctx); - ctx.head.word_size = cu_ctx.word_size = dwarf2_parse_byte(&cu_ctx); + ctx.head.word_size = dwarf2_parse_byte(&cu_ctx);
TRACE("Compilation Unit Header found at 0x%x:\n", (int)(comp_unit_start - sections[section_debug].address)); @@ -2414,8 +2410,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, return FALSE; }
- module->format_info[DFI_DWARF]->u.dwarf2_info->word_size = cu_ctx.word_size; - mod_ctx->word_size = cu_ctx.word_size; + module->format_info[DFI_DWARF]->u.dwarf2_info->word_size = ctx.head.word_size;
pool_init(&ctx.pool, 65536); ctx.sections = sections; @@ -2431,7 +2426,6 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
abbrev_ctx.data = sections[section_abbrev].address + cu_abbrev_offset; abbrev_ctx.end_data = sections[section_abbrev].address + sections[section_abbrev].size; - abbrev_ctx.word_size = cu_ctx.word_size; dwarf2_parse_abbrev_set(&abbrev_ctx, &ctx.abbrev_table, &ctx.pool);
sparse_array_init(&ctx.debug_info_table, sizeof(dwarf2_debug_info_t), 128); @@ -2496,7 +2490,6 @@ static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE { lctx->data = ptr; lctx->end_data = ptr + len; - lctx->word_size = modfmt->u.dwarf2_info->word_size; return TRUE; } ptr += len; @@ -2762,7 +2755,6 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt if (!parse_cie_details(fde_ctx, info, word_size)) return FALSE; cie_ctx->data = fde_ctx->data; cie_ctx->end_data = ptr_blk; - cie_ctx->word_size = fde_ctx->word_size; continue; } cie_ptr = (in_eh_frame) ? fde_ctx->data - id - 4 : start_data + id; @@ -2770,7 +2762,6 @@ static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delt { last_cie_ptr = cie_ptr; cie_ctx->data = cie_ptr; - cie_ctx->word_size = fde_ctx->word_size; cie_ctx->end_data = cie_ptr + 4; cie_ctx->end_data = cie_ptr + 4 + dwarf2_parse_u4(cie_ctx); if (dwarf2_parse_u4(cie_ctx) != cie_id) @@ -3112,7 +3103,6 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w ctx.end_data = zp + 4; len = dwarf2_leb128_as_unsigned(&ctx); ctx.end_data = ctx.data + len; - ctx.word_size = module->format_info[DFI_DWARF]->u.dwarf2_info->word_size;
while (ctx.data < ctx.end_data) { @@ -3289,7 +3279,6 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, memset(&info, 0, sizeof(info)); fde_ctx.data = modfmt->u.dwarf2_info->eh_frame.address; fde_ctx.end_data = fde_ctx.data + modfmt->u.dwarf2_info->eh_frame.size; - fde_ctx.word_size = modfmt->u.dwarf2_info->word_size; /* let offsets relative to the eh_frame sections be correctly computed, as we'll map * in this process the IMAGE section at a different address as the one expected by * the image @@ -3300,7 +3289,6 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, { fde_ctx.data = modfmt->u.dwarf2_info->debug_frame.address; fde_ctx.end_data = fde_ctx.data + modfmt->u.dwarf2_info->debug_frame.size; - fde_ctx.word_size = modfmt->u.dwarf2_info->word_size; delta = pair.effective->reloc_delta; if (!dwarf2_get_cie(ip, pair.effective, delta, &fde_ctx, &cie_ctx, &info, FALSE)) { @@ -3375,7 +3363,6 @@ static void dwarf2_location_compute(struct process* pcs,
lctx.data = (const BYTE*)(ptr + 1); lctx.end_data = lctx.data + *ptr; - lctx.word_size = modfmt->u.dwarf2_info->word_size; } do_compute: /* now get the variable */ @@ -3564,7 +3551,6 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset,
mod_ctx.data = section[section_debug].address; mod_ctx.end_data = mod_ctx.data + section[section_debug].size; - mod_ctx.word_size = 0; /* will be correctly set later on */
dwarf2_modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(*dwarf2_modfmt) + sizeof(*dwarf2_modfmt->u.dwarf2_info));
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index a2ee44c6af4..04a4b85e80c 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2472,8 +2472,8 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, return ret; }
-static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE* start, - ULONG_PTR ip, dwarf2_traverse_context_t* lctx) +static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const dwarf2_cuhead_t* head, + const BYTE* start, ULONG_PTR ip, dwarf2_traverse_context_t* lctx) { DWORD_PTR beg, end; const BYTE* ptr = start; @@ -2481,8 +2481,8 @@ static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE
while (ptr < modfmt->u.dwarf2_info->debug_loc.address + modfmt->u.dwarf2_info->debug_loc.size) { - beg = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size; - end = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size; + beg = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size; + end = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size; if (!beg && !end) break; len = dwarf2_get_u2(ptr); ptr += 2;
@@ -2519,6 +2519,7 @@ static enum location_error loc_compute_frame(struct process* pcs, dwarf2_traverse_context_t lctx; enum location_error err; unsigned int i; + const dwarf2_cuhead_t* head = get_cuhead_from_func(func);
for (i=0; i<vector_length(&func->vchildren); i++) { @@ -2536,11 +2537,11 @@ static enum location_error loc_compute_frame(struct process* pcs, break; case loc_dwarf2_location_list: WARN("Searching loclist for %s\n", debugstr_a(func->hash_elt.name)); - if (!dwarf2_lookup_loclist(modfmt, + if (!dwarf2_lookup_loclist(modfmt, head, modfmt->u.dwarf2_info->debug_loc.address + pframe->offset, ip, &lctx)) return loc_err_out_of_scope; - if ((err = compute_location(modfmt->module, get_cuhead_from_func(func), + if ((err = compute_location(modfmt->module, head, &lctx, frame, pcs->handle, NULL)) < 0) return err; if (frame->kind >= loc_user) { @@ -3333,6 +3334,7 @@ static void dwarf2_location_compute(struct process* pcs, DWORD_PTR ip; int err; dwarf2_traverse_context_t lctx; + const dwarf2_cuhead_t* head = get_cuhead_from_func(func);
if (!func || !symt_check_tag(func->container, SymTagCompiland)) { @@ -3350,7 +3352,7 @@ static void dwarf2_location_compute(struct process* pcs, { case loc_dwarf2_location_list: /* Then, if the variable has a location list, find it !! */ - if (dwarf2_lookup_loclist(modfmt, + if (dwarf2_lookup_loclist(modfmt, head, modfmt->u.dwarf2_info->debug_loc.address + loc->offset, ip, &lctx)) goto do_compute; @@ -3366,7 +3368,7 @@ static void dwarf2_location_compute(struct process* pcs, } do_compute: /* now get the variable */ - err = compute_location(modfmt->module, get_cuhead_from_func(func), + err = compute_location(modfmt->module, head, &lctx, loc, pcs->handle, &frame); break; case loc_register:
Eric Pouech eric.pouech@gmail.com writes:
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/dbghelp/dwarf.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
This breaks the tests:
tools/runtest -q -P wine -T . -M kernel32.dll -p dlls/kernel32/tests/kernel32_test.exe debugger && touch dlls/kernel32/tests/debugger.ok debugger.c:768: IgnoreExceptions=1 wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 00fc), starting debugger... Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00448275). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:00448275 ESP:0031fd70 EBP:0031fe08 EFLAGS:00010246( R- -- I Z- -P- ) EAX:00000000 EBX:00fb2ba0 ECX:0057c7f3 EDX:00000000 ESI:00fb2c00 EDI:0057dce5 Stack dump: 0x0031fd70: 0057dce5 000000c6 0031fda8 7bc46d75 0x0031fd80: 00fb2c30 7ffc2000 0031fdf8 7bc46d75 0x0031fd90: 7bc613e0 0031fdd0 0031fdc0 00000008 0x0031fda0: 7ffd1000 0031fdc0 0031fdf8 7b075659 0x0031fdb0: ffffffff 0000000c 0031fe10 7b075659 0x0031fdc0: 7bc81574 00000001 00000001 00000000 Backtrace: =>0 0x00448275 func_debugger+0x10c5(winedbg: Internal crash at 0x6fa8910d debugger.c:714: Test failed: exit code = c0000354 debugger.c:770: IgnoreExceptions=0 debugger.c:784: Tests skipped: "none" debugger test needs user interaction wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0114), starting debugger... wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0128), starting debugger... wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0140), starting debugger... wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0158), starting debugger... wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0170), starting debugger... wine: Unhandled page fault on write access to 00000000 at address 00448275 (thread 0188), starting debugger... make: *** [Makefile:68179: dlls/kernel32/tests/debugger.ok] Error 1
V2: fixed NULL deref:s
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 22350124de7..435b2a0e3b0 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2471,8 +2471,8 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, return ret; }
-static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE* start, - ULONG_PTR ip, dwarf2_traverse_context_t* lctx) +static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const dwarf2_cuhead_t* head, + const BYTE* start, ULONG_PTR ip, dwarf2_traverse_context_t* lctx) { DWORD_PTR beg, end; const BYTE* ptr = start; @@ -2480,8 +2480,8 @@ static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE
while (ptr < modfmt->u.dwarf2_info->debug_loc.address + modfmt->u.dwarf2_info->debug_loc.size) { - beg = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size; - end = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size; + beg = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size; + end = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size; if (!beg && !end) break; len = dwarf2_get_u2(ptr); ptr += 2;
@@ -2518,7 +2518,13 @@ static enum location_error loc_compute_frame(struct process* pcs, dwarf2_traverse_context_t lctx; enum location_error err; unsigned int i; + const dwarf2_cuhead_t* head = get_cuhead_from_func(func);
+ if (!head) + { + FIXME("Shouldn't happen\n"); + return loc_err_internal; + } for (i=0; i<vector_length(&func->vchildren); i++) { psym = vector_at(&func->vchildren, i); @@ -2535,11 +2541,11 @@ static enum location_error loc_compute_frame(struct process* pcs, break; case loc_dwarf2_location_list: WARN("Searching loclist for %s\n", debugstr_a(func->hash_elt.name)); - if (!dwarf2_lookup_loclist(modfmt, + if (!dwarf2_lookup_loclist(modfmt, head, modfmt->u.dwarf2_info->debug_loc.address + pframe->offset, ip, &lctx)) return loc_err_out_of_scope; - if ((err = compute_location(modfmt->module, get_cuhead_from_func(func), + if ((err = compute_location(modfmt->module, head, &lctx, frame, pcs->handle, NULL)) < 0) return err; if (frame->kind >= loc_user) { @@ -3332,10 +3338,12 @@ static void dwarf2_location_compute(struct process* pcs, DWORD_PTR ip; int err; dwarf2_traverse_context_t lctx; + const dwarf2_cuhead_t* head = get_cuhead_from_func(func);
- if (!func || !symt_check_tag(func->container, SymTagCompiland)) + if (!head) { - WARN("We'd expect function %s's container to exist and be a compiland\n", debugstr_a(func->hash_elt.name)); + WARN("We'd expect function %s's container to be a valid compiland with dwarf inforamation\n", + debugstr_a(func->hash_elt.name)); err = loc_err_internal; } else @@ -3349,7 +3357,7 @@ static void dwarf2_location_compute(struct process* pcs, { case loc_dwarf2_location_list: /* Then, if the variable has a location list, find it !! */ - if (dwarf2_lookup_loclist(modfmt, + if (dwarf2_lookup_loclist(modfmt, head, modfmt->u.dwarf2_info->debug_loc.address + loc->offset, ip, &lctx)) goto do_compute; @@ -3365,7 +3373,7 @@ static void dwarf2_location_compute(struct process* pcs, } do_compute: /* now get the variable */ - err = compute_location(modfmt->module, get_cuhead_from_func(func), + err = compute_location(modfmt->module, head, &lctx, loc, pcs->handle, &frame); break; case loc_register:
(used to be set at every compilation unit inside a module)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/dwarf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 04a4b85e80c..5ea8e51314f 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2410,8 +2410,6 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, return FALSE; }
- module->format_info[DFI_DWARF]->u.dwarf2_info->word_size = ctx.head.word_size; - pool_init(&ctx.pool, 65536); ctx.sections = sections; ctx.section = section_debug; @@ -3565,7 +3563,7 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, dwarf2_modfmt->remove = dwarf2_module_remove; dwarf2_modfmt->loc_compute = dwarf2_location_compute; dwarf2_modfmt->u.dwarf2_info = (struct dwarf2_module_info_s*)(dwarf2_modfmt + 1); - dwarf2_modfmt->u.dwarf2_info->word_size = 0; /* will be correctly set later on */ + dwarf2_modfmt->u.dwarf2_info->word_size = fmap->addr_size / 8; /* set the word_size for eh_frame parsing */ dwarf2_modfmt->module->format_info[DFI_DWARF] = dwarf2_modfmt;
/* As we'll need later some sections' content, we won't unmap these @@ -3589,9 +3587,6 @@ BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, dwarf2_modfmt->module->module.SourceIndexed = TRUE; dwarf2_modfmt->module->module.Publics = TRUE;
- /* set the word_size for eh_frame parsing */ - dwarf2_modfmt->u.dwarf2_info->word_size = fmap->addr_size / 8; - leave: dwarf2_fini_section(§ion[section_debug]); dwarf2_fini_section(§ion[section_abbrev]);