https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5a3f69edcca405b16def56...
commit 5a3f69edcca405b16def56554c2a3b06c16a044b Author: winesync ros-dev@reactos.org AuthorDate: Fri Sep 11 14:31:20 2020 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Wed Sep 16 10:35:35 2020 +0200
[WINESYNC] dbghelp/dwarf: Use the word size of the target process.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45490 Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id 42745c068f80b696e7402680a61c2006b68b01d0 by Zebediah Figura z.figura12@gmail.com --- dll/win32/dbghelp/dwarf.c | 9 +++++---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index 27b9c1b4354..9eda159e882 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -827,9 +827,9 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, if (hproc) { DWORD_PTR addr = stack[stk--]; - DWORD_PTR deref; + DWORD_PTR deref = 0;
- if (!ReadProcessMemory(hproc, (void*)addr, &deref, sizeof(deref), NULL)) + if (!ReadProcessMemory(hproc, (void*)addr, &deref, ctx->word_size, NULL)) { WARN("Couldn't read memory at %lx\n", addr); return loc_err_cant_read; @@ -3140,7 +3140,8 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w case DW_OP_constu: stack[++sp] = dwarf2_leb128_as_unsigned(&ctx); break; case DW_OP_consts: stack[++sp] = dwarf2_leb128_as_signed(&ctx); break; case DW_OP_deref: - if (!sw_read_mem(csw, stack[sp], &tmp, sizeof(tmp))) + tmp = 0; + if (!sw_read_mem(csw, stack[sp], &tmp, ctx.word_size)) { ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); tmp = 0; @@ -3223,7 +3224,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk { case RULE_EXPRESSION: *cfa = eval_expression(module, csw, (const unsigned char*)state->cfa_offset, context); - if (!sw_read_mem(csw, *cfa, cfa, sizeof(*cfa))) + if (!sw_read_mem(csw, *cfa, cfa, csw->cpu->word_size)) { WARN("Couldn't read memory at %s\n", wine_dbgstr_longlong(*cfa)); return; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index b9808b10147..20322ecc88c 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -3,4 +3,4 @@ directories: files: include/dbghelp.h: sdk/include/psdk/dbghelp.h tags: - wine: 3507615f35777f38a20407b7879f7c7d6510b12a + wine: 42745c068f80b696e7402680a61c2006b68b01d0