ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2020
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
382 discussions
Start a n
N
ew thread
[reactos] 34/179: [WINESYNC] dbghelp/msc: Use the word size of the target process.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3849da5c46ea284dc4b5…
commit d3849da5c46ea284dc4b5508da37a6adb92cea70 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 14:31:20 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:35 2020 +0200 [WINESYNC] dbghelp/msc: Use the word size of the target process. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ca9b1d0077874c94715cd2ceeff114853151ed2d by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/msc.c | 4 ++-- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 16c350184df..768ed93f889 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -3092,10 +3092,10 @@ static BOOL pev_binop(struct pevaluator* pev, char op) static BOOL pev_deref(struct pevaluator* pev) { char res[PEV_MAX_LEN]; - DWORD_PTR v1, v2; + DWORD_PTR v1, v2 = 0; if (!pev_pop_val(pev, &v1)) return FALSE; - if (!sw_read_mem(pev->csw, v1, &v2, sizeof(v2))) + if (!sw_read_mem(pev->csw, v1, &v2, pev->csw->cpu->word_size)) return PEV_ERROR1(pev, "deref: cannot read mem at %lx\n", v1); snprintf(res, sizeof(res), "%ld", v2); pev_push(pev, res); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 77b08e5ad01..088fac7999f 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: b7defd2946e625351111c36ff0f521b8aa9e6487 + wine: ca9b1d0077874c94715cd2ceeff114853151ed2d
4 years, 3 months
1
0
0
0
[reactos] 33/179: [WINESYNC] dbghelp: Correctly determine the dyld image info address.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9161985e1bd8edd107a5…
commit e9161985e1bd8edd107a517598f687e035b3b6e5 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 14:31:20 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:35 2020 +0200 [WINESYNC] dbghelp: Correctly determine the dyld image info address. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b7defd2946e625351111c36ff0f521b8aa9e6487 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/macho_module.c | 18 ++++++++++++++---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 05130b7de8d..a3f838f88ff 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1360,18 +1360,28 @@ static ULONG_PTR get_dyld_image_info_address(struct process* pcs) NTSTATUS status; PROCESS_BASIC_INFORMATION pbi; ULONG_PTR dyld_image_info_address = 0; + BOOL ret; /* Get address of PEB */ status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); if (status == STATUS_SUCCESS) { /* Read dyld image info address from PEB */ - if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], - &dyld_image_info_address, sizeof(dyld_image_info_address), NULL)) + if (!pcs->is_64bit) + ret = ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], + &dyld_image_info_address, sizeof(dyld_image_info_address), NULL); + else { - TRACE("got dyld_image_info_address 0x%08lx from PEB %p MacDyldImageInfo %p\n", - (unsigned long)dyld_image_info_address, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved); + PEB32 *peb32 = (PEB32 *)pbi.PebBaseAddress; + ULONG addr32; + ret = ReadProcessMemory(pcs->handle, &peb32->Reserved[0], &addr32, + sizeof(addr32), NULL); + dyld_image_info_address = addr32; } + + if (ret) + TRACE("got dyld_image_info_address %#lx from PEB %p\n", + dyld_image_info_address, pbi.PebBaseAddress); } #ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 20322ecc88c..77b08e5ad01 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: 42745c068f80b696e7402680a61c2006b68b01d0 + wine: b7defd2946e625351111c36ff0f521b8aa9e6487
4 years, 3 months
1
0
0
0
[reactos] 32/179: [WINESYNC] dbghelp/dwarf: Use the word size of the target process.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5a3f69edcca405b16def5…
commit 5a3f69edcca405b16def56554c2a3b06c16a044b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 14:31:20 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)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(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 42745c068f80b696e7402680a61c2006b68b01d0 by Zebediah Figura <z.figura12(a)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
4 years, 3 months
1
0
0
0
[reactos] 31/179: [WINESYNC] dbghelp/dwarf: Allow get_context_reg() to handle different register sizes.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8629cdb6af99375e9d01c…
commit 8629cdb6af99375e9d01cedf8be5021ce6990241 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 14:29:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:35 2020 +0200 [WINESYNC] dbghelp/dwarf: Allow get_context_reg() to handle different register sizes. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3507615f35777f38a20407b7879f7c7d6510b12a by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/cpu_arm.c | 2 +- dll/win32/dbghelp/cpu_arm64.c | 2 +- dll/win32/dbghelp/cpu_i386.c | 2 +- dll/win32/dbghelp/cpu_x86_64.c | 2 +- dll/win32/dbghelp/dbghelp_private.h | 2 +- dll/win32/dbghelp/dwarf.c | 30 ++++++++++++++++-------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/dll/win32/dbghelp/cpu_arm.c b/dll/win32/dbghelp/cpu_arm.c index 3395b6e50cb..9385e2e4eb5 100644 --- a/dll/win32/dbghelp/cpu_arm.c +++ b/dll/win32/dbghelp/cpu_arm.c @@ -70,7 +70,7 @@ enum st_mode {stm_start, stm_arm, stm_done}; static BOOL fetch_next_frame(struct cpu_stack_walk* csw, union ctx *pcontext, DWORD_PTR curr_pc) { - DWORD_PTR xframe; + DWORD64 xframe; CONTEXT *context = &pcontext->ctx; DWORD oldReturn = context->Lr; diff --git a/dll/win32/dbghelp/cpu_arm64.c b/dll/win32/dbghelp/cpu_arm64.c index 7a4a94762e8..f3ab0936ebe 100644 --- a/dll/win32/dbghelp/cpu_arm64.c +++ b/dll/win32/dbghelp/cpu_arm64.c @@ -68,7 +68,7 @@ enum st_mode {stm_start, stm_arm64, stm_done}; static BOOL fetch_next_frame(struct cpu_stack_walk* csw, union ctx *pcontext, DWORD_PTR curr_pc) { - DWORD_PTR xframe; + DWORD64 xframe; CONTEXT *context = &pcontext->ctx; DWORD_PTR oldReturn = context->u.s.Lr; diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 6ed98341343..420549b40d8 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -99,7 +99,7 @@ static BOOL i386_get_addr(HANDLE hThread, const CONTEXT* ctx, static BOOL fetch_next_frame32(struct cpu_stack_walk* csw, union ctx *pcontext, DWORD_PTR curr_pc) { - DWORD_PTR xframe; + DWORD64 xframe; struct pdb_cmd_pair cpair[4]; DWORD val32; WOW64_CONTEXT *context = &pcontext->x86; diff --git a/dll/win32/dbghelp/cpu_x86_64.c b/dll/win32/dbghelp/cpu_x86_64.c index 1087ce74646..83c1fb16bf7 100644 --- a/dll/win32/dbghelp/cpu_x86_64.c +++ b/dll/win32/dbghelp/cpu_x86_64.c @@ -577,7 +577,7 @@ static BOOL interpret_function_table_entry(struct cpu_stack_walk* csw, static BOOL fetch_next_frame(struct cpu_stack_walk *csw, union ctx *pcontext, DWORD_PTR curr_pc, void** prtf) { - DWORD_PTR cfa; + DWORD64 cfa; RUNTIME_FUNCTION* rtf; DWORD64 base; CONTEXT *context = &pcontext->ctx; diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index e0b2e3d1736..bdfca1d2934 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -725,7 +725,7 @@ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offse const struct elf_thunk_area* thunks, struct image_file_map* fmap) DECLSPEC_HIDDEN; extern BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, - union ctx *ctx, ULONG_PTR *cfa) DECLSPEC_HIDDEN; + union ctx *ctx, DWORD64 *cfa) DECLSPEC_HIDDEN; /* rsym.c */ extern BOOL rsym_parse(struct module* module, unsigned long load_offset, diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index 0b9ef623a7c..27b9c1b4354 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -3031,18 +3031,19 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, } /* retrieve a context register from its dwarf number */ -static ULONG_PTR get_context_reg(struct cpu_stack_walk *csw, union ctx *context, +static DWORD64 get_context_reg(struct cpu_stack_walk *csw, union ctx *context, ULONG_PTR dw_reg) { unsigned regno = csw->cpu->map_dwarf_register(dw_reg, TRUE), sz; - ULONG_PTR* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); + void* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); - if (sz != sizeof(ULONG_PTR)) - { - FIXME("reading register %lu/%u of wrong size %u\n", dw_reg, regno, sz); - return 0; - } - return *ptr; + if (sz == 8) + return *(DWORD64 *)ptr; + else if (sz == 4) + return *(DWORD *)ptr; + + FIXME("unhandled size %d\n", sz); + return 0; } /* set a context register from its dwarf number */ @@ -3102,7 +3103,8 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w const unsigned char* zp, union ctx *context) { dwarf2_traverse_context_t ctx; - ULONG_PTR reg, sz, tmp, stack[64]; + ULONG_PTR reg, sz, tmp; + DWORD64 stack[64]; int sp = -1; ULONG_PTR len; @@ -3140,7 +3142,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w case DW_OP_deref: if (!sw_read_mem(csw, stack[sp], &tmp, sizeof(tmp))) { - ERR("Couldn't read memory at %lx\n", stack[sp]); + ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); tmp = 0; } stack[sp] = tmp; @@ -3190,7 +3192,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w sz = dwarf2_parse_byte(&ctx); if (!sw_read_mem(csw, stack[sp], &tmp, sz)) { - ERR("Couldn't read memory at %lx\n", stack[sp]); + ERR("Couldn't read memory at %s\n", wine_dbgstr_longlong(stack[sp])); tmp = 0; } /* do integral promotion */ @@ -3211,7 +3213,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w } static void apply_frame_state(const struct module* module, struct cpu_stack_walk* csw, - union ctx *context, struct frame_state *state, ULONG_PTR* cfa) + union ctx *context, struct frame_state *state, DWORD64 *cfa) { unsigned int i; ULONG_PTR value; @@ -3223,7 +3225,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk *cfa = eval_expression(module, csw, (const unsigned char*)state->cfa_offset, context); if (!sw_read_mem(csw, *cfa, cfa, sizeof(*cfa))) { - WARN("Couldn't read memory at %p\n", (void*)*cfa); + WARN("Couldn't read memory at %s\n", wine_dbgstr_longlong(*cfa)); return; } break; @@ -3268,7 +3270,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk * */ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, - union ctx *context, ULONG_PTR *cfa) + union ctx *context, DWORD64 *cfa) { struct module_pair pair; struct frame_info info; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 3f8c50e2700..b9808b10147 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: 9ae588a96ef5f07ba22e0fadc3aacf61b274efe5 + wine: 3507615f35777f38a20407b7879f7c7d6510b12a
4 years, 3 months
1
0
0
0
[reactos] 30/179: [WINESYNC] dbghelp/dwarf: Use the correct backend CPU in dwarf2_virtual_unwind().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1825a61069d496f4f632a…
commit 1825a61069d496f4f632a96fef2f1d2c17b48a31 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 14:29:16 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [WINESYNC] dbghelp/dwarf: Use the correct backend CPU in dwarf2_virtual_unwind(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 9ae588a96ef5f07ba22e0fadc3aacf61b274efe5 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/dbghelp_private.h | 1 + dll/win32/dbghelp/dwarf.c | 39 ++++++++++++++++++++----------------- dll/win32/dbghelp/stack.c | 2 ++ sdk/tools/winesync/dbghelp.cfg | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 6746494077a..e0b2e3d1736 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -473,6 +473,7 @@ struct cpu_stack_walk HANDLE hProcess; HANDLE hThread; BOOL is32; + struct cpu * cpu; union { struct diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index b075bd0a591..0b9ef623a7c 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -3031,10 +3031,11 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, } /* retrieve a context register from its dwarf number */ -static ULONG_PTR get_context_reg(union ctx *context, ULONG_PTR dw_reg) +static ULONG_PTR get_context_reg(struct cpu_stack_walk *csw, union ctx *context, + ULONG_PTR dw_reg) { - unsigned regno = dbghelp_current_cpu->map_dwarf_register(dw_reg, TRUE), sz; - ULONG_PTR* ptr = dbghelp_current_cpu->fetch_context_reg(context, regno, &sz); + unsigned regno = csw->cpu->map_dwarf_register(dw_reg, TRUE), sz; + ULONG_PTR* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); if (sz != sizeof(ULONG_PTR)) { @@ -3048,8 +3049,8 @@ static ULONG_PTR get_context_reg(union ctx *context, ULONG_PTR dw_reg) static void set_context_reg(struct cpu_stack_walk* csw, union ctx *context, ULONG_PTR dw_reg, ULONG_PTR val, BOOL isdebuggee) { - unsigned regno = dbghelp_current_cpu->map_dwarf_register(dw_reg, TRUE), sz; - ULONG_PTR* ptr = dbghelp_current_cpu->fetch_context_reg(context, regno, &sz); + unsigned regno = csw->cpu->map_dwarf_register(dw_reg, TRUE), sz; + ULONG_PTR* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); if (isdebuggee) { @@ -3079,13 +3080,14 @@ static void set_context_reg(struct cpu_stack_walk* csw, union ctx *context, } /* copy a register from one context to another using dwarf number */ -static void copy_context_reg(union ctx *dstcontext, ULONG_PTR dwregdst, - union ctx *srccontext, ULONG_PTR dwregsrc) +static void copy_context_reg(struct cpu_stack_walk *csw, + union ctx *dstcontext, ULONG_PTR dwregdst, + union ctx *srccontext, ULONG_PTR dwregsrc) { - unsigned regdstno = dbghelp_current_cpu->map_dwarf_register(dwregdst, TRUE), szdst; - unsigned regsrcno = dbghelp_current_cpu->map_dwarf_register(dwregsrc, TRUE), szsrc; - ULONG_PTR* ptrdst = dbghelp_current_cpu->fetch_context_reg(dstcontext, regdstno, &szdst); - ULONG_PTR* ptrsrc = dbghelp_current_cpu->fetch_context_reg(srccontext, regsrcno, &szsrc); + unsigned regdstno = csw->cpu->map_dwarf_register(dwregdst, TRUE), szdst; + unsigned regsrcno = csw->cpu->map_dwarf_register(dwregsrc, TRUE), szsrc; + ULONG_PTR* ptrdst = csw->cpu->fetch_context_reg(dstcontext, regdstno, &szdst); + ULONG_PTR* ptrsrc = csw->cpu->fetch_context_reg(srccontext, regsrcno, &szsrc); if (szdst != szsrc) { @@ -3117,9 +3119,10 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w if (opcode >= DW_OP_lit0 && opcode <= DW_OP_lit31) stack[++sp] = opcode - DW_OP_lit0; else if (opcode >= DW_OP_reg0 && opcode <= DW_OP_reg31) - stack[++sp] = get_context_reg(context, opcode - DW_OP_reg0); + stack[++sp] = get_context_reg(csw, context, opcode - DW_OP_reg0); else if (opcode >= DW_OP_breg0 && opcode <= DW_OP_breg31) - stack[++sp] = get_context_reg(context, opcode - DW_OP_breg0) + dwarf2_leb128_as_signed(&ctx); + stack[++sp] = get_context_reg(csw, context, opcode - DW_OP_breg0) + + dwarf2_leb128_as_signed(&ctx); else switch (opcode) { case DW_OP_nop: break; @@ -3176,12 +3179,12 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w stack[++sp] = dwarf2_parse_augmentation_ptr(&ctx, tmp); break; case DW_OP_regx: - stack[++sp] = get_context_reg(context, dwarf2_leb128_as_unsigned(&ctx)); + stack[++sp] = get_context_reg(csw, context, dwarf2_leb128_as_unsigned(&ctx)); break; case DW_OP_bregx: reg = dwarf2_leb128_as_unsigned(&ctx); tmp = dwarf2_leb128_as_signed(&ctx); - stack[++sp] = get_context_reg(context, reg) + tmp; + stack[++sp] = get_context_reg(csw, context, reg) + tmp; break; case DW_OP_deref_size: sz = dwarf2_parse_byte(&ctx); @@ -3228,7 +3231,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk *cfa = eval_expression(module, csw, (const unsigned char*)state->cfa_offset, context); break; default: - *cfa = get_context_reg(context, state->cfa_reg) + state->cfa_offset; + *cfa = get_context_reg(csw, context, state->cfa_reg) + state->cfa_offset; break; } if (!*cfa) return; @@ -3245,7 +3248,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk set_context_reg(csw, &new_context, i, *cfa + state->regs[i], TRUE); break; case RULE_OTHER_REG: - copy_context_reg(&new_context, i, context, state->regs[i]); + copy_context_reg(csw, &new_context, i, context, state->regs[i]); break; case RULE_EXPRESSION: value = eval_expression(module, csw, (const unsigned char*)state->regs[i], context); @@ -3305,7 +3308,7 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, TRACE("function %lx/%lx code_align %lu data_align %ld retaddr %s\n", ip, info.ip, info.code_align, info.data_align, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(info.retaddr_reg, TRUE))); + csw->cpu->fetch_regname(csw->cpu->map_dwarf_register(info.retaddr_reg, TRUE))); /* if at very beginning of function, return and use default unwinder */ if (ip == info.ip) return FALSE; diff --git a/dll/win32/dbghelp/stack.c b/dll/win32/dbghelp/stack.c index 21412f6051f..b3845db23a8 100644 --- a/dll/win32/dbghelp/stack.c +++ b/dll/win32/dbghelp/stack.c @@ -175,6 +175,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, csw.hProcess = hProcess; csw.hThread = hThread; csw.is32 = TRUE; + csw.cpu = cpu; /* sigh... MS isn't even consistent in the func prototypes */ csw.u.s32.f_read_mem = (f_read_mem) ? f_read_mem : read_mem; csw.u.s32.f_xlat_adr = f_xlat_adr; @@ -231,6 +232,7 @@ BOOL WINAPI StackWalk64(DWORD MachineType, HANDLE hProcess, HANDLE hThread, csw.hProcess = hProcess; csw.hThread = hThread; csw.is32 = FALSE; + csw.cpu = cpu; /* sigh... MS isn't even consistent in the func prototypes */ csw.u.s64.f_read_mem = (f_read_mem) ? f_read_mem : read_mem64; csw.u.s64.f_xlat_adr = (f_xlat_adr) ? f_xlat_adr : addr_to_linear; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index f3ce74f8425..3f8c50e2700 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: 3ce304e60100962503bcded0adb69659f849d1b4 + wine: 9ae588a96ef5f07ba22e0fadc3aacf61b274efe5
4 years, 3 months
1
0
0
0
[reactos] 29/179: [WINESYNC] dbghelp: Use WOW64_CONTEXT instead of CONTEXT for i386 backend.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7470eb9ced8b0f1f1180f…
commit 7470eb9ced8b0f1f1180fa4a6d305645cbd4704a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 13:20:36 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [WINESYNC] dbghelp: Use WOW64_CONTEXT instead of CONTEXT for i386 backend. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3ce304e60100962503bcded0adb69659f849d1b4 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/compat.h | 68 +++++++++++++++++++++++++++++++++++ dll/win32/dbghelp/cpu_arm.c | 31 +++++++++------- dll/win32/dbghelp/cpu_arm64.c | 29 ++++++++------- dll/win32/dbghelp/cpu_i386.c | 71 ++++++++++++++++--------------------- dll/win32/dbghelp/cpu_ppc.c | 5 +-- dll/win32/dbghelp/cpu_x86_64.c | 29 ++++++++------- dll/win32/dbghelp/dbghelp_private.h | 19 ++++++---- dll/win32/dbghelp/dwarf.c | 18 +++++----- dll/win32/dbghelp/msc.c | 4 +-- sdk/tools/winesync/dbghelp.cfg | 2 +- 10 files changed, 180 insertions(+), 96 deletions(-) diff --git a/dll/win32/dbghelp/compat.h b/dll/win32/dbghelp/compat.h index 8f6047ea120..4917889ca1c 100644 --- a/dll/win32/dbghelp/compat.h +++ b/dll/win32/dbghelp/compat.h @@ -202,6 +202,74 @@ typedef struct _EXCEPTION_RECORD { DWORD NumberParameters; ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD, *PEXCEPTION_RECORD; + +#define WOW64_CONTEXT_i386 0x00010000 +#define WOW64_CONTEXT_i486 0x00010000 +#define WOW64_CONTEXT_CONTROL (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000001)) +#define WOW64_CONTEXT_INTEGER (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000002)) +#define WOW64_CONTEXT_SEGMENTS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000004)) +#define WOW64_CONTEXT_FLOATING_POINT (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000008)) +#define WOW64_CONTEXT_DEBUG_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000010)) +#define WOW64_CONTEXT_EXTENDED_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000020)) +#define WOW64_CONTEXT_FULL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS) +#define WOW64_CONTEXT_ALL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | \ + WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | \ + WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS) + +#define WOW64_CONTEXT_XSTATE (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000040)) + +#define WOW64_CONTEXT_EXCEPTION_ACTIVE 0x08000000 +#define WOW64_CONTEXT_SERVICE_ACTIVE 0x10000000 +#define WOW64_CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define WOW64_CONTEXT_EXCEPTION_REPORTING 0x80000000 + +#define WOW64_SIZE_OF_80387_REGISTERS 80 +#define WOW64_MAXIMUM_SUPPORTED_EXTENSION 512 + +typedef struct _WOW64_FLOATING_SAVE_AREA +{ + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[WOW64_SIZE_OF_80387_REGISTERS]; + DWORD Cr0NpxState; +} WOW64_FLOATING_SAVE_AREA, *PWOW64_FLOATING_SAVE_AREA; + +#include "pshpack4.h" +typedef struct _WOW64_CONTEXT +{ + DWORD ContextFlags; + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + WOW64_FLOATING_SAVE_AREA FloatSave; + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; + BYTE ExtendedRegisters[WOW64_MAXIMUM_SUPPORTED_EXTENSION]; +} WOW64_CONTEXT, *PWOW64_CONTEXT; +#include "poppack.h" + #if defined(TARGET_i386) #define SIZE_OF_80387_REGISTERS 80 #define CONTEXT_i386 0x10000 diff --git a/dll/win32/dbghelp/cpu_arm.c b/dll/win32/dbghelp/cpu_arm.c index 52461606a8b..3395b6e50cb 100644 --- a/dll/win32/dbghelp/cpu_arm.c +++ b/dll/win32/dbghelp/cpu_arm.c @@ -67,13 +67,14 @@ enum st_mode {stm_start, stm_arm, stm_done}; * modify (at least) context.Pc using unwind information * either out of debug info (dwarf), or simple Lr trace */ -static BOOL fetch_next_frame(struct cpu_stack_walk* csw, - CONTEXT* context, DWORD_PTR curr_pc) +static BOOL fetch_next_frame(struct cpu_stack_walk* csw, union ctx *pcontext, + DWORD_PTR curr_pc) { DWORD_PTR xframe; + CONTEXT *context = &pcontext->ctx; DWORD oldReturn = context->Lr; - if (dwarf2_virtual_unwind(csw, curr_pc, context, &xframe)) + if (dwarf2_virtual_unwind(csw, curr_pc, pcontext, &xframe)) { context->Sp = xframe; context->Pc = oldReturn; @@ -86,7 +87,8 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw, return TRUE; } -static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL arm_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *context) { unsigned deltapc = curr_count <= 1 ? 0 : 4; @@ -113,8 +115,8 @@ static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CON } else { - if (context->Sp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); - if (context->Pc != frame->AddrPC.Offset) FIXME("inconsistent Program Counter\n"); + if (context->ctx.Sp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); + if (context->ctx.Pc != frame->AddrPC.Offset) FIXME("inconsistent Program Counter\n"); if (frame->AddrReturn.Offset == 0) goto done_err; if (!fetch_next_frame(csw, context, frame->AddrPC.Offset - deltapc)) @@ -124,14 +126,14 @@ static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CON memset(&frame->Params, 0, sizeof(frame->Params)); /* set frame information */ - frame->AddrStack.Offset = context->Sp; - frame->AddrReturn.Offset = context->Lr; + frame->AddrStack.Offset = context->ctx.Sp; + frame->AddrReturn.Offset = context->ctx.Lr; #ifdef __REACTOS__ - frame->AddrFrame.Offset = context->R11; + frame->AddrFrame.Offset = context->ctx.R11; #else - frame->AddrFrame.Offset = context->Fp; + frame->AddrFrame.Offset = context->ctx.Fp; #endif - frame->AddrPC.Offset = context->Pc; + frame->AddrPC.Offset = context->ctx.Pc; frame->Far = TRUE; frame->Virtual = TRUE; @@ -152,7 +154,8 @@ done_err: return FALSE; } #else -static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL arm_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *context) { return FALSE; } @@ -167,9 +170,11 @@ static unsigned arm_map_dwarf_register(unsigned regno, BOOL eh_frame) return CV_ARM_NOREG; } -static void* arm_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +static void *arm_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *size) { #ifdef __arm__ + CONTEXT *ctx = &pctx->ctx; + switch (regno) { case CV_ARM_R0 + 0: *size = sizeof(ctx->R0); return &ctx->R0; diff --git a/dll/win32/dbghelp/cpu_arm64.c b/dll/win32/dbghelp/cpu_arm64.c index f50b3255bd0..7a4a94762e8 100644 --- a/dll/win32/dbghelp/cpu_arm64.c +++ b/dll/win32/dbghelp/cpu_arm64.c @@ -65,13 +65,14 @@ enum st_mode {stm_start, stm_arm64, stm_done}; * modify (at least) context.Pc using unwind information * either out of debug info (dwarf), or simple Lr trace */ -static BOOL fetch_next_frame(struct cpu_stack_walk* csw, - CONTEXT* context, DWORD_PTR curr_pc) +static BOOL fetch_next_frame(struct cpu_stack_walk* csw, union ctx *pcontext, + DWORD_PTR curr_pc) { DWORD_PTR xframe; + CONTEXT *context = &pcontext->ctx; DWORD_PTR oldReturn = context->u.s.Lr; - if (dwarf2_virtual_unwind(csw, curr_pc, context, &xframe)) + if (dwarf2_virtual_unwind(csw, curr_pc, pcontext, &xframe)) { context->Sp = xframe; context->Pc = oldReturn; @@ -84,7 +85,8 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw, return TRUE; } -static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL arm64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *context) { unsigned deltapc = curr_count <= 1 ? 0 : 4; @@ -111,8 +113,8 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, C } else { - if (context->Sp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); - if (context->Pc != frame->AddrPC.Offset) FIXME("inconsistent Program Counter\n"); + if (context->ctx.Sp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); + if (context->ctx.Pc != frame->AddrPC.Offset) FIXME("inconsistent Program Counter\n"); if (frame->AddrReturn.Offset == 0) goto done_err; if (!fetch_next_frame(csw, context, frame->AddrPC.Offset - deltapc)) @@ -122,10 +124,10 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, C memset(&frame->Params, 0, sizeof(frame->Params)); /* set frame information */ - frame->AddrStack.Offset = context->Sp; - frame->AddrReturn.Offset = context->u.s.Lr; - frame->AddrFrame.Offset = context->u.s.Fp; - frame->AddrPC.Offset = context->Pc; + frame->AddrStack.Offset = context->ctx.Sp; + frame->AddrReturn.Offset = context->ctx.u.s.Lr; + frame->AddrFrame.Offset = context->ctx.u.s.Fp; + frame->AddrPC.Offset = context->ctx.Pc; frame->Far = TRUE; frame->Virtual = TRUE; @@ -146,7 +148,8 @@ done_err: return FALSE; } #else -static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame, + union ctx *ctx) { return FALSE; } @@ -164,9 +167,11 @@ static unsigned arm64_map_dwarf_register(unsigned regno, BOOL eh_frame) return CV_ARM64_NOREG; } -static void* arm64_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +static void *arm64_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *size) { #ifdef __aarch64__ + CONTEXT *ctx = pctx; + switch (regno) { case CV_ARM64_X0 + 0: diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index e8056a78a3c..6ed98341343 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -90,22 +90,21 @@ static BOOL i386_get_addr(HANDLE hThread, const CONTEXT* ctx, #endif return FALSE; } -#endif /* DBGHELP_STATIC_LIB */ -#if defined(__i386__) && !defined(DBGHELP_STATIC_LIB) /* fetch_next_frame32() * * modify (at least) context.{eip, esp, ebp} using unwind information * either out of debug info (dwarf, pdb), or simple stack unwind */ static BOOL fetch_next_frame32(struct cpu_stack_walk* csw, - CONTEXT* context, DWORD_PTR curr_pc) + union ctx *pcontext, DWORD_PTR curr_pc) { DWORD_PTR xframe; struct pdb_cmd_pair cpair[4]; DWORD val32; + WOW64_CONTEXT *context = &pcontext->x86; - if (dwarf2_virtual_unwind(csw, curr_pc, context, &xframe)) + if (dwarf2_virtual_unwind(csw, curr_pc, pcontext, &xframe)) { context->Esp = xframe; return TRUE; @@ -115,9 +114,7 @@ static BOOL fetch_next_frame32(struct cpu_stack_walk* csw, cpair[2].name = "$eip"; cpair[2].pvalue = &context->Eip; cpair[3].name = NULL; cpair[3].pvalue = NULL; -#ifndef DBGHELP_STATIC_LIB - if (!pdb_virtual_unwind(csw, curr_pc, context, cpair)) -#endif + if (!pdb_virtual_unwind(csw, curr_pc, pcontext, cpair)) { /* do a simple unwind using ebp * we assume a "regular" prologue in the function has been used @@ -138,7 +135,6 @@ static BOOL fetch_next_frame32(struct cpu_stack_walk* csw, } return TRUE; } -#endif enum st_mode {stm_start, stm_32bit, stm_16bit, stm_done}; @@ -155,8 +151,8 @@ enum st_mode {stm_start, stm_32bit, stm_16bit, stm_done}; #define set_curr_mode(m) {frame->Reserved[__CurrentModeCount] &= ~0x0F; frame->Reserved[__CurrentModeCount] |= (m & 0x0F);} #define inc_curr_count() (frame->Reserved[__CurrentModeCount] += 0x10) -#ifndef DBGHELP_STATIC_LIB -static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL i386_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame, + union ctx *context) { STACK32FRAME frame32; STACK16FRAME frame16; @@ -166,10 +162,8 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO WORD val16; DWORD val32; BOOL do_switch; -#ifdef __i386__ unsigned deltapc; - CONTEXT _context; -#endif + union ctx _context; /* sanity check */ if (curr_mode >= stm_done) return FALSE; @@ -183,7 +177,6 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO wine_dbgstr_longlong(curr_count), (void*)(DWORD_PTR)curr_switch, (void*)(DWORD_PTR)next_switch); -#ifdef __i386__ /* if we're at first call (which doesn't actually unwind, it just computes ReturnPC, * or if we're doing the first real unwind (count == 1), then we can directly use * eip. otherwise, eip is *after* the insn that actually made the call to @@ -199,15 +192,18 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO /* setup a pseudo context for the rest of the code (esp. unwinding) */ context = &_context; memset(context, 0, sizeof(*context)); - context->ContextFlags = CONTEXT_CONTROL | CONTEXT_SEGMENTS; - if (frame->AddrPC.Mode != AddrModeFlat) context->SegCs = frame->AddrPC.Segment; - context->Eip = frame->AddrPC.Offset; - if (frame->AddrFrame.Mode != AddrModeFlat) context->SegSs = frame->AddrFrame.Segment; - context->Ebp = frame->AddrFrame.Offset; - if (frame->AddrStack.Mode != AddrModeFlat) context->SegSs = frame->AddrStack.Segment; - context->Esp = frame->AddrStack.Offset; + context->x86.ContextFlags = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_SEGMENTS; + if (frame->AddrPC.Mode != AddrModeFlat) + context->x86.SegCs = frame->AddrPC.Segment; + context->x86.Eip = frame->AddrPC.Offset; + if (frame->AddrFrame.Mode != AddrModeFlat) + context->x86.SegSs = frame->AddrFrame.Segment; + context->x86.Ebp = frame->AddrFrame.Offset; + if (frame->AddrStack.Mode != AddrModeFlat) + context->x86.SegSs = frame->AddrStack.Segment; + context->x86.Esp = frame->AddrStack.Offset; } -#endif + if (curr_mode == stm_start) { THREAD_BASIC_INFORMATION info; @@ -405,18 +401,16 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO } else { -#ifdef __i386__ if (!fetch_next_frame32(csw, context, sw_xlat_addr(csw, &frame->AddrPC) - deltapc)) goto done_err; frame->AddrStack.Mode = frame->AddrFrame.Mode = frame->AddrPC.Mode = AddrModeFlat; - frame->AddrStack.Offset = context->Esp; - frame->AddrFrame.Offset = context->Ebp; - if (frame->AddrReturn.Offset != context->Eip) + frame->AddrStack.Offset = context->x86.Esp; + frame->AddrFrame.Offset = context->x86.Ebp; + if (frame->AddrReturn.Offset != context->x86.Eip) FIXME("new PC=%s different from Eip=%x\n", - wine_dbgstr_longlong(frame->AddrReturn.Offset), context->Eip); - frame->AddrPC.Offset = context->Eip; -#endif + wine_dbgstr_longlong(frame->AddrReturn.Offset), context->x86.Eip); + frame->AddrPC.Offset = context->x86.Eip; } } } @@ -463,14 +457,13 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO sw_read_mem(csw, p + (2 + i) * sizeof(WORD), &val16, sizeof(val16)); frame->Params[i] = val16; } -#ifdef __i386__ if (context) { #define SET(field, seg, reg) \ switch (frame->field.Mode) \ { \ - case AddrModeFlat: context->reg = frame->field.Offset; break; \ - case AddrMode1616: context->seg = frame->field.Segment; context->reg = frame->field.Offset; break; \ + case AddrModeFlat: context->x86.reg = frame->field.Offset; break; \ + case AddrMode1616: context->x86.seg = frame->field.Segment; context->x86.reg = frame->field.Offset; break; \ default: assert(0); \ } SET(AddrStack, SegSs, Esp); @@ -478,19 +471,17 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO SET(AddrReturn, SegCs, Eip); #undef SET } -#endif } else { unsigned int i; -#ifdef __i386__ - CONTEXT newctx = *context; + union ctx newctx = *context; if (!fetch_next_frame32(csw, &newctx, frame->AddrPC.Offset - deltapc)) goto done_err; frame->AddrReturn.Mode = AddrModeFlat; - frame->AddrReturn.Offset = newctx.Eip; -#endif + frame->AddrReturn.Offset = newctx.x86.Eip; + for (i = 0; i < ARRAY_SIZE(frame->Params); i++) { sw_read_mem(csw, frame->AddrFrame.Offset + (2 + i) * sizeof(DWORD), &val32, sizeof(val32)); @@ -578,9 +569,10 @@ reg: fop 31 return reg; } -static void* i386_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +static void *i386_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *size) { -#ifdef __i386__ + WOW64_CONTEXT *ctx = &pctx->x86; + switch (regno) { case CV_REG_EAX: *size = sizeof(ctx->Eax); return &ctx->Eax; @@ -621,7 +613,6 @@ static void* i386_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size case CV_REG_GS: *size = sizeof(ctx->SegGs); return &ctx->SegGs; } -#endif FIXME("Unknown register %x\n", regno); return NULL; } diff --git a/dll/win32/dbghelp/cpu_ppc.c b/dll/win32/dbghelp/cpu_ppc.c index a48168594ef..e1e1cb332ca 100644 --- a/dll/win32/dbghelp/cpu_ppc.c +++ b/dll/win32/dbghelp/cpu_ppc.c @@ -48,7 +48,8 @@ static BOOL ppc_get_addr(HANDLE hThread, const CONTEXT* ctx, return FALSE; } -static BOOL ppc_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL ppc_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame, + union ctx *ctx) { FIXME("not done\n"); return FALSE; @@ -60,7 +61,7 @@ static unsigned ppc_map_dwarf_register(unsigned regno, BOOL eh_frame) return 0; } -static void* ppc_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +static void *ppc_fetch_context_reg(union ctx *ctx, unsigned regno, unsigned *size) { FIXME("NIY\n"); return NULL; diff --git a/dll/win32/dbghelp/cpu_x86_64.c b/dll/win32/dbghelp/cpu_x86_64.c index aa659fafe01..1087ce74646 100644 --- a/dll/win32/dbghelp/cpu_x86_64.c +++ b/dll/win32/dbghelp/cpu_x86_64.c @@ -574,12 +574,13 @@ static BOOL interpret_function_table_entry(struct cpu_stack_walk* csw, * modify (at least) context.{rip, rsp, rbp} using unwind information * either out of PE exception handlers, debug info (dwarf), or simple stack unwind */ -static BOOL fetch_next_frame(struct cpu_stack_walk* csw, CONTEXT* context, +static BOOL fetch_next_frame(struct cpu_stack_walk *csw, union ctx *pcontext, DWORD_PTR curr_pc, void** prtf) { DWORD_PTR cfa; RUNTIME_FUNCTION* rtf; DWORD64 base; + CONTEXT *context = &pcontext->ctx; if (!curr_pc || !(base = sw_module_base(csw, curr_pc))) return FALSE; rtf = sw_table_access(csw, curr_pc); @@ -588,7 +589,7 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw, CONTEXT* context, { return interpret_function_table_entry(csw, context, rtf, base); } - else if (dwarf2_virtual_unwind(csw, curr_pc, context, &cfa)) + else if (dwarf2_virtual_unwind(csw, curr_pc, pcontext, &cfa)) { context->Rsp = cfa; TRACE("next function rip=%016lx\n", context->Rip); @@ -606,7 +607,8 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw, CONTEXT* context, return default_unwind(csw, context); } -static BOOL x86_64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL x86_64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *context) { unsigned deltapc = curr_count <= 1 ? 0 : 1; @@ -641,8 +643,8 @@ static BOOL x86_64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, } else { - if (context->Rsp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); - if (context->Rip != frame->AddrPC.Offset) FIXME("inconsistent Instruction Pointer\n"); + if (context->ctx.Rsp != frame->AddrStack.Offset) FIXME("inconsistent Stack Pointer\n"); + if (context->ctx.Rip != frame->AddrPC.Offset) FIXME("inconsistent Instruction Pointer\n"); if (frame->AddrReturn.Offset == 0) goto done_err; if (!fetch_next_frame(csw, context, frame->AddrPC.Offset - deltapc, &frame->FuncTableEntry)) @@ -653,17 +655,17 @@ static BOOL x86_64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, memset(&frame->Params, 0, sizeof(frame->Params)); /* set frame information */ - frame->AddrStack.Offset = context->Rsp; - frame->AddrFrame.Offset = context->Rbp; - frame->AddrPC.Offset = context->Rip; + frame->AddrStack.Offset = context->ctx.Rsp; + frame->AddrFrame.Offset = context->ctx.Rbp; + frame->AddrPC.Offset = context->ctx.Rip; if (1) { - CONTEXT newctx = *context; + union ctx newctx = *context; if (!fetch_next_frame(csw, &newctx, frame->AddrPC.Offset - deltapc, NULL)) goto done_err; frame->AddrReturn.Mode = AddrModeFlat; - frame->AddrReturn.Offset = newctx.Rip; + frame->AddrReturn.Offset = newctx.ctx.Rip; } frame->Far = TRUE; @@ -685,7 +687,8 @@ done_err: return FALSE; } #else -static BOOL x86_64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +static BOOL x86_64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *ctx) { return FALSE; } @@ -775,9 +778,11 @@ static unsigned x86_64_map_dwarf_register(unsigned regno, BOOL eh_frame) return reg; } -static void* x86_64_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +static void *x86_64_fetch_context_reg(union ctx *pctx, unsigned regno, unsigned *size) { #ifdef __x86_64__ + CONTEXT *ctx = &pctx->ctx; + switch (regno) { case CV_AMD64_RAX: *size = sizeof(ctx->Rax); return &ctx->Rax; diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 21198f400ab..6746494077a 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -541,6 +541,12 @@ struct dump_context MINIDUMP_CALLBACK_INFORMATION* cb; }; +union ctx +{ + CONTEXT ctx; + WOW64_CONTEXT x86; +}; + enum cpu_addr {cpu_addr_pc, cpu_addr_stack, cpu_addr_frame}; struct cpu { @@ -553,7 +559,8 @@ struct cpu enum cpu_addr, ADDRESS64* addr); /* stack manipulation */ - BOOL (*stack_walk)(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context); + BOOL (*stack_walk)(struct cpu_stack_walk *csw, STACKFRAME64 *frame, + union ctx *ctx); /* module manipulation */ void* (*find_runtime_function)(struct module*, DWORD64 addr); @@ -562,7 +569,7 @@ struct cpu unsigned (*map_dwarf_register)(unsigned regno, BOOL eh_frame); /* context related manipulation */ - void* (*fetch_context_reg)(CONTEXT* context, unsigned regno, unsigned* size); + void * (*fetch_context_reg)(union ctx *ctx, unsigned regno, unsigned *size); const char* (*fetch_regname)(unsigned regno); /* minidump per CPU extension */ @@ -677,8 +684,8 @@ struct pdb_cmd_pair { const char* name; DWORD* pvalue; }; -extern BOOL pdb_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip, - CONTEXT* context, struct pdb_cmd_pair* cpair) DECLSPEC_HIDDEN; +extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, + union ctx *context, struct pdb_cmd_pair *cpair) DECLSPEC_HIDDEN; /* path.c */ extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module, @@ -716,8 +723,8 @@ extern BOOL stabs_parse(struct module* module, unsigned long load_offset extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset, const struct elf_thunk_area* thunks, struct image_file_map* fmap) DECLSPEC_HIDDEN; -extern BOOL dwarf2_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip, - CONTEXT* context, ULONG_PTR* cfa) DECLSPEC_HIDDEN; +extern BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, + union ctx *ctx, ULONG_PTR *cfa) DECLSPEC_HIDDEN; /* rsym.c */ extern BOOL rsym_parse(struct module* module, unsigned long load_offset, diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index 14b4a8594c7..b075bd0a591 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -3031,7 +3031,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, } /* retrieve a context register from its dwarf number */ -static ULONG_PTR get_context_reg(CONTEXT *context, ULONG_PTR dw_reg) +static ULONG_PTR get_context_reg(union ctx *context, ULONG_PTR dw_reg) { unsigned regno = dbghelp_current_cpu->map_dwarf_register(dw_reg, TRUE), sz; ULONG_PTR* ptr = dbghelp_current_cpu->fetch_context_reg(context, regno, &sz); @@ -3045,8 +3045,8 @@ static ULONG_PTR get_context_reg(CONTEXT *context, ULONG_PTR dw_reg) } /* set a context register from its dwarf number */ -static void set_context_reg(struct cpu_stack_walk* csw, CONTEXT *context, ULONG_PTR dw_reg, - ULONG_PTR val, BOOL isdebuggee) +static void set_context_reg(struct cpu_stack_walk* csw, union ctx *context, + ULONG_PTR dw_reg, ULONG_PTR val, BOOL isdebuggee) { unsigned regno = dbghelp_current_cpu->map_dwarf_register(dw_reg, TRUE), sz; ULONG_PTR* ptr = dbghelp_current_cpu->fetch_context_reg(context, regno, &sz); @@ -3079,7 +3079,8 @@ static void set_context_reg(struct cpu_stack_walk* csw, CONTEXT *context, ULONG_ } /* copy a register from one context to another using dwarf number */ -static void copy_context_reg(CONTEXT *dstcontext, ULONG_PTR dwregdst, CONTEXT* srccontext, ULONG_PTR dwregsrc) +static void copy_context_reg(union ctx *dstcontext, ULONG_PTR dwregdst, + union ctx *srccontext, ULONG_PTR dwregsrc) { unsigned regdstno = dbghelp_current_cpu->map_dwarf_register(dwregdst, TRUE), szdst; unsigned regsrcno = dbghelp_current_cpu->map_dwarf_register(dwregsrc, TRUE), szsrc; @@ -3096,7 +3097,7 @@ static void copy_context_reg(CONTEXT *dstcontext, ULONG_PTR dwregdst, CONTEXT* s } static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_walk* csw, - const unsigned char* zp, CONTEXT *context) + const unsigned char* zp, union ctx *context) { dwarf2_traverse_context_t ctx; ULONG_PTR reg, sz, tmp, stack[64]; @@ -3207,11 +3208,11 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w } static void apply_frame_state(const struct module* module, struct cpu_stack_walk* csw, - CONTEXT *context, struct frame_state *state, ULONG_PTR* cfa) + union ctx *context, struct frame_state *state, ULONG_PTR* cfa) { unsigned int i; ULONG_PTR value; - CONTEXT new_context = *context; + union ctx new_context = *context; switch (state->cfa_rule) { @@ -3263,7 +3264,8 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk * dwarf2_virtual_unwind * */ -BOOL dwarf2_virtual_unwind(struct cpu_stack_walk* csw, ULONG_PTR ip, CONTEXT* context, ULONG_PTR* cfa) +BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, + union ctx *context, ULONG_PTR *cfa) { struct module_pair pair; struct frame_info info; diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 62cd390ccd7..16c350184df 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -3199,8 +3199,8 @@ done: return FALSE; } -BOOL pdb_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip, - CONTEXT* context, struct pdb_cmd_pair* cpair) +BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, + union ctx *context, struct pdb_cmd_pair *cpair) { struct module_pair pair; struct pdb_module_info* pdb_info; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 9ca733f7598..f3ce74f8425 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: 3ff8fa7ed1d28b38703125b0c8c632410e3fd980 + wine: 3ce304e60100962503bcded0adb69659f849d1b4
4 years, 3 months
1
0
0
0
[reactos] 28/179: [SDK] Add WOW64_CONTEXT structure
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4084b5f214515a6268c50…
commit 4084b5f214515a6268c507311bddc3db11a3abce Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 11 14:28:03 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [SDK] Add WOW64_CONTEXT structure --- sdk/include/xdk/winnt_old.h | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/sdk/include/xdk/winnt_old.h b/sdk/include/xdk/winnt_old.h index e935859d952..09b774cbfca 100644 --- a/sdk/include/xdk/winnt_old.h +++ b/sdk/include/xdk/winnt_old.h @@ -2099,6 +2099,75 @@ typedef struct _CONTEXT #endif typedef CONTEXT *PCONTEXT; +/* The WoW64 context */ +#define WOW64_CONTEXT_i386 0x00010000 +#define WOW64_CONTEXT_i486 0x00010000 +#define WOW64_CONTEXT_CONTROL (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000001)) +#define WOW64_CONTEXT_INTEGER (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000002)) +#define WOW64_CONTEXT_SEGMENTS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000004)) +#define WOW64_CONTEXT_FLOATING_POINT (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000008)) +#define WOW64_CONTEXT_DEBUG_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000010)) +#define WOW64_CONTEXT_EXTENDED_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000020)) +#define WOW64_CONTEXT_FULL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS) +#define WOW64_CONTEXT_ALL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | \ + WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | \ + WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS) + +#define WOW64_CONTEXT_XSTATE (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000040)) + +#define WOW64_CONTEXT_EXCEPTION_ACTIVE 0x08000000 +#define WOW64_CONTEXT_SERVICE_ACTIVE 0x10000000 +#define WOW64_CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define WOW64_CONTEXT_EXCEPTION_REPORTING 0x80000000 + +#define WOW64_SIZE_OF_80387_REGISTERS 80 +#define WOW64_MAXIMUM_SUPPORTED_EXTENSION 512 + +typedef struct _WOW64_FLOATING_SAVE_AREA +{ + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[WOW64_SIZE_OF_80387_REGISTERS]; + DWORD Cr0NpxState; +} WOW64_FLOATING_SAVE_AREA, *PWOW64_FLOATING_SAVE_AREA; + +#include "pshpack4.h" +typedef struct _WOW64_CONTEXT +{ + DWORD ContextFlags; + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + WOW64_FLOATING_SAVE_AREA FloatSave; + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; + BYTE ExtendedRegisters[WOW64_MAXIMUM_SUPPORTED_EXTENSION]; +} WOW64_CONTEXT, *PWOW64_CONTEXT; +#include "poppack.h" + + #define EXCEPTION_MAXIMUM_PARAMETERS 15 #define EXCEPTION_NONCONTINUABLE 0x01 #define EXCEPTION_UNWINDING 0x02
4 years, 3 months
1
0
0
0
[reactos] 27/179: [WINESYNC] dbghelp: Fix loading of Mach-O load commands for 64-bit binaries.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=148591a8a6e59c95f7047…
commit 148591a8a6e59c95f7047f0b910a3fc2ee709fe0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 13:16:16 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [WINESYNC] dbghelp: Fix loading of Mach-O load commands for 64-bit binaries. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3ff8fa7ed1d28b38703125b0c8c632410e3fd980 by Ken Thomases <ken(a)codeweavers.com> --- dll/win32/dbghelp/image_private.h | 1 + dll/win32/dbghelp/macho_module.c | 5 +++-- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 6b435559d72..46275481f96 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -91,6 +91,7 @@ struct image_file_map #ifdef HAVE_MACH_O_LOADER_H struct mach_header mach_header; + size_t header_size; /* size of real header in file */ const struct load_command* load_commands; const struct uuid_command* uuid; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 9401dfb0c78..05130b7de8d 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -415,7 +415,7 @@ static const struct load_command* macho_map_load_commands(struct macho_file_map* if (fmap->load_commands == IMAGE_NO_MAP) { fmap->load_commands = (const struct load_command*) macho_map_range( - fmap, sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds, NULL); + fmap, fmap->header_size, fmap->mach_header.sizeofcmds, NULL); TRACE("Mapped load commands: %p\n", fmap->load_commands); } @@ -433,7 +433,7 @@ static void macho_unmap_load_commands(struct macho_file_map* fmap) { TRACE("Unmapping load commands: %p\n", fmap->load_commands); macho_unmap_range(NULL, (const void**)&fmap->load_commands, fmap, - sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds); + fmap->header_size, fmap->mach_header.sizeofcmds); } } @@ -666,6 +666,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, ifm->modtype = DMT_MACHO; ifm->addr_size = (pcs->is_64bit) ? 64 : 32; + fmap->header_size = (pcs->is_64bit) ? sizeof(struct mach_header_64) : sizeof(struct mach_header); len = WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, NULL, 0, NULL, NULL); if (!(filename = HeapAlloc(GetProcessHeap(), 0, len))) diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index a0a73e68571..9ca733f7598 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: 053a7e225c8190fd7416b3f3c3186f1ac230eeb3 + wine: 3ff8fa7ed1d28b38703125b0c8c632410e3fd980
4 years, 3 months
1
0
0
0
[reactos] 26/179: [WINESYNC] dbghelp: Use the ARRAY_SIZE() macro.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4e89603929e46d964de30…
commit 4e89603929e46d964de3045b78bd8f7224ae94b0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 13:16:15 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [WINESYNC] dbghelp: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 053a7e225c8190fd7416b3f3c3186f1ac230eeb3 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/win32/dbghelp/compat.h | 1 + dll/win32/dbghelp/cpu_i386.c | 4 ++-- dll/win32/dbghelp/dbghelp.c | 5 ++--- dll/win32/dbghelp/elf_module.c | 14 ++++++-------- dll/win32/dbghelp/macho_module.c | 2 +- dll/win32/dbghelp/minidump.c | 4 ++-- dll/win32/dbghelp/module.c | 16 +++++++--------- dll/win32/dbghelp/msc.c | 2 +- dll/win32/dbghelp/stabs.c | 6 +++--- dll/win32/dbghelp/symbol.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 11 files changed, 27 insertions(+), 31 deletions(-) diff --git a/dll/win32/dbghelp/compat.h b/dll/win32/dbghelp/compat.h index cbd90edbe81..8f6047ea120 100644 --- a/dll/win32/dbghelp/compat.h +++ b/dll/win32/dbghelp/compat.h @@ -113,6 +113,7 @@ INT __WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, LPST // #define toupperW(n) towupper((n)) // winnt.h +# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define IMAGE_FILE_MACHINE_ARMNT 0x1c4 #define IMAGE_FILE_MACHINE_POWERPC 0x1f0 #define IMAGE_FILE_MACHINE_ARM64 0xaa64 diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 86e8fdbdbec..e8056a78a3c 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -458,7 +458,7 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO * work if the parameter is in fact bigger than 16bit, but * there's no way to know that here */ - for (i = 0; i < sizeof(frame->Params) / sizeof(frame->Params[0]); i++) + for (i = 0; i < ARRAY_SIZE(frame->Params); i++) { sw_read_mem(csw, p + (2 + i) * sizeof(WORD), &val16, sizeof(val16)); frame->Params[i] = val16; @@ -491,7 +491,7 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO frame->AddrReturn.Mode = AddrModeFlat; frame->AddrReturn.Offset = newctx.Eip; #endif - for (i = 0; i < sizeof(frame->Params) / sizeof(frame->Params[0]); i++) + for (i = 0; i < ARRAY_SIZE(frame->Params); i++) { sw_read_mem(csw, frame->AddrFrame.Offset + (2 + i) * sizeof(DWORD), &val32, sizeof(val32)); frame->Params[i] = val32; diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c index 14eeb781637..732309567a9 100644 --- a/dll/win32/dbghelp/dbghelp.c +++ b/dll/win32/dbghelp/dbghelp.c @@ -257,9 +257,8 @@ static BOOL WINAPI process_invade_cb(PCWSTR name, ULONG64 base, ULONG size, PVOI WCHAR tmp[MAX_PATH]; HANDLE hProcess = user; - if (!GetModuleFileNameExW(hProcess, (HMODULE)(DWORD_PTR)base, - tmp, sizeof(tmp) / sizeof(WCHAR))) - lstrcpynW(tmp, name, sizeof(tmp) / sizeof(WCHAR)); + if (!GetModuleFileNameExW(hProcess, (HMODULE)(DWORD_PTR)base, tmp, ARRAY_SIZE(tmp))) + lstrcpynW(tmp, name, ARRAY_SIZE(tmp)); SymLoadModuleExW(hProcess, 0, tmp, name, base, size, NULL, 0); return TRUE; diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 32ce3455db0..6b8d47a1e40 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -974,7 +974,7 @@ static BOOL elf_locate_debug_link(struct image_file_map* fmap, const char* filen { static const WCHAR globalDebugDirW[] = {'/','u','s','r','/','l','i','b','/','d','e','b','u','g','/'}; static const WCHAR dotDebugW[] = {'.','d','e','b','u','g','/'}; - const size_t globalDebugDirLen = sizeof(globalDebugDirW) / sizeof(WCHAR); + const size_t globalDebugDirLen = ARRAY_SIZE(globalDebugDirW); size_t filename_len; WCHAR* p = NULL; WCHAR* slash; @@ -999,7 +999,7 @@ static BOOL elf_locate_debug_link(struct image_file_map* fmap, const char* filen /* testing execdir/.debug/filename */ memcpy(slash, dotDebugW, sizeof(dotDebugW)); - MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash + sizeof(dotDebugW) / sizeof(WCHAR), filename_len); + MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash + ARRAY_SIZE(dotDebugW), filename_len); if (elf_check_debug_link(p, fmap_link, crc)) goto found; /* testing globaldebugdir/execdir/filename */ @@ -1049,9 +1049,9 @@ static BOOL elf_locate_build_id_target(struct image_file_map* fmap, const BYTE* (idlen * 2 + 1) * sizeof(WCHAR) + sizeof(dotDebug0W)); z = p; memcpy(z, globalDebugDirW, sizeof(globalDebugDirW)); - z += sizeof(globalDebugDirW) / sizeof(WCHAR); + z += ARRAY_SIZE(globalDebugDirW); memcpy(z, buildidW, sizeof(buildidW)); - z += sizeof(buildidW) / sizeof(WCHAR); + z += ARRAY_SIZE(buildidW); if (id < idend) { @@ -1694,8 +1694,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, ReadProcessMemory(pcs->handle, lm.l_name, bufstr, sizeof(bufstr), NULL)) { bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, - sizeof(bufstrW) / sizeof(WCHAR)); + MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); if (!cb(bufstrW, (unsigned long)lm.l_addr, (unsigned long)lm.l_ld, FALSE, user)) break; @@ -1729,8 +1728,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, bufstr, sizeof(bufstr), NULL)) { bufstr[sizeof(bufstr) - 1] = '\0'; - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, - sizeof(bufstrW) / sizeof(WCHAR)); + MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); if (!cb(bufstrW, (unsigned long)lm.l_addr, (unsigned long)lm.l_ld, FALSE, user)) break; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 52c8e69108c..9401dfb0c78 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1672,7 +1672,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs, { bufstr[sizeof(bufstr) - 1] = '\0'; TRACE("[%d] image file %s\n", i, debugstr_a(bufstr)); - MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, sizeof(bufstrW) / sizeof(WCHAR)); + MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); if (!cb(bufstrW, (unsigned long)info_array[i].imageLoadAddress, user)) break; } diff --git a/dll/win32/dbghelp/minidump.c b/dll/win32/dbghelp/minidump.c index 4dead52b92e..1a5dca9de67 100644 --- a/dll/win32/dbghelp/minidump.c +++ b/dll/win32/dbghelp/minidump.c @@ -215,9 +215,9 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name, if (is_elf || !GetModuleFileNameExW(dc->hProcess, (HMODULE)(DWORD_PTR)base, dc->modules[dc->num_modules].name, - sizeof(dc->modules[dc->num_modules].name) / sizeof(WCHAR))) + ARRAY_SIZE(dc->modules[dc->num_modules].name))) lstrcpynW(dc->modules[dc->num_modules].name, name, - sizeof(dc->modules[dc->num_modules].name) / sizeof(WCHAR)); + ARRAY_SIZE(dc->modules[dc->num_modules].name)); dc->modules[dc->num_modules].base = base; dc->modules[dc->num_modules].size = size; dc->modules[dc->num_modules].timestamp = timestamp; diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index b47fbb2af66..8a47c152c25 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -144,9 +144,8 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size) void module_set_module(struct module* module, const WCHAR* name) { - module_fill_module(name, module->module.ModuleName, - sizeof(module->module.ModuleName) / sizeof(module->module.ModuleName[0])); - module_fill_module(name, module->modulename, sizeof(module->modulename) / sizeof(module->modulename[0])); + module_fill_module(name, module->module.ModuleName, ARRAY_SIZE(module->module.ModuleName)); + module_fill_module(name, module->modulename, ARRAY_SIZE(module->modulename)); } #ifndef __REACTOS__ @@ -227,7 +226,7 @@ struct module* module_new(struct process* pcs, const WCHAR* name, module->module.ImageSize = size; module_set_module(module, name); module->module.ImageName[0] = '\0'; - lstrcpynW(module->module.LoadedImageName, name, sizeof(module->module.LoadedImageName) / sizeof(WCHAR)); + lstrcpynW(module->module.LoadedImageName, name, ARRAY_SIZE(module->module.LoadedImageName)); module->module.SymType = SymNone; module->module.NumSyms = 0; module->module.TimeDateStamp = stamp; @@ -296,7 +295,7 @@ struct module* module_find_by_nameA(const struct process* pcs, const char* name) { WCHAR wname[MAX_PATH]; - MultiByteToWideChar(CP_ACP, 0, name, -1, wname, sizeof(wname) / sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, name, -1, wname, ARRAY_SIZE(wname)); return module_find_by_nameW(pcs, wname); } @@ -698,8 +697,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam if (wModuleName) module_set_module(module, wModuleName); if (wImageName) - lstrcpynW(module->module.ImageName, wImageName, - sizeof(module->module.ImageName) / sizeof(WCHAR)); + lstrcpynW(module->module.ImageName, wImageName, ARRAY_SIZE(module->module.ImageName)); return module->module.BaseOfImage; } @@ -963,9 +961,9 @@ BOOL WINAPI EnumerateLoadedModulesW64(HANDLE hProcess, for (i = 0; i < sz; i++) { if (!GetModuleInformation(hProcess, hMods[i], &mi, sizeof(mi)) || - !GetModuleBaseNameW(hProcess, hMods[i], baseW, sizeof(baseW) / sizeof(WCHAR))) + !GetModuleBaseNameW(hProcess, hMods[i], baseW, ARRAY_SIZE(baseW))) continue; - module_fill_module(baseW, modW, sizeof(modW) / sizeof(modW[0])); + module_fill_module(baseW, modW, ARRAY_SIZE(modW)); EnumLoadedModulesCallback(modW, (DWORD_PTR)mi.lpBaseOfDll, mi.SizeOfImage, UserContext); } diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 07f3e3a469f..62cd390ccd7 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2896,7 +2896,7 @@ static BOOL pdb_process_file(const struct process* pcs, msc_dbg->module->module.PdbAge = pdb_info->pdb_files[0].age; MultiByteToWideChar(CP_ACP, 0, pdb_lookup->filename, -1, msc_dbg->module->module.LoadedPdbName, - sizeof(msc_dbg->module->module.LoadedPdbName) / sizeof(WCHAR)); + ARRAY_SIZE(msc_dbg->module->module.LoadedPdbName)); /* FIXME: we could have a finer grain here */ msc_dbg->module->module.LineNumbers = TRUE; msc_dbg->module->module.GlobalSymbols = TRUE; diff --git a/dll/win32/dbghelp/stabs.c b/dll/win32/dbghelp/stabs.c index 9caf6f9d427..09e451c7d2f 100644 --- a/dll/win32/dbghelp/stabs.c +++ b/dll/win32/dbghelp/stabs.c @@ -345,7 +345,7 @@ struct ParseTypedefData #ifdef PTS_DEBUG static void stabs_pts_push(struct ParseTypedefData* ptd, unsigned line) { - assert(ptd->err_idx < sizeof(ptd->errors) / sizeof(ptd->errors[0])); + assert(ptd->err_idx < ARRAY_SIZE(ptd->errors)); ptd->errors[ptd->err_idx].line = line; ptd->errors[ptd->err_idx].ptr = ptd->ptr; ptd->err_idx++; @@ -357,7 +357,7 @@ static void stabs_pts_push(struct ParseTypedefData* ptd, unsigned line) static int stabs_get_basic(struct ParseTypedefData* ptd, unsigned basic, struct symt** symt) { - PTS_ABORTIF(ptd, basic >= sizeof(stabs_basic) / sizeof(stabs_basic[0])); + PTS_ABORTIF(ptd, basic >= ARRAY_SIZE(stabs_basic)); if (!stabs_basic[basic]) { @@ -1625,7 +1625,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, break; case N_BINCL: stabs_add_include(stabs_new_include(ptr, n_value)); - assert(incl_stk < (int)(sizeof(incl) / sizeof(incl[0])) - 1); + assert(incl_stk < (int) ARRAY_SIZE(incl) - 1); incl[++incl_stk] = source_idx; source_idx = source_new(module, NULL, ptr); break; diff --git a/dll/win32/dbghelp/symbol.c b/dll/win32/dbghelp/symbol.c index 5b0ad32cee3..15a0a9c378b 100644 --- a/dll/win32/dbghelp/symbol.c +++ b/dll/win32/dbghelp/symbol.c @@ -2130,7 +2130,7 @@ BOOL WINAPI SymAddSymbol(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR name, { WCHAR nameW[MAX_SYM_NAME]; - MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, sizeof(nameW) / sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, ARRAY_SIZE(nameW)); return SymAddSymbolW(hProcess, BaseOfDll, nameW, addr, size, flags); } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index ee2961be708..a0a73e68571 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: 3d482d3f9f0a3ffa69540af87594b3c1dc46e07b + wine: 053a7e225c8190fd7416b3f3c3186f1ac230eeb3
4 years, 3 months
1
0
0
0
[reactos] 25/179: [WINESYNC] dbghelp: Recompute location after fixing it.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3247b3f598ba97cad539…
commit d3247b3f598ba97cad539a2d5e91c182f40e098d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 13:14:08 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:34 2020 +0200 [WINESYNC] dbghelp: Recompute location after fixing it. Fix a assertion raised by every exception with newer clang versions (>3.7) at least on ARM64: ../../../dlls/dbghelp/dwarf.c:1641: void dwarf2_parse_variable(dwarf2_subprogram_t *, struct symt_block *, dwarf2_debug_info_t *): Assertion `subpgm->func' failed. Signed-off-by: André Hentschel <nerv(a)dawncrow.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3d482d3f9f0a3ffa69540af87594b3c1dc46e07b by André Hentschel <nerv(a)dawncrow.de> --- dll/win32/dbghelp/dwarf.c | 37 +++++++++++++++++++------------------ sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index 04438f74a95..14b4a8594c7 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -373,9 +373,9 @@ static unsigned long dwarf2_parse_addr(dwarf2_traverse_context_t* ctx) return ret; } -static const char* dwarf2_debug_traverse_ctx(const dwarf2_traverse_context_t* ctx) +static const char* dwarf2_debug_traverse_ctx(const dwarf2_traverse_context_t* ctx) { - return wine_dbg_sprintf("ctx(%p)", ctx->data); + return wine_dbg_sprintf("ctx(%p)", ctx->data); } static const char* dwarf2_debug_ctx(const dwarf2_parse_context_t* ctx) @@ -398,7 +398,7 @@ dwarf2_abbrev_table_find_entry(const struct sparse_array* abbrev_table, return sparse_array_find(abbrev_table, entry_code); } -static void dwarf2_parse_abbrev_set(dwarf2_traverse_context_t* abbrev_ctx, +static void dwarf2_parse_abbrev_set(dwarf2_traverse_context_t* abbrev_ctx, struct sparse_array* abbrev_table, struct pool* pool) { @@ -412,17 +412,17 @@ static void dwarf2_parse_abbrev_set(dwarf2_traverse_context_t* abbrev_ctx, assert( NULL != abbrev_ctx ); TRACE("%s, end at %p\n", - dwarf2_debug_traverse_ctx(abbrev_ctx), abbrev_ctx->end_data); + dwarf2_debug_traverse_ctx(abbrev_ctx), abbrev_ctx->end_data); sparse_array_init(abbrev_table, sizeof(dwarf2_abbrev_entry_t), 32); while (abbrev_ctx->data < abbrev_ctx->end_data) { - TRACE("now at %s\n", dwarf2_debug_traverse_ctx(abbrev_ctx)); + TRACE("now at %s\n", dwarf2_debug_traverse_ctx(abbrev_ctx)); entry_code = dwarf2_leb128_as_unsigned(abbrev_ctx); TRACE("found entry_code %lu\n", entry_code); if (!entry_code) { - TRACE("NULL entry code at %s\n", dwarf2_debug_traverse_ctx(abbrev_ctx)); + TRACE("NULL entry code at %s\n", dwarf2_debug_traverse_ctx(abbrev_ctx)); break; } abbrev_entry = sparse_array_add(abbrev_table, entry_code, pool); @@ -556,7 +556,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, attr->u.uvalue = ctx->ref_offset + dwarf2_get_u4(data); TRACE("ref4<0x%lx>\n", attr->u.uvalue); break; - + case DW_FORM_ref8: FIXME("Unhandled 64-bit support\n"); break; @@ -585,7 +585,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, } TRACE("strp<%s>\n", attr->u.string); break; - + case DW_FORM_block: attr->u.block.size = dwarf2_get_leb128_as_unsigned(data, &attr->u.block.ptr); break; @@ -953,6 +953,7 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, #else loc->offset = (uintptr_t)ptr; #endif + compute_location(&lctx, loc, NULL, frame); } } return TRUE; @@ -1182,7 +1183,7 @@ static struct symt* dwarf2_parse_base_type(dwarf2_parse_context_t* ctx, int cache_idx = -1; if (di->symt) return di->symt; - TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL; @@ -1234,7 +1235,7 @@ static struct symt* dwarf2_parse_typedef(dwarf2_parse_context_t* ctx, if (di->symt) return di->symt; - TRACE("%s, for %lu\n", dwarf2_debug_ctx(ctx), di->abbrev->entry_code); + TRACE("%s, for %lu\n", dwarf2_debug_ctx(ctx), di->abbrev->entry_code); if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL; ref_type = dwarf2_lookup_type(ctx, di); @@ -1253,7 +1254,7 @@ static struct symt* dwarf2_parse_pointer_type(dwarf2_parse_context_t* ctx, if (di->symt) return di->symt; - TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + 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 = sizeof(void *); if (!(ref_type = dwarf2_lookup_type(ctx, di))) @@ -1443,7 +1444,7 @@ static void dwarf2_parse_udt_member(dwarf2_parse_context_t* ctx, bit_offset.u.uvalue = nbytes.u.uvalue * 8 - bit_offset.u.uvalue - bit_size.u.uvalue; } else bit_offset.u.uvalue = 0; - symt_add_udt_element(ctx->module, parent, name.u.string, elt_type, + symt_add_udt_element(ctx->module, parent, name.u.string, elt_type, (loc.offset << 3) + bit_offset.u.uvalue, bit_size.u.uvalue); @@ -1465,7 +1466,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx, if (di->symt) return di->symt; - TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); /* quirk... FIXME provide real support for anonymous UDTs */ if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) @@ -1530,7 +1531,7 @@ static void dwarf2_parse_enumerator(dwarf2_parse_context_t* ctx, struct attribute name; struct attribute value; - TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) return; if (!dwarf2_find_attribute(ctx, di, DW_AT_const_value, &value)) value.u.svalue = 0; @@ -1551,7 +1552,7 @@ static struct symt* dwarf2_parse_enumeration_type(dwarf2_parse_context_t* ctx, if (di->symt) return di->symt; - TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); + TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL; if (!dwarf2_find_attribute(ctx, di, DW_AT_byte_size, &size)) size.u.uvalue = 4; @@ -1612,7 +1613,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, is_pmt = !block && di->abbrev->tag == DW_TAG_formal_parameter; param_type = dwarf2_lookup_type(subpgm->ctx, di); - + if (!dwarf2_find_attribute(subpgm->ctx, di, DW_AT_name, &name)) { /* cannot do much without the name, the functions below won't like it. */ return; @@ -1649,7 +1650,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, * pmt/variable in a register */ assert(subpgm->func); - symt_add_func_local(subpgm->ctx->module, subpgm->func, + symt_add_func_local(subpgm->ctx->module, subpgm->func, is_pmt ? DataIsParam : DataIsLocal, &loc, block, param_type, name.u.string); break; @@ -2171,7 +2172,7 @@ static void dwarf2_load_one_entry(dwarf2_parse_context_t* ctx, break; default: FIXME("Unhandled Tag type 0x%lx at %s, for %lu\n", - di->abbrev->tag, dwarf2_debug_ctx(ctx), di->abbrev->entry_code); + di->abbrev->tag, dwarf2_debug_ctx(ctx), di->abbrev->entry_code); } } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 15ff3dbd075..ee2961be708 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: 86864486be64a277f6edf8e66709cd0f17a4eed9 + wine: 3d482d3f9f0a3ffa69540af87594b3c1dc46e07b
4 years, 3 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200