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] 124/179: [WINESYNC] dbghelp: Use DWARF registry mapping quirk only for actual macho modules.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d6dca1da171f0768ac8a0…
commit d6dca1da171f0768ac8a0530f9e9febc6f03008d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:46:08 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Use DWARF registry mapping quirk only for actual macho modules. Fixes handling DWARF in PE on macOS. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3b6c268380d703079fa3c5ca06f67b6feb02487f by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/cpu_i386.c | 4 +--- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 1528b603221..78f477115d7 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -526,13 +526,11 @@ static unsigned i386_map_dwarf_register(unsigned regno, const struct module* mod case 3: reg = CV_REG_EBX; break; case 4: case 5: -#ifdef __APPLE__ /* On OS X, DWARF eh_frame uses a different mapping for the registers. It's apparently the mapping as emitted by GCC, at least at some point in its history. */ - if (eh_frame) + if (eh_frame && module->type == DMT_MACHO) reg = (regno == 4) ? CV_REG_EBP : CV_REG_ESP; else -#endif reg = (regno == 4) ? CV_REG_ESP : CV_REG_EBP; break; case 6: reg = CV_REG_ESI; break; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 4cfa407ebcf..85f89bf51d8 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 5d8067c6088a30cdb4fe6945e6ae1cda0da85467 + wine: 3b6c268380d703079fa3c5ca06f67b6feb02487f
4 years, 3 months
1
0
0
0
[reactos] 123/179: [WINESYNC] dbghelp: Pass module to map_dwarf_register.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0b8d0e0a613a3486c91eb…
commit 0b8d0e0a613a3486c91eb7aa168dfc912c6a2ec8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:45:02 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Pass module to map_dwarf_register. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 5d8067c6088a30cdb4fe6945e6ae1cda0da85467 by Jacek Caban <jacek(a)codeweavers.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_ppc.c | 2 +- dll/win32/dbghelp/cpu_x86_64.c | 2 +- dll/win32/dbghelp/dbghelp_private.h | 2 +- dll/win32/dbghelp/dwarf.c | 84 ++++++++++++++++++------------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/dll/win32/dbghelp/cpu_arm.c b/dll/win32/dbghelp/cpu_arm.c index 9385e2e4eb5..a05bd90c9ae 100644 --- a/dll/win32/dbghelp/cpu_arm.c +++ b/dll/win32/dbghelp/cpu_arm.c @@ -161,7 +161,7 @@ static BOOL arm_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, } #endif -static unsigned arm_map_dwarf_register(unsigned regno, BOOL eh_frame) +static unsigned arm_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame) { if (regno <= 15) return CV_ARM_R0 + regno; if (regno == 128) return CV_ARM_CPSR; diff --git a/dll/win32/dbghelp/cpu_arm64.c b/dll/win32/dbghelp/cpu_arm64.c index f3ab0936ebe..515294fe95c 100644 --- a/dll/win32/dbghelp/cpu_arm64.c +++ b/dll/win32/dbghelp/cpu_arm64.c @@ -155,7 +155,7 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame, } #endif -static unsigned arm64_map_dwarf_register(unsigned regno, BOOL eh_frame) +static unsigned arm64_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame) { if (regno <= 28) return CV_ARM64_X0 + regno; if (regno == 29) return CV_ARM64_FP; diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 6c10107ba3d..1528b603221 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -514,7 +514,7 @@ done_err: } #endif /* DBGHELP_STATIC_LIB */ -static unsigned i386_map_dwarf_register(unsigned regno, BOOL eh_frame) +static unsigned i386_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame) { unsigned reg; diff --git a/dll/win32/dbghelp/cpu_ppc.c b/dll/win32/dbghelp/cpu_ppc.c index e1e1cb332ca..80db2be704b 100644 --- a/dll/win32/dbghelp/cpu_ppc.c +++ b/dll/win32/dbghelp/cpu_ppc.c @@ -55,7 +55,7 @@ static BOOL ppc_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame, return FALSE; } -static unsigned ppc_map_dwarf_register(unsigned regno, BOOL eh_frame) +static unsigned ppc_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame) { FIXME("not done\n"); return 0; diff --git a/dll/win32/dbghelp/cpu_x86_64.c b/dll/win32/dbghelp/cpu_x86_64.c index 57cfa112446..f0c12207357 100644 --- a/dll/win32/dbghelp/cpu_x86_64.c +++ b/dll/win32/dbghelp/cpu_x86_64.c @@ -724,7 +724,7 @@ static void* x86_64_find_runtime_function(struct module* module, DWORD64 addr return NULL; } -static unsigned x86_64_map_dwarf_register(unsigned regno, BOOL eh_frame) +static unsigned x86_64_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame) { unsigned reg; diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 6608c78ad53..521f64881ad 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -587,7 +587,7 @@ struct cpu void* (*find_runtime_function)(struct module*, DWORD64 addr); /* dwarf dedicated information */ - unsigned (*map_dwarf_register)(unsigned regno, BOOL eh_frame); + unsigned (*map_dwarf_register)(unsigned regno, const struct module* module, BOOL eh_frame); /* context related manipulation */ void * (*fetch_context_reg)(union ctx *ctx, unsigned regno, unsigned *size); diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index bf7fb9ce232..04985003653 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -655,18 +655,18 @@ static void dwarf2_load_one_entry(dwarf2_parse_context_t*, dwarf2_debug_info_t*) #define Wine_DW_no_register 0x7FFFFFFF -static unsigned dwarf2_map_register(int regno) +static unsigned dwarf2_map_register(int regno, const struct module* module) { if (regno == Wine_DW_no_register) { FIXME("What the heck map reg 0x%x\n",regno); return 0; } - return dbghelp_current_cpu->map_dwarf_register(regno, FALSE); + return dbghelp_current_cpu->map_dwarf_register(regno, module, FALSE); } static enum location_error -compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, +compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, struct location* loc, HANDLE hproc, const struct location* frame) { DWORD_PTR tmp, stack[64]; @@ -693,7 +693,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, */ if (!piece_found) { - DWORD cvreg = dwarf2_map_register(op - DW_OP_reg0); + DWORD cvreg = dwarf2_map_register(op - DW_OP_reg0, module); if (loc->reg != Wine_DW_no_register) FIXME("Only supporting one reg (%s/%d -> %s/%d)\n", dbghelp_current_cpu->fetch_regname(loc->reg), loc->reg, @@ -710,7 +710,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, */ if (!piece_found) { - DWORD cvreg = dwarf2_map_register(op - DW_OP_breg0); + DWORD cvreg = dwarf2_map_register(op - DW_OP_breg0, module); if (loc->reg != Wine_DW_no_register) FIXME("Only supporting one breg (%s/%d -> %s/%d)\n", dbghelp_current_cpu->fetch_regname(loc->reg), loc->reg, @@ -769,7 +769,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, { if (loc->reg != Wine_DW_no_register) FIXME("Only supporting one reg\n"); - loc->reg = dwarf2_map_register(tmp); + loc->reg = dwarf2_map_register(tmp, module); } loc->kind = loc_register; break; @@ -777,7 +777,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, tmp = dwarf2_leb128_as_unsigned(ctx); if (loc->reg != Wine_DW_no_register) FIXME("Only supporting one regx\n"); - loc->reg = dwarf2_map_register(tmp); + loc->reg = dwarf2_map_register(tmp, module); stack[++stk] = dwarf2_leb128_as_signed(ctx); loc->kind = loc_regrel; break; @@ -936,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(&lctx, loc, NULL, frame); + err = compute_location(ctx->module, &lctx, loc, NULL, frame); if (err < 0) { loc->kind = loc_error; @@ -949,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(&lctx, loc, NULL, frame); + compute_location(ctx->module, &lctx, loc, NULL, frame); } } return TRUE; @@ -2546,7 +2546,7 @@ 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(&lctx, frame, pcs->handle, NULL)) < 0) return err; + if ((err = compute_location(modfmt->module, &lctx, frame, pcs->handle, NULL)) < 0) return err; if (frame->kind >= loc_user) { WARN("Couldn't compute runtime frame location\n"); @@ -2800,7 +2800,7 @@ static int valid_reg(ULONG_PTR reg) return (reg < NB_FRAME_REGS); } -static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, +static void execute_cfa_instructions(struct module* module, dwarf2_traverse_context_t* ctx, ULONG_PTR last_ip, struct frame_info *info) { while (ctx->data < ctx->end_data && info->ip <= last_ip + info->signal_frame) @@ -2825,7 +2825,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_offset %s, %ld\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE)), + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE)), offset); info->state.regs[reg] = offset; info->state.rules[reg] = RULE_CFA_OFFSET; @@ -2837,7 +2837,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_restore %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE))); info->state.rules[reg] = RULE_UNSET; break; } @@ -2884,7 +2884,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_offset_extended %s, %ld\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE)), + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE)), offset); info->state.regs[reg] = offset; info->state.rules[reg] = RULE_CFA_OFFSET; @@ -2896,7 +2896,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_restore_extended %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE))); info->state.rules[reg] = RULE_UNSET; break; } @@ -2906,7 +2906,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_undefined %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE))); info->state.rules[reg] = RULE_UNDEFINED; break; } @@ -2916,7 +2916,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_same_value %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE))); info->state.regs[reg] = reg; info->state.rules[reg] = RULE_SAME; break; @@ -2928,8 +2928,8 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg) || !valid_reg(reg2)) break; TRACE("%lx: DW_CFA_register %s == %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE)), - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg2, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE)), + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg2, module, TRUE))); info->state.regs[reg] = reg2; info->state.rules[reg] = RULE_OTHER_REG; break; @@ -2957,7 +2957,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_def_cfa %s, %ld\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE)), + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE)), offset); info->state.cfa_reg = reg; info->state.cfa_offset = offset; @@ -2970,7 +2970,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_def_cfa_register %s\n", info->ip, - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE))); + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE))); info->state.cfa_reg = reg; info->state.cfa_rule = RULE_CFA_OFFSET; break; @@ -3004,7 +3004,7 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, if (!valid_reg(reg)) break; TRACE("%lx: DW_CFA_%sexpression %s %lx-%lx\n", info->ip, (op == DW_CFA_expression) ? "" : "val_", - dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, TRUE)), + dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(reg, module, TRUE)), expr, expr + len); info->state.regs[reg] = expr; info->state.rules[reg] = (op == DW_CFA_expression) ? RULE_EXPRESSION : RULE_VAL_EXPRESSION; @@ -3027,10 +3027,10 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx, } /* retrieve a context register from its dwarf number */ -static DWORD64 get_context_reg(struct cpu_stack_walk *csw, union ctx *context, +static DWORD64 get_context_reg(const struct module* module, struct cpu_stack_walk *csw, union ctx *context, ULONG_PTR dw_reg) { - unsigned regno = csw->cpu->map_dwarf_register(dw_reg, TRUE), sz; + unsigned regno = csw->cpu->map_dwarf_register(dw_reg, module, TRUE), sz; void* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); if (sz == 8) @@ -3043,10 +3043,10 @@ static DWORD64 get_context_reg(struct cpu_stack_walk *csw, union ctx *context, } /* set a context register from its dwarf number */ -static void set_context_reg(struct cpu_stack_walk* csw, union ctx *context, +static void set_context_reg(const struct module* module, struct cpu_stack_walk* csw, union ctx *context, ULONG_PTR dw_reg, ULONG_PTR val, BOOL isdebuggee) { - unsigned regno = csw->cpu->map_dwarf_register(dw_reg, TRUE), sz; + unsigned regno = csw->cpu->map_dwarf_register(dw_reg, module, TRUE), sz; ULONG_PTR* ptr = csw->cpu->fetch_context_reg(context, regno, &sz); if (isdebuggee) @@ -3077,12 +3077,12 @@ 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(struct cpu_stack_walk *csw, +static void copy_context_reg(const struct module* module, struct cpu_stack_walk *csw, union ctx *dstcontext, ULONG_PTR dwregdst, union ctx *srccontext, ULONG_PTR dwregsrc) { - unsigned regdstno = csw->cpu->map_dwarf_register(dwregdst, TRUE), szdst; - unsigned regsrcno = csw->cpu->map_dwarf_register(dwregsrc, TRUE), szsrc; + unsigned regdstno = csw->cpu->map_dwarf_register(dwregdst, module, TRUE), szdst; + unsigned regsrcno = csw->cpu->map_dwarf_register(dwregsrc, module, TRUE), szsrc; ULONG_PTR* ptrdst = csw->cpu->fetch_context_reg(dstcontext, regdstno, &szdst); ULONG_PTR* ptrsrc = csw->cpu->fetch_context_reg(srccontext, regsrcno, &szsrc); @@ -3117,9 +3117,9 @@ 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(csw, context, opcode - DW_OP_reg0); + stack[++sp] = get_context_reg(module, csw, context, opcode - DW_OP_reg0); else if (opcode >= DW_OP_breg0 && opcode <= DW_OP_breg31) - stack[++sp] = get_context_reg(csw, context, opcode - DW_OP_breg0) + stack[++sp] = get_context_reg(module, csw, context, opcode - DW_OP_breg0) + dwarf2_leb128_as_signed(&ctx); else switch (opcode) { @@ -3178,12 +3178,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(csw, context, dwarf2_leb128_as_unsigned(&ctx)); + stack[++sp] = get_context_reg(module, 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(csw, context, reg) + tmp; + stack[++sp] = get_context_reg(module, csw, context, reg) + tmp; break; case DW_OP_deref_size: sz = dwarf2_parse_byte(&ctx); @@ -3230,7 +3230,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(csw, context, state->cfa_reg) + state->cfa_offset; + *cfa = get_context_reg(module, csw, context, state->cfa_reg) + state->cfa_offset; break; } if (!*cfa) return; @@ -3244,18 +3244,18 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk case RULE_SAME: break; case RULE_CFA_OFFSET: - set_context_reg(csw, &new_context, i, *cfa + state->regs[i], TRUE); + set_context_reg(module, csw, &new_context, i, *cfa + state->regs[i], TRUE); break; case RULE_OTHER_REG: - copy_context_reg(csw, &new_context, i, context, state->regs[i]); + copy_context_reg(module, csw, &new_context, i, context, state->regs[i]); break; case RULE_EXPRESSION: value = eval_expression(module, csw, (const unsigned char*)state->regs[i], context); - set_context_reg(csw, &new_context, i, value, TRUE); + set_context_reg(module, csw, &new_context, i, value, TRUE); break; case RULE_VAL_EXPRESSION: value = eval_expression(module, csw, (const unsigned char*)state->regs[i], context); - set_context_reg(csw, &new_context, i, value, FALSE); + set_context_reg(module, csw, &new_context, i, value, FALSE); break; } } @@ -3307,11 +3307,11 @@ 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, - csw->cpu->fetch_regname(csw->cpu->map_dwarf_register(info.retaddr_reg, TRUE))); + csw->cpu->fetch_regname(csw->cpu->map_dwarf_register(info.retaddr_reg, pair.effective, TRUE))); /* if at very beginning of function, return and use default unwinder */ if (ip == info.ip) return FALSE; - execute_cfa_instructions(&cie_ctx, ip, &info); + execute_cfa_instructions(pair.effective, &cie_ctx, ip, &info); if (info.aug_z_format) /* get length of augmentation data */ { @@ -3322,7 +3322,7 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, dwarf2_parse_augmentation_ptr(&fde_ctx, info.lsda_encoding); /* handler_data */ if (end) fde_ctx.data = end; - execute_cfa_instructions(&fde_ctx, ip, &info); + execute_cfa_instructions(pair.effective, &fde_ctx, ip, &info); /* if there is no information about retaddr, use default unwinder */ if (info.state.rules[info.retaddr_reg] == RULE_UNSET) return FALSE; @@ -3375,7 +3375,7 @@ static void dwarf2_location_compute(struct process* pcs, } do_compute: /* now get the variable */ - err = compute_location(&lctx, loc, pcs->handle, &frame); + err = compute_location(modfmt->module, &lctx, loc, pcs->handle, &frame); break; case loc_register: case loc_regrel: diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 89e893dadfe..4cfa407ebcf 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: f7a091af4812ef692fb2b1ec835b8146668aec5c + wine: 5d8067c6088a30cdb4fe6945e6ae1cda0da85467
4 years, 3 months
1
0
0
0
[reactos] 122/179: [WINESYNC] dbghelp: Define NT_GNU_BUILD_ID regardless of whether __ELF__ is defined.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e656f48c38be87b0ee646…
commit e656f48c38be87b0ee6467a2f2a09ea596ea022b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:45:01 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Define NT_GNU_BUILD_ID regardless of whether __ELF__ is defined. Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f7a091af4812ef692fb2b1ec835b8146668aec5c by Gerald Pfeifer <gerald(a)pfeifer.com> --- dll/win32/dbghelp/image_private.h | 5 +---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index e07dea4d267..e614fda237c 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -54,14 +54,11 @@ #ifndef SHT_NULL #define SHT_NULL 0 #endif -#ifndef NT_GNU_BUILD_ID -#define NT_GNU_BUILD_ID 3 #endif -#elif defined(__REACTOS__) + #ifndef NT_GNU_BUILD_ID #define NT_GNU_BUILD_ID 3 #endif -#endif /* structure holding information while handling an ELF image * allows one by one section mapping for memory savings diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index a144f573d98..89e893dadfe 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: f803da493aeb4cf118fb9b076e8042c2535fbcdb + wine: f7a091af4812ef692fb2b1ec835b8146668aec5c
4 years, 3 months
1
0
0
0
[reactos] 121/179: [WINESYNC] dbghelp: Use LONG_PTR instead of long type.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9b31d0349d1f6d4820582…
commit 9b31d0349d1f6d4820582b1e59ee6317321bbe29 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:39:26 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Use LONG_PTR instead of long type. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f803da493aeb4cf118fb9b076e8042c2535fbcdb by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/cpu_i386.c | 2 +- dll/win32/dbghelp/dbghelp_private.h | 72 ++++++++++++------------- dll/win32/dbghelp/dwarf.c | 104 +++++++++++++++++------------------- dll/win32/dbghelp/elf_module.c | 50 ++++++++--------- dll/win32/dbghelp/image_private.h | 2 +- dll/win32/dbghelp/macho_module.c | 70 ++++++++++++------------ dll/win32/dbghelp/minidump.c | 2 +- dll/win32/dbghelp/module.c | 4 +- dll/win32/dbghelp/msc.c | 6 +-- dll/win32/dbghelp/stabs.c | 54 +++++++++---------- dll/win32/dbghelp/storage.c | 8 +-- dll/win32/dbghelp/symbol.c | 18 +++---- dll/win32/dbghelp/type.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 14 files changed, 194 insertions(+), 202 deletions(-) diff --git a/dll/win32/dbghelp/cpu_i386.c b/dll/win32/dbghelp/cpu_i386.c index 420549b40d8..6c10107ba3d 100644 --- a/dll/win32/dbghelp/cpu_i386.c +++ b/dll/win32/dbghelp/cpu_i386.c @@ -52,7 +52,7 @@ static ADDRESS_MODE get_selector_type(HANDLE hThread, const CONTEXT* ctx, WORD s } static BOOL i386_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS64* addr, - unsigned seg, unsigned long offset) + unsigned seg, ULONG_PTR offset) { addr->Mode = AddrModeFlat; addr->Segment = seg; diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 49cf51fff24..6608c78ad53 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -84,8 +84,8 @@ struct sparse_array }; void sparse_array_init(struct sparse_array* sa, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN; -void* sparse_array_find(const struct sparse_array* sa, unsigned long idx) DECLSPEC_HIDDEN; -void* sparse_array_add(struct sparse_array* sa, unsigned long key, struct pool* pool) DECLSPEC_HIDDEN; +void* sparse_array_find(const struct sparse_array* sa, ULONG_PTR idx) DECLSPEC_HIDDEN; +void* sparse_array_add(struct sparse_array* sa, ULONG_PTR key, struct pool* pool) DECLSPEC_HIDDEN; unsigned sparse_array_length(const struct sparse_array* sa) DECLSPEC_HIDDEN; struct hash_table_elt @@ -153,11 +153,7 @@ struct location { unsigned kind : 8, reg; -#ifndef __REACTOS__ - unsigned long offset; -#else - uintptr_t offset; -#endif + ULONG_PTR offset; }; struct symt @@ -175,8 +171,8 @@ struct symt_ht struct symt_block { struct symt symt; - unsigned long address; - unsigned long size; + ULONG_PTR address; + ULONG_PTR size; struct symt* container; /* block, or func */ struct vector vchildren; /* sub-blocks & local variables */ }; @@ -184,7 +180,7 @@ struct symt_block struct symt_compiland { struct symt symt; - unsigned long address; + ULONG_PTR address; unsigned source; struct vector vchildren; /* global variables & functions */ }; @@ -213,8 +209,8 @@ struct symt_data /* DataIs{Member} (all values are in bits, not bytes) */ struct { - long offset; - unsigned long length; + LONG_PTR offset; + ULONG_PTR length; } member; /* DataIsConstant */ VARIANT value; @@ -225,10 +221,10 @@ struct symt_function { struct symt symt; struct hash_table_elt hash_elt; /* if global symbol */ - unsigned long address; + ULONG_PTR address; struct symt* container; /* compiland */ struct symt* type; /* points to function_signature */ - unsigned long size; + ULONG_PTR size; struct vector vlines; struct vector vchildren; /* locals, params, blocks, start/end, labels */ }; @@ -247,8 +243,8 @@ struct symt_public struct hash_table_elt hash_elt; struct symt* container; /* compiland */ BOOL is_function; - unsigned long address; - unsigned long size; + ULONG_PTR address; + ULONG_PTR size; }; struct symt_thunk @@ -256,8 +252,8 @@ struct symt_thunk struct symt symt; struct hash_table_elt hash_elt; struct symt* container; /* compiland */ - unsigned long address; - unsigned long size; + ULONG_PTR address; + ULONG_PTR size; THUNK_ORDINAL ordinal; /* FIXME: doesn't seem to be accessible */ }; @@ -276,7 +272,7 @@ struct symt_basic struct symt symt; struct hash_table_elt hash_elt; enum BasicType bt; - unsigned long size; + ULONG_PTR size; }; struct symt_enum @@ -306,7 +302,7 @@ struct symt_pointer { struct symt symt; struct symt* pointsto; - unsigned long size; + ULONG_PTR size; }; struct symt_typedef @@ -418,7 +414,7 @@ struct module struct wine_rb_tree sources_offsets_tree; }; -typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user); +typedef BOOL (*enum_modules_cb)(const WCHAR*, ULONG_PTR addr, void* user); struct loader_ops { @@ -442,7 +438,7 @@ struct process DWORD64 reg_user; struct module* lmodules; - unsigned long dbg_hdr_addr; + ULONG_PTR dbg_hdr_addr; IMAGEHLP_STACK_FRAME ctx_frame; @@ -454,13 +450,13 @@ struct process struct line_info { - unsigned long is_first : 1, + ULONG_PTR is_first : 1, is_last : 1, is_source_file : 1, line_number; union { - unsigned long pc_offset; /* if is_source_file isn't set */ + ULONG_PTR pc_offset; /* if is_source_file isn't set */ unsigned source_file; /* if is_source_file is set */ } u; }; @@ -637,7 +633,7 @@ extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN; /* elf_module.c */ extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN; struct elf_thunk_area; -extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; +extern int elf_is_in_thunk_area(ULONG_PTR addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN; @@ -668,7 +664,7 @@ extern struct module* module_new(struct process* pcs, const WCHAR* name, enum module_type type, BOOL virtual, DWORD64 addr, DWORD64 size, - unsigned long stamp, unsigned long checksum) DECLSPEC_HIDDEN; + ULONG_PTR stamp, ULONG_PTR checksum) DECLSPEC_HIDDEN; extern struct module* module_get_containee(const struct process* pcs, const struct module* inner) DECLSPEC_HIDDEN; @@ -722,18 +718,18 @@ extern const char* source_get(const struct module* module, unsigned idx) DECLSP extern int source_rb_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN; /* stabs.c */ -typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset, - const char* name, unsigned long offset, +typedef void (*stabs_def_cb)(struct module* module, ULONG_PTR load_offset, + const char* name, ULONG_PTR offset, BOOL is_public, BOOL is_global, unsigned char other, struct symt_compiland* compiland, void* user); -extern BOOL stabs_parse(struct module* module, unsigned long load_offset, +extern BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, const char* stabs, int stablen, const char* strs, int strtablen, stabs_def_cb callback, void* user) DECLSPEC_HIDDEN; /* dwarf.c */ struct image_file_map; -extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset, +extern BOOL dwarf2_parse(struct module* module, ULONG_PTR 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, @@ -762,33 +758,33 @@ extern void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) DECLS extern struct symt_ht* symt_find_nearest(struct module* module, DWORD_PTR addr) DECLSPEC_HIDDEN; extern struct symt_compiland* - symt_new_compiland(struct module* module, unsigned long address, + symt_new_compiland(struct module* module, ULONG_PTR address, unsigned src_idx) DECLSPEC_HIDDEN; extern struct symt_public* symt_new_public(struct module* module, struct symt_compiland* parent, const char* typename, BOOL is_function, - unsigned long address, + ULONG_PTR address, unsigned size) DECLSPEC_HIDDEN; extern struct symt_data* symt_new_global_variable(struct module* module, struct symt_compiland* parent, const char* name, unsigned is_static, - struct location loc, unsigned long size, + struct location loc, ULONG_PTR size, struct symt* type) DECLSPEC_HIDDEN; extern struct symt_function* symt_new_function(struct module* module, struct symt_compiland* parent, const char* name, - unsigned long addr, unsigned long size, + ULONG_PTR addr, ULONG_PTR size, struct symt* type) DECLSPEC_HIDDEN; extern BOOL symt_normalize_function(struct module* module, const struct symt_function* func) DECLSPEC_HIDDEN; extern void symt_add_func_line(struct module* module, struct symt_function* func, unsigned source_idx, int line_num, - unsigned long offset) DECLSPEC_HIDDEN; + ULONG_PTR offset) DECLSPEC_HIDDEN; extern struct symt_data* symt_add_func_local(struct module* module, struct symt_function* func, @@ -818,7 +814,7 @@ extern struct symt_thunk* symt_new_thunk(struct module* module, struct symt_compiland* parent, const char* name, THUNK_ORDINAL ord, - unsigned long addr, unsigned long size) DECLSPEC_HIDDEN; + ULONG_PTR addr, ULONG_PTR size) DECLSPEC_HIDDEN; extern struct symt_data* symt_new_constant(struct module* module, struct symt_compiland* parent, @@ -827,7 +823,7 @@ extern struct symt_data* extern struct symt_hierarchy_point* symt_new_label(struct module* module, struct symt_compiland* compiland, - const char* name, unsigned long address) DECLSPEC_HIDDEN; + const char* name, ULONG_PTR address) DECLSPEC_HIDDEN; extern struct symt* symt_index2ptr(struct module* module, DWORD id) DECLSPEC_HIDDEN; extern DWORD symt_ptr2index(struct module* module, const struct symt* sym) DECLSPEC_HIDDEN; @@ -867,7 +863,7 @@ extern BOOL symt_add_function_signature_parameter(struct module* module, extern struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, - unsigned long size) DECLSPEC_HIDDEN; + ULONG_PTR size) DECLSPEC_HIDDEN; extern struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, const char* name) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c index 6d3fb534d98..bf7fb9ce232 100644 --- a/dll/win32/dbghelp/dwarf.c +++ b/dll/win32/dbghelp/dwarf.c @@ -124,15 +124,15 @@ static void dump(const void* ptr, unsigned len) typedef struct dwarf2_abbrev_entry_attr_s { - unsigned long attribute; - unsigned long form; + ULONG_PTR attribute; + ULONG_PTR form; struct dwarf2_abbrev_entry_attr_s* next; } dwarf2_abbrev_entry_attr_t; typedef struct dwarf2_abbrev_entry_s { - unsigned long entry_code; - unsigned long tag; + ULONG_PTR entry_code; + ULONG_PTR tag; unsigned char have_child; unsigned num_attr; dwarf2_abbrev_entry_attr_t* attrs; @@ -146,13 +146,13 @@ struct dwarf2_block struct attribute { - unsigned long form; + ULONG_PTR form; enum {attr_direct, attr_abstract_origin, attr_specification} gotten_from; union { - unsigned long uvalue; + ULONG_PTR uvalue; ULONGLONG lluvalue; - long svalue; + LONG_PTR svalue; const char* string; struct dwarf2_block block; } u; @@ -201,8 +201,8 @@ typedef struct dwarf2_parse_context_s const struct elf_thunk_area*thunks; struct sparse_array abbrev_table; struct sparse_array debug_info_table; - unsigned long load_offset; - unsigned long ref_offset; + ULONG_PTR load_offset; + ULONG_PTR ref_offset; struct symt* symt_cache[sc_num]; /* void, int1, int2, int4 */ char* cpp_name; } dwarf2_parse_context_t; @@ -246,14 +246,14 @@ static unsigned short dwarf2_parse_u2(dwarf2_traverse_context_t* ctx) return uvalue; } -static unsigned long dwarf2_get_u4(const unsigned char* ptr) +static ULONG_PTR dwarf2_get_u4(const unsigned char* ptr) { return *(const UINT32*)ptr; } -static unsigned long dwarf2_parse_u4(dwarf2_traverse_context_t* ctx) +static ULONG_PTR dwarf2_parse_u4(dwarf2_traverse_context_t* ctx) { - unsigned long uvalue = dwarf2_get_u4(ctx->data); + ULONG_PTR uvalue = dwarf2_get_u4(ctx->data); ctx->data += 4; return uvalue; } @@ -270,9 +270,9 @@ static DWORD64 dwarf2_parse_u8(dwarf2_traverse_context_t* ctx) return uvalue; } -static unsigned long dwarf2_get_leb128_as_unsigned(const unsigned char* ptr, const unsigned char** end) +static ULONG_PTR dwarf2_get_leb128_as_unsigned(const unsigned char* ptr, const unsigned char** end) { - unsigned long ret = 0; + ULONG_PTR ret = 0; unsigned char byte; unsigned shift = 0; @@ -287,9 +287,9 @@ static unsigned long dwarf2_get_leb128_as_unsigned(const unsigned char* ptr, con return ret; } -static unsigned long dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx) +static ULONG_PTR dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx) { - unsigned long ret; + ULONG_PTR ret; assert(ctx); @@ -298,9 +298,9 @@ static unsigned long dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx) return ret; } -static long dwarf2_get_leb128_as_signed(const unsigned char* ptr, const unsigned char** end) +static LONG_PTR dwarf2_get_leb128_as_signed(const unsigned char* ptr, const unsigned char** end) { - long ret = 0; + LONG_PTR ret = 0; unsigned char byte; unsigned shift = 0; const unsigned size = sizeof(int) * 8; @@ -323,9 +323,9 @@ static long dwarf2_get_leb128_as_signed(const unsigned char* ptr, const unsigned return ret; } -static long dwarf2_leb128_as_signed(dwarf2_traverse_context_t* ctx) +static LONG_PTR dwarf2_leb128_as_signed(dwarf2_traverse_context_t* ctx) { - long ret = 0; + LONG_PTR ret = 0; assert(ctx); @@ -347,9 +347,9 @@ static unsigned dwarf2_leb128_length(const dwarf2_traverse_context_t* ctx) * We assume that in all cases word size from Dwarf matches the size of * addresses in platform where the exec is compiled. */ -static unsigned long dwarf2_get_addr(const unsigned char* ptr, unsigned word_size) +static ULONG_PTR dwarf2_get_addr(const unsigned char* ptr, unsigned word_size) { - unsigned long ret; + ULONG_PTR ret; switch (word_size) { @@ -366,9 +366,9 @@ static unsigned long dwarf2_get_addr(const unsigned char* ptr, unsigned word_siz return ret; } -static unsigned long dwarf2_parse_addr(dwarf2_traverse_context_t* ctx) +static ULONG_PTR dwarf2_parse_addr(dwarf2_traverse_context_t* ctx) { - unsigned long ret = dwarf2_get_addr(ctx->data, ctx->word_size); + ULONG_PTR ret = dwarf2_get_addr(ctx->data, ctx->word_size); ctx->data += ctx->word_size; return ret; } @@ -392,7 +392,7 @@ static const char* dwarf2_debug_di(const dwarf2_debug_info_t* di) static dwarf2_abbrev_entry_t* dwarf2_abbrev_table_find_entry(const struct sparse_array* abbrev_table, - unsigned long entry_code) + ULONG_PTR entry_code) { assert( NULL != abbrev_table ); return sparse_array_find(abbrev_table, entry_code); @@ -402,12 +402,12 @@ static void dwarf2_parse_abbrev_set(dwarf2_traverse_context_t* abbrev_ctx, struct sparse_array* abbrev_table, struct pool* pool) { - unsigned long entry_code; + ULONG_PTR entry_code; dwarf2_abbrev_entry_t* abbrev_entry; dwarf2_abbrev_entry_attr_t* new = NULL; dwarf2_abbrev_entry_attr_t* last = NULL; - unsigned long attribute; - unsigned long form; + ULONG_PTR attribute; + ULONG_PTR form; assert( NULL != abbrev_ctx ); @@ -580,7 +580,7 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx, case DW_FORM_strp: { - unsigned long offset = dwarf2_get_u4(data); + ULONG_PTR offset = dwarf2_get_u4(data); attr->u.string = (const char*)ctx->sections[section_string].address + offset; } TRACE("strp<%s>\n", debugstr_a(attr->u.string)); @@ -895,7 +895,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, const dwarf2_debug_info_t* di, - unsigned long dw, + ULONG_PTR dw, struct location* loc, const struct location* frame) { @@ -948,11 +948,7 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, sizeof(unsigned) + xloc.u.block.size); *ptr = xloc.u.block.size; memcpy(ptr + 1, xloc.u.block.ptr, xloc.u.block.size); -#ifndef __REACTOS__ - loc->offset = (unsigned long)ptr; -#else - loc->offset = (uintptr_t)ptr; -#endif + loc->offset = (ULONG_PTR)ptr; compute_location(&lctx, loc, NULL, frame); } } @@ -1040,14 +1036,14 @@ static const char* dwarf2_get_cpp_name(dwarf2_parse_context_t* ctx, dwarf2_debug * in all cases, range is relative to beginning of compilation unit */ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_info_t* di, - unsigned long* plow, unsigned long* phigh) + ULONG_PTR* plow, ULONG_PTR* phigh) { struct attribute range; if (dwarf2_find_attribute(ctx, di, DW_AT_ranges, &range)) { dwarf2_traverse_context_t traverse; - unsigned long low, high; + ULONG_PTR low, high; traverse.data = ctx->sections[section_ranges].address + range.u.uvalue; traverse.end_data = ctx->sections[section_ranges].address + @@ -1095,8 +1091,8 @@ static BOOL dwarf2_read_one_debug_info(dwarf2_parse_context_t* ctx, dwarf2_debug_info_t** pdi) { const dwarf2_abbrev_entry_t*abbrev; - unsigned long entry_code; - unsigned long offset; + ULONG_PTR entry_code; + ULONG_PTR offset; dwarf2_debug_info_t* di; dwarf2_debug_info_t* child; dwarf2_debug_info_t** where; @@ -1439,7 +1435,7 @@ static void dwarf2_parse_udt_member(dwarf2_parse_context_t* ctx, { DWORD64 size; nbytes.u.uvalue = symt_get_info(ctx->module, elt_type, TI_GET_LENGTH, &size) ? - (unsigned long)size : 0; + (ULONG_PTR)size : 0; } bit_offset.u.uvalue = nbytes.u.uvalue * 8 - bit_offset.u.uvalue - bit_size.u.uvalue; } @@ -1771,7 +1767,7 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, dwarf2_debug_info_t* di) { struct symt_block* block; - unsigned long low_pc, high_pc; + ULONG_PTR low_pc, high_pc; struct vector* children; dwarf2_debug_info_t*child; unsigned int i; @@ -1825,7 +1821,7 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, dwarf2_debug_info_t* di) { struct symt_block* block; - unsigned long low_pc, high_pc; + ULONG_PTR low_pc, high_pc; struct vector* children; dwarf2_debug_info_t*child; unsigned int i; @@ -1906,7 +1902,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx, dwarf2_debug_info_t* di) { struct attribute name; - unsigned long low_pc, high_pc; + ULONG_PTR low_pc, high_pc; struct attribute is_decl; struct attribute inline_flags; struct symt* ret_type; @@ -2176,7 +2172,7 @@ static void dwarf2_load_one_entry(dwarf2_parse_context_t* ctx, } } -static void dwarf2_set_line_number(struct module* module, unsigned long address, +static void dwarf2_set_line_number(struct module* module, ULONG_PTR address, const struct vector* v, unsigned file, unsigned line) { struct symt_function* func; @@ -2196,10 +2192,10 @@ static void dwarf2_set_line_number(struct module* module, unsigned long address, static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, dwarf2_parse_context_t* ctx, const char* compile_dir, - unsigned long offset) + ULONG_PTR offset) { dwarf2_traverse_context_t traverse; - unsigned long length; + ULONG_PTR length; unsigned insn_size, default_stmt; unsigned line_range, opcode_base; int line_base; @@ -2289,7 +2285,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections, while (traverse.data < traverse.end_data) { - unsigned long address = 0; + ULONG_PTR address = 0; unsigned file = 1; unsigned line = 1; unsigned is_stmt = default_stmt; @@ -2387,16 +2383,16 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, struct module* module, const struct elf_thunk_area* thunks, dwarf2_traverse_context_t* mod_ctx, - unsigned long load_offset) + ULONG_PTR load_offset) { dwarf2_parse_context_t ctx; dwarf2_traverse_context_t abbrev_ctx; dwarf2_debug_info_t* di; dwarf2_traverse_context_t cu_ctx; const unsigned char* comp_unit_start = mod_ctx->data; - unsigned long cu_length; + ULONG_PTR cu_length; unsigned short cu_version; - unsigned long cu_abbrev_offset; + ULONG_PTR cu_abbrev_offset; BOOL ret = FALSE; cu_length = dwarf2_parse_u4(mod_ctx); @@ -2493,7 +2489,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections, } static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE* start, - unsigned long ip, dwarf2_traverse_context_t* lctx) + ULONG_PTR ip, dwarf2_traverse_context_t* lctx) { DWORD_PTR beg, end; const BYTE* ptr = start; @@ -2727,7 +2723,7 @@ static BOOL parse_cie_details(dwarf2_traverse_context_t* ctx, struct frame_info* return TRUE; } -static BOOL dwarf2_get_cie(unsigned long addr, struct module* module, DWORD_PTR delta, +static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delta, dwarf2_traverse_context_t* fde_ctx, dwarf2_traverse_context_t* cie_ctx, struct frame_info* info, BOOL in_eh_frame) { @@ -2735,7 +2731,7 @@ static BOOL dwarf2_get_cie(unsigned long addr, struct module* module, DWORD_PTR const unsigned char* cie_ptr; const unsigned char* last_cie_ptr = (const unsigned char*)~0; unsigned len, id; - unsigned long start, range; + ULONG_PTR start, range; unsigned cie_id; const BYTE* start_data = fde_ctx->data; @@ -3528,7 +3524,7 @@ static void dwarf2_module_remove(struct process* pcs, struct module_format* modf HeapFree(GetProcessHeap(), 0, modfmt); } -BOOL dwarf2_parse(struct module* module, unsigned long load_offset, +BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset, const struct elf_thunk_area* thunks, struct image_file_map* fmap) { diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 50ad89f53f7..01759cd18ee 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -116,13 +116,13 @@ struct elf_thunk_area { const char* symname; THUNK_ORDINAL ordinal; - unsigned long rva_start; - unsigned long rva_end; + ULONG_PTR rva_start; + ULONG_PTR rva_end; }; struct elf_module_info { - unsigned long elf_addr; + ULONG_PTR elf_addr; unsigned short elf_mark : 1, elf_loader : 1; struct image_file_map file_map; @@ -355,7 +355,7 @@ static BOOL elf_map_file_read(struct image_file_map* fmap, struct elf_map_file_d return ReadFile(fmap->u.elf.handle, buf, len, &bytes_read, NULL); case from_process: return ReadProcessMemory(emfd->u.process.handle, - (void*)((unsigned long)emfd->u.process.load_addr + (unsigned long)off), + (void*)((ULONG_PTR)emfd->u.process.load_addr + (ULONG_PTR)off), buf, len, &dw) && dw == len; default: assert(0); @@ -559,7 +559,7 @@ static void elf_module_remove(struct process* pcs, struct module_format* modfmt) * Check whether an address lies within one of the thunk area we * know of. */ -int elf_is_in_thunk_area(unsigned long addr, +int elf_is_in_thunk_area(ULONG_PTR addr, const struct elf_thunk_area* thunks) { unsigned i; @@ -1085,8 +1085,8 @@ static BOOL elf_fetch_file_info(struct process* process, const WCHAR* name, ULON } static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, - struct image_file_map* fmap, unsigned long load_offset, - unsigned long dyn_addr, struct elf_info* elf_info) + struct image_file_map* fmap, ULONG_PTR load_offset, + ULONG_PTR dyn_addr, struct elf_info* elf_info) { BOOL ret = FALSE; @@ -1097,7 +1097,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism)) { char* ptr = (char*)(ULONG_PTR)fmap->u.elf.sect[ism.sidx].shdr.sh_addr; - unsigned long len; + ULONG_PTR len; if (load_offset) ptr += load_offset - fmap->u.elf.elf_start; @@ -1154,14 +1154,14 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, struct elf_module_info *elf_module_info; struct module_format* modfmt; struct image_section_map ism; - unsigned long modbase = load_offset; + ULONG_PTR modbase = load_offset; if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism)) { - unsigned long rva_dyn = elf_get_map_rva(&ism); + ULONG_PTR rva_dyn = elf_get_map_rva(&ism); TRACE("For module %s, got ELF (start=%lx dyn=%lx), link_map (start=%lx dyn=%lx)\n", - debugstr_w(filename), (unsigned long)fmap->u.elf.elf_start, rva_dyn, + debugstr_w(filename), (ULONG_PTR)fmap->u.elf.elf_start, rva_dyn, load_offset, dyn_addr); if (dyn_addr && load_offset + rva_dyn != dyn_addr) { @@ -1231,7 +1231,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, * 1 on success */ static BOOL elf_load_file(struct process* pcs, const WCHAR* filename, - unsigned long load_offset, unsigned long dyn_addr, + ULONG_PTR load_offset, ULONG_PTR dyn_addr, struct elf_info* elf_info) { BOOL ret = FALSE; @@ -1279,7 +1279,7 @@ static BOOL elf_load_file_cb(void *param, HANDLE handle, const WCHAR *filename) * * locate some a value from the debuggee auxiliary vector */ -static BOOL elf_search_auxv(const struct process* pcs, unsigned type, unsigned long* val) +static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR* val) { char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; SYMBOL_INFO*si = (SYMBOL_INFO*)buffer; @@ -1350,7 +1350,7 @@ static BOOL elf_search_auxv(const struct process* pcs, unsigned type, unsigned l * lookup a file in standard ELF locations, and if found, load it */ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, - unsigned long load_offset, unsigned long dyn_addr, + ULONG_PTR load_offset, ULONG_PTR dyn_addr, struct elf_info* elf_info) { BOOL ret = FALSE; @@ -1384,8 +1384,8 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, return ret; } -typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, unsigned long load_addr, - unsigned long dyn_addr, BOOL is_system, void* user); +typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, ULONG_PTR load_addr, + ULONG_PTR dyn_addr, BOOL is_system, void* user); /****************************************************************** * elf_enum_modules_internal @@ -1427,7 +1427,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, bufstr[sizeof(bufstr) - 1] = '\0'; 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)) + if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) break; } } @@ -1461,7 +1461,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, bufstr[sizeof(bufstr) - 1] = '\0'; 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)) + if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) break; } } @@ -1470,7 +1470,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, #ifdef AT_SYSINFO_EHDR if (!lm_addr) { - unsigned long ehdr_addr; + ULONG_PTR ehdr_addr; if (elf_search_auxv(pcs, AT_SYSINFO_EHDR, &ehdr_addr)) { @@ -1488,8 +1488,8 @@ struct elf_enum_user void* user; }; -static BOOL elf_enum_modules_translate(const WCHAR* name, unsigned long load_addr, - unsigned long dyn_addr, BOOL is_system, void* user) +static BOOL elf_enum_modules_translate(const WCHAR* name, ULONG_PTR load_addr, + ULONG_PTR dyn_addr, BOOL is_system, void* user) { struct elf_enum_user* eeu = user; return eeu->cb(name, load_addr, eeu->user); @@ -1531,8 +1531,8 @@ struct elf_load * Callback for elf_load_module, used to walk the list of loaded * modules. */ -static BOOL elf_load_cb(const WCHAR* name, unsigned long load_addr, - unsigned long dyn_addr, BOOL is_system, void* user) +static BOOL elf_load_cb(const WCHAR* name, ULONG_PTR load_addr, + ULONG_PTR dyn_addr, BOOL is_system, void* user) { struct elf_load* el = user; BOOL ret = TRUE; @@ -1583,7 +1583,7 @@ static BOOL elf_load_cb(const WCHAR* name, unsigned long load_addr, * Also, find module real name and load address from * the real loaded modules list in pcs address space */ -static struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +static struct module* elf_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr) { struct elf_load el; @@ -1707,7 +1707,7 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) return FALSE; } -int elf_is_in_thunk_area(unsigned long addr, +int elf_is_in_thunk_area(ULONG_PTR addr, const struct elf_thunk_area* thunks) { return -1; diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 253f1252101..e07dea4d267 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -136,7 +136,7 @@ struct image_file_map struct image_section_map { struct image_file_map* fmap; - long sidx; + LONG_PTR sidx; }; BOOL image_check_alternate(struct image_file_map* fmap, const struct module* module) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 43a98c9c726..d10e402de27 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -118,7 +118,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho); struct macho_module_info { struct image_file_map file_map; - unsigned long load_addr; + ULONG_PTR load_addr; unsigned short in_use : 1, is_loader : 1; }; @@ -157,12 +157,12 @@ static char* format_uuid(const uint8_t uuid[16], char out[UUID_STRING_LEN]) * that encompasses it. For a fat binary, the architecture will * itself be offset within the file, so take that into account. */ -static void macho_calc_range(const struct macho_file_map* fmap, unsigned long offset, - unsigned long len, unsigned long* out_aligned_offset, - unsigned long* out_aligned_end, unsigned long* out_misalign) +static void macho_calc_range(const struct macho_file_map* fmap, ULONG_PTR offset, + ULONG_PTR len, ULONG_PTR* out_aligned_offset, + ULONG_PTR* out_aligned_end, ULONG_PTR* out_misalign) { - unsigned long pagemask; - unsigned long file_offset, misalign; + ULONG_PTR pagemask; + ULONG_PTR file_offset, misalign; pagemask = sysinfo.dwAllocationGranularity - 1; file_offset = fmap->arch_offset + offset; @@ -178,10 +178,10 @@ static void macho_calc_range(const struct macho_file_map* fmap, unsigned long of * * Maps a range (offset, length in bytes) from a Mach-O file into memory */ -static const char* macho_map_range(const struct macho_file_map* fmap, unsigned long offset, unsigned long len, +static const char* macho_map_range(const struct macho_file_map* fmap, ULONG_PTR offset, ULONG_PTR len, const char** base) { - unsigned long misalign, aligned_offset, aligned_map_end; + ULONG_PTR misalign, aligned_offset, aligned_map_end; const void* aligned_ptr; HANDLE mapping; @@ -215,13 +215,13 @@ static const char* macho_map_range(const struct macho_file_map* fmap, unsigned l * Unmaps a range (offset, length in bytes) of a Mach-O file from memory */ static void macho_unmap_range(const char** base, const void** mapped, const struct macho_file_map* fmap, - unsigned long offset, unsigned long len) + ULONG_PTR offset, ULONG_PTR len) { TRACE("(%p, %p, %p/%p, 0x%08lx, 0x%08lx)\n", base, mapped, fmap, fmap->handle, offset, len); if ((mapped && *mapped != IMAGE_NO_MAP) || (base && *base != IMAGE_NO_MAP)) { - unsigned long misalign, aligned_offset, aligned_map_end; + ULONG_PTR misalign, aligned_offset, aligned_map_end; void* aligned_ptr; macho_calc_range(fmap, offset, len, &aligned_offset, &aligned_map_end, &misalign); @@ -247,12 +247,12 @@ static void macho_unmap_range(const char** base, const void** mapped, const stru * the munmap doesn't fragment the mapping. */ static BOOL macho_map_ranges(const struct macho_file_map* fmap, - unsigned long offset1, unsigned long len1, - unsigned long offset2, unsigned long len2, + ULONG_PTR offset1, ULONG_PTR len1, + ULONG_PTR offset2, ULONG_PTR len2, const void** mapped1, const void** mapped2) { - unsigned long aligned_offset1, aligned_map_end1; - unsigned long aligned_offset2, aligned_map_end2; + ULONG_PTR aligned_offset1, aligned_map_end1; + ULONG_PTR aligned_offset2, aligned_map_end2; TRACE("(%p/%p, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p, %p)\n", fmap, fmap->handle, offset1, len1, offset2, len2, mapped1, mapped2); @@ -299,12 +299,12 @@ static BOOL macho_map_ranges(const struct macho_file_map* fmap, * macho_map_ranges. */ static void macho_unmap_ranges(const struct macho_file_map* fmap, - unsigned long offset1, unsigned long len1, - unsigned long offset2, unsigned long len2, + ULONG_PTR offset1, ULONG_PTR len1, + ULONG_PTR offset2, ULONG_PTR len2, const void** mapped1, const void** mapped2) { - unsigned long aligned_offset1, aligned_map_end1; - unsigned long aligned_offset2, aligned_map_end2; + ULONG_PTR aligned_offset1, aligned_map_end1; + ULONG_PTR aligned_offset2, aligned_map_end2; TRACE("(%p/%p, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p/%p, %p/%p)\n", fmap, fmap->handle, offset1, len1, offset2, len2, mapped1, *mapped1, mapped2, *mapped2); @@ -566,7 +566,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load struct section_info* info = user; BOOL ignore; int i; - unsigned long tmp, page_mask = sysinfo.dwPageSize - 1; + ULONG_PTR tmp, page_mask = sysinfo.dwPageSize - 1; uint64_t vmaddr, vmsize; char segname[16]; uint32_t nsects; @@ -592,9 +592,9 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load } TRACE("(%p/%p, %p, %p) before: 0x%08lx - 0x%08lx\n", fmap, fmap->handle, lc, user, - (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size); - TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (unsigned long)vmaddr, - (unsigned long)(vmaddr + vmsize)); + (ULONG_PTR)fmap->segs_start, (ULONG_PTR)fmap->segs_size); + TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (ULONG_PTR)vmaddr, + (ULONG_PTR)(vmaddr + vmsize)); /* Images in the dyld shared cache have their segments mapped non-contiguously. We don't know how to properly locate any of the segments other than __TEXT, @@ -617,7 +617,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load tmp = (vmaddr + vmsize + page_mask) & ~page_mask; if (fmap->segs_size < tmp) fmap->segs_size = tmp; - TRACE("after: 0x%08lx - 0x%08lx\n", (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size); + TRACE("after: 0x%08lx - 0x%08lx\n", (ULONG_PTR)fmap->segs_start, (ULONG_PTR)fmap->segs_size); } for (i = 0; i < nsects; i++) @@ -787,8 +787,8 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, } fmap->segs_size -= fmap->segs_start; - TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (unsigned long)fmap->segs_start, - (unsigned long)fmap->segs_size); + TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (ULONG_PTR)fmap->segs_start, + (ULONG_PTR)fmap->segs_size); if (macho_enum_load_commands(ifm, LC_UUID, find_uuid, NULL) < 0) goto done; @@ -873,7 +873,7 @@ struct symtab_elt { struct hash_table_elt ht_elt; struct symt_compiland* compiland; - unsigned long addr; + ULONG_PTR addr; unsigned char is_code:1, is_public:1, is_global:1, @@ -893,8 +893,8 @@ struct macho_debug_info * * Callback for stabs_parse. Collect symbol definitions. */ -static void macho_stabs_def_cb(struct module* module, unsigned long load_offset, - const char* name, unsigned long offset, +static void macho_stabs_def_cb(struct module* module, ULONG_PTR load_offset, + const char* name, ULONG_PTR offset, BOOL is_public, BOOL is_global, unsigned char sectidx, struct symt_compiland* compiland, void* user) { @@ -1253,7 +1253,7 @@ found: * The image header has to be loaded from the process's memory * because the relevant flag is only set in memory, not in the file. */ -static BOOL image_uses_split_segs(struct process* process, unsigned long load_addr) +static BOOL image_uses_split_segs(struct process* process, ULONG_PTR load_addr) { BOOL split_segs = FALSE; @@ -1412,7 +1412,7 @@ static ULONG_PTR get_dyld_image_info_address(struct process* pcs) * TRUE on success */ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, - unsigned long load_addr, struct macho_info* macho_info) + ULONG_PTR load_addr, struct macho_info* macho_info) { BOOL ret = TRUE; BOOL split_segs; @@ -1500,7 +1500,7 @@ static BOOL macho_load_file_cb(void *param, HANDLE handle, const WCHAR *filename * Lookup a file in standard Mach-O locations, and if found, load it */ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filename, - unsigned long load_addr, + ULONG_PTR load_addr, struct macho_info* macho_info) { BOOL ret = FALSE; @@ -1564,7 +1564,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs, { union wine_all_image_infos image_infos; union wine_image_info* info_array = NULL; - unsigned long len; + ULONG_PTR len; int i; char bufstr[256]; WCHAR bufstrW[MAX_PATH]; @@ -1637,7 +1637,7 @@ struct macho_sync struct macho_info macho_info; }; -static BOOL macho_enum_sync_cb(const WCHAR* name, unsigned long addr, void* user) +static BOOL macho_enum_sync_cb(const WCHAR* name, ULONG_PTR addr, void* user) { struct macho_sync* ms = user; @@ -1721,7 +1721,7 @@ struct macho_load * Callback for macho_load_module, used to walk the list of loaded * modules. */ -static BOOL macho_load_cb(const WCHAR* name, unsigned long addr, void* user) +static BOOL macho_load_cb(const WCHAR* name, ULONG_PTR addr, void* user) { struct macho_load* ml = user; const WCHAR* p; @@ -1747,7 +1747,7 @@ static BOOL macho_load_cb(const WCHAR* name, unsigned long addr, void* user) * Also, find module real name and load address from * the real loaded modules list in pcs address space. */ -static struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +static struct module* macho_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr) { struct macho_load ml; diff --git a/dll/win32/dbghelp/minidump.c b/dll/win32/dbghelp/minidump.c index 4730dedec94..f8b4015c23c 100644 --- a/dll/win32/dbghelp/minidump.c +++ b/dll/win32/dbghelp/minidump.c @@ -255,7 +255,7 @@ static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size * * Callback for accumulating in dump_context an host modules set */ -static BOOL fetch_host_module_info_cb(const WCHAR* name, unsigned long base, +static BOOL fetch_host_module_info_cb(const WCHAR* name, ULONG_PTR base, void* user) { struct dump_context* dc = user; diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index e4cd98b224a..80a484e94ae 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -197,7 +197,7 @@ static const char* get_module_type(enum module_type type, BOOL virtual) struct module* module_new(struct process* pcs, const WCHAR* name, enum module_type type, BOOL virtual, DWORD64 mod_addr, DWORD64 size, - unsigned long stamp, unsigned long checksum) + ULONG_PTR stamp, ULONG_PTR checksum) { struct module* module; unsigned i; @@ -1380,7 +1380,7 @@ static BOOL native_synchronize_module_list(struct process* pcs) return FALSE; } -static struct module* native_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +static struct module* native_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr) { return NULL; } diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 6696fa02e4e..82fc44965ac 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -1393,7 +1393,7 @@ static BOOL codeview_parse_type_table(struct codeview_type_parse* ctp) /*======================================================================== * Process CodeView line number information. */ -static unsigned long codeview_get_address(const struct msc_debug_info* msc_dbg, +static ULONG_PTR codeview_get_address(const struct msc_debug_info* msc_dbg, unsigned seg, unsigned offset); static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const BYTE* linetab, @@ -1408,7 +1408,7 @@ static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const B const unsigned short* linenos; const struct startend* start; unsigned source; - unsigned long addr, func_addr0; + ULONG_PTR addr, func_addr0; struct symt_function* func; const struct codeview_linetab_block* ltb; @@ -1555,7 +1555,7 @@ static unsigned int codeview_map_offset(const struct msc_debug_info* msc_dbg, return 0; } -static unsigned long codeview_get_address(const struct msc_debug_info* msc_dbg, +static ULONG_PTR codeview_get_address(const struct msc_debug_info* msc_dbg, unsigned seg, unsigned offset) { int nsect = msc_dbg->nsect; diff --git a/dll/win32/dbghelp/stabs.c b/dll/win32/dbghelp/stabs.c index 09e451c7d2f..07f5142893f 100644 --- a/dll/win32/dbghelp/stabs.c +++ b/dll/win32/dbghelp/stabs.c @@ -161,7 +161,7 @@ static void stab_strcpy(char* dest, int sz, const char* source) typedef struct { char* name; - unsigned long value; + ULONG_PTR value; struct symt** vector; int nrofentries; } include_def; @@ -177,7 +177,7 @@ static struct symt** cu_vector = NULL; static int cu_nrofentries = 0; static struct symt_basic* stabs_basic[36]; -static int stabs_new_include(const char* file, unsigned long val) +static int stabs_new_include(const char* file, ULONG_PTR val) { if (num_include_def == num_alloc_include_def) { @@ -202,7 +202,7 @@ static int stabs_new_include(const char* file, unsigned long val) return num_include_def++; } -static int stabs_find_include(const char* file, unsigned long val) +static int stabs_find_include(const char* file, ULONG_PTR val) { int i; @@ -256,7 +256,7 @@ static void stabs_free_includes(void) cu_nrofentries = 0; } -static struct symt** stabs_find_ref(long filenr, long subnr) +static struct symt** stabs_find_ref(LONG_PTR filenr, LONG_PTR subnr) { struct symt** ret; @@ -302,7 +302,7 @@ static struct symt** stabs_find_ref(long filenr, long subnr) static struct symt** stabs_read_type_enum(const char** x) { - long filenr, subnr; + LONG_PTR filenr, subnr; const char* iter; char* end; @@ -426,7 +426,7 @@ static int stabs_pts_read_id(struct ParseTypedefData* ptd) return -1; } -static int stabs_pts_read_number(struct ParseTypedefData* ptd, long* v) +static int stabs_pts_read_number(struct ParseTypedefData* ptd, LONG_PTR* v) { char* last; @@ -437,7 +437,7 @@ static int stabs_pts_read_number(struct ParseTypedefData* ptd, long* v) } static int stabs_pts_read_type_reference(struct ParseTypedefData* ptd, - long* filenr, long* subnr) + LONG_PTR* filenr, LONG_PTR* subnr) { if (*ptd->ptr == '(') { @@ -612,7 +612,7 @@ static inline int stabs_pts_read_method_info(struct ParseTypedefData* ptd) ptd->ptr++; if (mthd == '*') { - long int ofs; + LONG_PTR ofs; PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &ofs) == -1); PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); @@ -628,7 +628,7 @@ static inline int stabs_pts_read_method_info(struct ParseTypedefData* ptd) static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, struct symt_udt* sdt) { - long sz, ofs; + LONG_PTR sz, ofs; struct symt* adt; struct symt* dt = NULL; int idx; @@ -639,7 +639,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, doadd = symt_set_udt_size(ptd->module, sdt, sz); if (*ptd->ptr == '!') /* C++ inheritance */ { - long num_classes; + LONG_PTR num_classes; ptd->ptr++; PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &num_classes) == -1); @@ -686,7 +686,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, if (ptd->ptr[0] == '$' && ptd->ptr[1] == 'v') { - long x; + LONG_PTR x; if (ptd->ptr[2] == 'f') { @@ -770,7 +770,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, struct symt_enum* edt) { - long value; + LONG_PTR value; int idx; while (*ptd->ptr != ';') @@ -789,7 +789,7 @@ static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, static inline int stabs_pts_read_array(struct ParseTypedefData* ptd, struct symt** adt) { - long lo, hi; + LONG_PTR lo, hi; struct symt* range_dt; struct symt* base_dt; @@ -814,10 +814,10 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ struct symt** ret_dt) { int idx; - long sz = -1; + LONG_PTR sz = -1; struct symt* new_dt = NULL; /* newly created data type */ struct symt* ref_dt; /* referenced data type (pointer...) */ - long filenr1, subnr1, tmp; + LONG_PTR filenr1, subnr1, tmp; /* things are a bit complicated because of the way the typedefs are stored inside * the file, because addresses can change when realloc is done, so we must call @@ -978,8 +978,8 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ break; case 'R': { - long type, len, unk; - int basic; + LONG_PTR type, len, unk; + int basic; PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &type) == -1); PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); /* ';' */ @@ -1130,8 +1130,8 @@ struct pending_line { int source_idx; int line_num; - unsigned long offset; - unsigned long load_offset; + ULONG_PTR offset; + ULONG_PTR load_offset; }; struct pending_object @@ -1183,8 +1183,8 @@ static inline void pending_add_var(struct pending_list* pending, const char* nam } static inline void pending_add_line(struct pending_list* pending, int source_idx, - int line_num, unsigned long offset, - unsigned long load_offset) + int line_num, ULONG_PTR offset, + ULONG_PTR load_offset) { pending_make_room(pending); pending->objs[pending->num].tag = PENDING_LINE; @@ -1233,7 +1233,7 @@ static void pending_flush(struct pending_list* pending, struct module* module, * function (assuming that current function ends where next function starts) */ static void stabs_finalize_function(struct module* module, struct symt_function* func, - unsigned long size) + ULONG_PTR size) { IMAGEHLP_LINE64 il; struct location loc; @@ -1269,7 +1269,7 @@ static inline void stabbuf_append(char **buf, unsigned *buf_size, const char *st strcpy(*buf+buf_len, str); } -BOOL stabs_parse(struct module* module, unsigned long load_offset, +BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, const char* pv_stab_ptr, int stablen, const char* strs, int strtablen, stabs_def_cb callback, void* user) @@ -1486,7 +1486,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, case 35: case 36: loc.reg = CV_REG_MM0 + n_value - 29; break; default: - FIXME("Unknown register value (%lu)\n", (unsigned long)n_value); + FIXME("Unknown register value (%lu)\n", (ULONG_PTR)n_value); loc.reg = CV_REG_NONE; break; } @@ -1520,7 +1520,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, assert(source_idx >= 0); if (curr_func != NULL) { - unsigned long offset = n_value; + ULONG_PTR offset = n_value; if (module->type == DMT_MACHO) offset -= curr_func->address - load_offset; symt_add_func_line(module, curr_func, source_idx, @@ -1636,7 +1636,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, case N_EXCL: if (stabs_add_include(stabs_find_include(ptr, n_value)) < 0) { - ERR("Excluded header not found (%s,%ld)\n", ptr, (unsigned long)n_value); + ERR("Excluded header not found (%s,%ld)\n", ptr, (ULONG_PTR)n_value); module_reset_debug_info(module); ret = FALSE; goto done; @@ -1683,7 +1683,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, } stabbuff[0] = '\0'; TRACE("0x%02x %lx %s\n", - stab_ptr->n_type, (unsigned long)n_value, debugstr_a(strs + stab_ptr->n_strx)); + stab_ptr->n_type, (ULONG_PTR)n_value, debugstr_a(strs + stab_ptr->n_strx)); } module->module.SymType = SymDia; module->module.CVSig = 'S' | ('T' << 8) | ('A' << 16) | ('B' << 24); diff --git a/dll/win32/dbghelp/storage.c b/dll/win32/dbghelp/storage.c index 7750ce64673..dd9d0583233 100644 --- a/dll/win32/dbghelp/storage.c +++ b/dll/win32/dbghelp/storage.c @@ -207,7 +207,7 @@ void* vector_add(struct vector* v, struct pool* pool) */ struct key2index { - unsigned long key; + ULONG_PTR key; unsigned index; }; @@ -223,7 +223,7 @@ void sparse_array_init(struct sparse_array* sa, unsigned elt_sz, unsigned bucket * Returns the first index which key is >= at passed key */ static struct key2index* sparse_array_lookup(const struct sparse_array* sa, - unsigned long key, unsigned* idx) + ULONG_PTR key, unsigned* idx) { struct key2index* pk2i; unsigned low, high; @@ -269,7 +269,7 @@ static struct key2index* sparse_array_lookup(const struct sparse_array* sa, return pk2i; } -void* sparse_array_find(const struct sparse_array* sa, unsigned long key) +void* sparse_array_find(const struct sparse_array* sa, ULONG_PTR key) { unsigned idx; struct key2index* pk2i; @@ -279,7 +279,7 @@ void* sparse_array_find(const struct sparse_array* sa, unsigned long key) return NULL; } -void* sparse_array_add(struct sparse_array* sa, unsigned long key, +void* sparse_array_add(struct sparse_array* sa, ULONG_PTR key, struct pool* pool) { unsigned idx, i; diff --git a/dll/win32/dbghelp/symbol.c b/dll/win32/dbghelp/symbol.c index 037641e0166..60859c6d0f1 100644 --- a/dll/win32/dbghelp/symbol.c +++ b/dll/win32/dbghelp/symbol.c @@ -207,7 +207,7 @@ static WCHAR* file_regex(const char* srcfile) } struct symt_compiland* symt_new_compiland(struct module* module, - unsigned long address, unsigned src_idx) + ULONG_PTR address, unsigned src_idx) { struct symt_compiland* sym; @@ -227,7 +227,7 @@ struct symt_public* symt_new_public(struct module* module, struct symt_compiland* compiland, const char* name, BOOL is_function, - unsigned long address, unsigned size) + ULONG_PTR address, unsigned size) { struct symt_public* sym; struct symt** p; @@ -258,7 +258,7 @@ struct symt_public* symt_new_public(struct module* module, struct symt_data* symt_new_global_variable(struct module* module, struct symt_compiland* compiland, const char* name, unsigned is_static, - struct location loc, unsigned long size, + struct location loc, ULONG_PTR size, struct symt* type) { struct symt_data* sym; @@ -295,7 +295,7 @@ struct symt_data* symt_new_global_variable(struct module* module, struct symt_function* symt_new_function(struct module* module, struct symt_compiland* compiland, const char* name, - unsigned long addr, unsigned long size, + ULONG_PTR addr, ULONG_PTR size, struct symt* sig_type) { struct symt_function* sym; @@ -326,7 +326,7 @@ struct symt_function* symt_new_function(struct module* module, } void symt_add_func_line(struct module* module, struct symt_function* func, - unsigned source_idx, int line_num, unsigned long offset) + unsigned source_idx, int line_num, ULONG_PTR offset) { struct line_info* dli; BOOL last_matches = FALSE; @@ -498,7 +498,7 @@ BOOL symt_normalize_function(struct module* module, const struct symt_function* struct symt_thunk* symt_new_thunk(struct module* module, struct symt_compiland* compiland, const char* name, THUNK_ORDINAL ord, - unsigned long addr, unsigned long size) + ULONG_PTR addr, ULONG_PTR size) { struct symt_thunk* sym; @@ -555,7 +555,7 @@ struct symt_data* symt_new_constant(struct module* module, struct symt_hierarchy_point* symt_new_label(struct module* module, struct symt_compiland* compiland, - const char* name, unsigned long address) + const char* name, ULONG_PTR address) { struct symt_hierarchy_point* sym; @@ -680,8 +680,8 @@ static void symt_fill_sym_info(struct module_pair* pair, switch (data->u.value.n1.n2.vt) { case VT_I4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.lVal; break; - case VT_I2: sym_info->Value = (ULONG)(long)data->u.value.n1.n2.n3.iVal; break; - case VT_I1: sym_info->Value = (ULONG)(long)data->u.value.n1.n2.n3.cVal; break; + case VT_I2: sym_info->Value = (ULONG)(LONG_PTR)data->u.value.n1.n2.n3.iVal; break; + case VT_I1: sym_info->Value = (ULONG)(LONG_PTR)data->u.value.n1.n2.n3.cVal; break; case VT_UI4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.ulVal; break; case VT_UI2: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.uiVal; break; case VT_UI1: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.bVal; break; diff --git a/dll/win32/dbghelp/type.c b/dll/win32/dbghelp/type.c index e069231b282..d020462f6d6 100644 --- a/dll/win32/dbghelp/type.c +++ b/dll/win32/dbghelp/type.c @@ -412,7 +412,7 @@ BOOL symt_add_function_signature_parameter(struct module* module, return TRUE; } -struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, unsigned long size) +struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, ULONG_PTR size) { struct symt_pointer* sym; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 60e8ae6e85e..a144f573d98 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 8d702a3aa54fc61bd146f584e66364a12a0ee3a0 + wine: f803da493aeb4cf118fb9b076e8042c2535fbcdb
4 years, 3 months
1
0
0
0
[reactos] 120/179: [WINESYNC] dbghelp: Remove unused code in module_find_cb.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=31d5e64eb89e6ce8305bc…
commit 31d5e64eb89e6ce8305bc940a3441b26507617fb Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:39:25 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Remove unused code in module_find_cb. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8d702a3aa54fc61bd146f584e66364a12a0ee3a0 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/path.c | 26 +------------------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/dll/win32/dbghelp/path.c b/dll/win32/dbghelp/path.c index 4e7354f93ad..d404e483ae1 100644 --- a/dll/win32/dbghelp/path.c +++ b/dll/win32/dbghelp/path.c @@ -474,7 +474,7 @@ struct module_find static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) { struct module_find* mf = user; - DWORD size, checksum, timestamp; + DWORD size, timestamp; unsigned matched = 0; /* the matching weights: @@ -524,30 +524,6 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) if (timestamp == mf->dw1 && size == mf->dw2) matched++; } break; - case DMT_MACHO: - case DMT_ELF: - { - HANDLE file; - - file = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (file == INVALID_HANDLE_VALUE) break; - - checksum = calc_crc32(file); - if (checksum == mf->dw1) matched += 2; - else - { - struct image_file_map fmap; - WARN("Found %s, but wrong checksums: %08x %08x\n", debugstr_w(buffer), checksum, mf->dw1); - if (elf_map_handle(file, &fmap)) /* FIXME: validate macho files */ - { - image_unmap_file(&fmap); - matched++; - } - } - CloseHandle(file); - } - break; case DMT_PDB: { struct pdb_lookup pdb_lookup; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 323dc44f9fa..60e8ae6e85e 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: e3354e44f17d74f0ac4547d8a4494c83ea3d6d37 + wine: 8d702a3aa54fc61bd146f584e66364a12a0ee3a0
4 years, 3 months
1
0
0
0
[reactos] 119/179: [WINESYNC] dbghelp: Move reading debug base address from PEB to check_live_target.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e0db46fa2eab7e6d5987a…
commit e0db46fa2eab7e6d5987a8e24fa2c003f71da7f2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:29:52 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Move reading debug base address from PEB to check_live_target. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id e3354e44f17d74f0ac4547d8a4494c83ea3d6d37 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/dbghelp.c | 26 ++++++++++++--- dll/win32/dbghelp/dbghelp_private.h | 4 +-- dll/win32/dbghelp/elf_module.c | 55 ++++++------------------------- dll/win32/dbghelp/macho_module.c | 66 +++++++++---------------------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 50 insertions(+), 103 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c index 6e03cc3d385..a5acc786606 100644 --- a/dll/win32/dbghelp/dbghelp.c +++ b/dll/win32/dbghelp/dbghelp.c @@ -284,20 +284,36 @@ static BOOL WINAPI process_invade_cb(PCWSTR name, ULONG64 base, ULONG size, PVOI return TRUE; } +#ifndef DBGHELP_STATIC_LIB /****************************************************************** * check_live_target * */ static BOOL check_live_target(struct process* pcs) { + PROCESS_BASIC_INFORMATION pbi; + ULONG_PTR base = 0; + if (!GetProcessId(pcs->handle)) return FALSE; if (GetEnvironmentVariableA("DBGHELP_NOLIVE", NULL, 0)) return FALSE; -#ifndef DBGHELP_STATIC_LIB - if (!elf_read_wine_loader_dbg_info(pcs)) - macho_read_wine_loader_dbg_info(pcs); -#endif - return TRUE; + + if (NtQueryInformationProcess( pcs->handle, ProcessBasicInformation, + &pbi, sizeof(pbi), NULL )) + return FALSE; + + if (!pcs->is_64bit) + { + PEB32 *peb32 = (PEB32 *)pbi.PebBaseAddress; + DWORD base32 = 0; + ReadProcessMemory(pcs->handle, &peb32->Reserved[0], &base32, sizeof(base32), NULL); + base = base32; + } + else ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &base, sizeof(base), NULL); + + TRACE("got debug info address %#lx from PEB %p\n", base, pbi.PebBaseAddress); + return elf_read_wine_loader_dbg_info(pcs, base) || macho_read_wine_loader_dbg_info(pcs, base); } +#endif /****************************************************************** * SymInitializeW (DBGHELP.@) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index d2f4b27bf90..49cf51fff24 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -635,12 +635,12 @@ extern struct cpu* cpu_find(DWORD) DECLSPEC_HIDDEN; extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN; /* elf_module.c */ -extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; +extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN; struct elf_thunk_area; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ -extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; +extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN; /* minidump.c */ void minidump_add_memory_block(struct dump_context* dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 20c68dc1ab3..50ad89f53f7 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -1661,48 +1661,6 @@ static BOOL elf_synchronize_module_list(struct process* pcs) return TRUE; } -/****************************************************************** - * elf_search_loader - * - * Lookup in a running ELF process the loader, and sets its ELF link - * address (for accessing the list of loaded .so libs) in pcs. - * If flags is ELF_INFO_MODULE, the module for the loader is also - * added as a module into pcs. - */ -static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info) -{ - WCHAR *loader = get_wine_loader_name(pcs); - PROCESS_BASIC_INFORMATION pbi; - ULONG_PTR base = 0; - BOOL ret; - - if (NtQueryInformationProcess( pcs->handle, ProcessBasicInformation, - &pbi, sizeof(pbi), NULL )) - return FALSE; - - if (!pcs->is_64bit) - { - PEB32 *peb32 = (PEB32 *)pbi.PebBaseAddress; - DWORD base32; - - if (!ReadProcessMemory( pcs->handle, &peb32->Reserved[0], &base32, - sizeof(base32), NULL )) - return FALSE; - - base = base32; - } - else - { - if (!ReadProcessMemory( pcs->handle, &pbi.PebBaseAddress->Reserved[0], - &base, sizeof(base), NULL )) - return FALSE; - } - - ret = elf_search_and_load_file(pcs, loader, base, 0, elf_info); - heap_free(loader); - return ret; -} - static const struct loader_ops elf_loader_ops = { elf_synchronize_module_list, @@ -1717,12 +1675,19 @@ static const struct loader_ops elf_loader_ops = * * Try to find a decent wine executable which could have loaded the debuggee */ -BOOL elf_read_wine_loader_dbg_info(struct process* pcs) +BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) { struct elf_info elf_info; + WCHAR *loader; + BOOL ret; elf_info.flags = ELF_INFO_DEBUG_HEADER | ELF_INFO_MODULE; - if (!elf_search_loader(pcs, &elf_info) || !elf_info.dbg_hdr_addr) return FALSE; + loader = get_wine_loader_name(pcs); + ret = elf_search_and_load_file(pcs, loader, addr, 0, &elf_info); + heap_free(loader); + if (!ret || !elf_info.dbg_hdr_addr) return FALSE; + + TRACE("Found ELF debug header %#lx\n", elf_info.dbg_hdr_addr); elf_info.module->format_info[DFI_ELF]->u.elf_info->elf_loader = 1; module_set_module(elf_info.module, S_WineLoaderW); pcs->dbg_hdr_addr = elf_info.dbg_hdr_addr; @@ -1737,7 +1702,7 @@ BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap) return FALSE; } -BOOL elf_read_wine_loader_dbg_info(struct process* pcs) +BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) { return FALSE; } diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 8e2fa796e03..43a98c9c726 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -129,14 +129,12 @@ struct section_info unsigned int section_index; }; -#define MACHO_INFO_DEBUG_HEADER 0x0001 -#define MACHO_INFO_MODULE 0x0002 -#define MACHO_INFO_NAME 0x0004 +#define MACHO_INFO_MODULE 0x0001 +#define MACHO_INFO_NAME 0x0002 struct macho_info { unsigned flags; /* IN one (or several) of the MACHO_INFO constants */ - unsigned long dbg_hdr_addr; /* OUT address of debug header (if MACHO_INFO_DEBUG_HEADER is set) */ struct module* module; /* OUT loaded module (if MACHO_INFO_MODULE is set) */ const WCHAR* module_name; /* OUT found module name (if MACHO_INFO_NAME is set) */ }; @@ -1373,32 +1371,7 @@ static void macho_module_remove(struct process* pcs, struct module_format* modfm */ 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 (pcs->is_64bit) - ret = ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], - &dyld_image_info_address, sizeof(dyld_image_info_address), NULL); - else - { - 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 */ if (!dyld_image_info_address) @@ -1451,14 +1424,6 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, split_segs = image_uses_split_segs(pcs, load_addr); if (!macho_map_file(pcs, filename, split_segs, &fmap)) return FALSE; - /* Find the dynamic loader's table of images loaded into the process. - */ - if (macho_info->flags & MACHO_INFO_DEBUG_HEADER) - { - macho_info->dbg_hdr_addr = (unsigned long)get_dyld_image_info_address(pcs); - ret = TRUE; - } - if (macho_info->flags & MACHO_INFO_MODULE) { struct macho_module_info *macho_module_info; @@ -1736,7 +1701,7 @@ static BOOL macho_enum_modules(struct process* process, enum_modules_cb cb, void BOOL ret; TRACE("(%p, %p, %p)\n", process->handle, cb, user); - macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_NAME; + macho_info.flags = MACHO_INFO_NAME; ret = macho_enum_modules_internal(process, macho_info.module_name, cb, user); HeapFree(GetProcessHeap(), 0, (char*)macho_info.module_name); return ret; @@ -1823,9 +1788,7 @@ static struct module* macho_load_module(struct process* pcs, const WCHAR* name, */ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_info) { - WCHAR *loader = get_wine_loader_name(pcs); BOOL ret = FALSE; - ULONG_PTR dyld_image_info_address; union wine_all_image_infos image_infos; union wine_image_info image_info; uint32_t len; @@ -1836,9 +1799,8 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in len = sizeof(image_infos.infos64); else len = sizeof(image_infos.infos32); - dyld_image_info_address = get_dyld_image_info_address(pcs); - if (dyld_image_info_address && - ReadProcessMemory(pcs->handle, (void*)dyld_image_info_address, &image_infos, len, NULL)) + if (pcs->dbg_hdr_addr && + ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) { if (pcs->is_64bit) len = sizeof(image_info.info64); @@ -1898,8 +1860,11 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in } if (!ret) - ret = macho_search_and_load_file(pcs, loader, 0, macho_info); - heap_free(loader); + { + WCHAR *loader = get_wine_loader_name(pcs); + ret = loader && macho_search_and_load_file(pcs, loader, 0, macho_info); + heap_free(loader); + } return ret; } @@ -1917,23 +1882,24 @@ static const struct loader_ops macho_loader_ops = * * Try to find a decent wine executable which could have loaded the debuggee */ -BOOL macho_read_wine_loader_dbg_info(struct process* pcs) +BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) { struct macho_info macho_info; TRACE("(%p/%p)\n", pcs, pcs->handle); - macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_MODULE; - if (!macho_search_loader(pcs, &macho_info) || !macho_info.dbg_hdr_addr) return FALSE; + pcs->dbg_hdr_addr = addr ? addr : get_dyld_image_info_address(pcs); + macho_info.flags = MACHO_INFO_MODULE; + if (!macho_search_loader(pcs, &macho_info)) return FALSE; macho_info.module->format_info[DFI_MACHO]->u.macho_info->is_loader = 1; module_set_module(macho_info.module, S_WineLoaderW); - pcs->dbg_hdr_addr = macho_info.dbg_hdr_addr; pcs->loader = &macho_loader_ops; + TRACE("Found macho debug header %#lx\n", pcs->dbg_hdr_addr); return TRUE; } #else /* HAVE_MACH_O_LOADER_H */ -BOOL macho_read_wine_loader_dbg_info(struct process* pcs) +BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) { return FALSE; } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index b547254b48b..323dc44f9fa 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 635506921a28c65bfc9b339d59c63d96092d97d8 + wine: e3354e44f17d74f0ac4547d8a4494c83ea3d6d37
4 years, 3 months
1
0
0
0
[reactos] 118/179: [WINESYNC] dbghelp: Use PE type for virtual modules.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab49d97a84f646dd278fd…
commit ab49d97a84f646dd278fd93559c5228c9cb7aeda Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:27:48 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:50 2020 +0200 [WINESYNC] dbghelp: Use PE type for virtual modules. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 635506921a28c65bfc9b339d59c63d96092d97d8 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/module.c | 61 +----------------------------------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index dcc73aa40ff..e4cd98b224a 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -41,9 +41,6 @@ const WCHAR S_ElfW[] = {'<','e','l','f','>','\0'}; const WCHAR S_WineLoaderW[] = {'<','w','i','n','e','-','l','o','a','d','e','r','>','\0'}; #endif static const WCHAR S_DotSoW[] = {'.','s','o','\0'}; -static const WCHAR S_DotDylibW[] = {'.','d','y','l','i','b','\0'}; -static const WCHAR S_DotPdbW[] = {'.','p','d','b','\0'}; -static const WCHAR S_DotDbgW[] = {'.','d','b','g','\0'}; const WCHAR S_SlashW[] = {'/','\0'}; static const WCHAR S_AcmW[] = {'.','a','c','m','\0'}; @@ -480,61 +477,6 @@ static BOOL module_is_container_loaded(const struct process* pcs, return FALSE; } -/****************************************************************** - * module_get_type_by_name - * - * Guesses a filename type from its extension - */ -enum module_type module_get_type_by_name(const WCHAR* name) -{ - int len = strlenW(name); - - /* Skip all version extensions (.[digits]) regex: "(\.\d+)*$" */ - do - { - int i = len; - - while (i && name[i - 1] >= '0' && name[i - 1] <= '9') i--; - - if (i && name[i - 1] == '.') - len = i - 1; - else - break; - } while (len); - - /* check for terminating .so or .so.[digit] */ - /* FIXME: Can't rely solely on extension; have to check magic or - * stop using .so on Mac OS X. For now, base on platform. */ - if (len > 3 && !memcmp(name + len - 3, S_DotSoW, 3)) -#ifdef __APPLE__ - return DMT_MACHO; -#else - return DMT_ELF; -#endif - - if (len > 6 && !strncmpiW(name + len - 6, S_DotDylibW, 6)) - return DMT_MACHO; - - if (len > 4 && !strncmpiW(name + len - 4, S_DotPdbW, 4)) - return DMT_PDB; - - if (len > 4 && !strncmpiW(name + len - 4, S_DotDbgW, 4)) - return DMT_DBG; - - /* wine is also a native module (Mach-O on Mac OS X, ELF elsewhere) */ -#ifndef __REACTOS__ - if (is_wine_loader(name)) - { -#ifdef __APPLE__ - return DMT_MACHO; -#else - return DMT_ELF; -#endif - } -#endif - return DMT_PE; -} - static BOOL image_check_debug_link(const WCHAR* file, struct image_file_map* fmap, DWORD link_crc) { DWORD read_bytes; @@ -871,8 +813,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam if (Flags & SLMFLAG_VIRTUAL) { if (!wImageName) return FALSE; - module = module_new(pcs, wImageName, module_get_type_by_name(wImageName), - TRUE, BaseOfDll, SizeOfDll, 0, 0); + module = module_new(pcs, wImageName, DMT_PE, TRUE, BaseOfDll, SizeOfDll, 0, 0); if (!module) return FALSE; if (wModuleName) module_set_module(module, wModuleName); module->module.SymType = SymVirtual; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index c4d061cf398..b547254b48b 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: c8b5a3be55963fcda51b8e13c10bcd45ecc4bc97 + wine: 635506921a28c65bfc9b339d59c63d96092d97d8
4 years, 3 months
1
0
0
0
[reactos] 117/179: [WINESYNC] dbghelp: Explicitly pass file type to path_find_symbol_file.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=065f0d9772fe95f3cb2b4…
commit 065f0d9772fe95f3cb2b48716ea7173e187d23e6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:27:43 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:49 2020 +0200 [WINESYNC] dbghelp: Explicitly pass file type to path_find_symbol_file. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id c8b5a3be55963fcda51b8e13c10bcd45ecc4bc97 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/dbghelp_private.h | 4 +--- dll/win32/dbghelp/msc.c | 4 ++-- dll/win32/dbghelp/path.c | 4 ++-- dll/win32/dbghelp/pe_module.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 39394ead267..d2f4b27bf90 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -672,8 +672,6 @@ extern struct module* extern struct module* module_get_containee(const struct process* pcs, const struct module* inner) DECLSPEC_HIDDEN; -extern enum module_type - module_get_type_by_name(const WCHAR* name) DECLSPEC_HIDDEN; extern void module_reset_debug_info(struct module* module) DECLSPEC_HIDDEN; extern BOOL module_remove(struct process* pcs, struct module* module) DECLSPEC_HIDDEN; @@ -698,7 +696,7 @@ extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, /* path.c */ extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module, - PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2, + PCSTR full_path, enum module_type type, const GUID* guid, DWORD dw1, DWORD dw2, WCHAR *buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN; extern WCHAR *get_dos_file_name(const WCHAR *filename) DECLSPEC_HIDDEN; extern BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR*), void *param) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 4be0cb244da..6696fa02e4e 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2458,11 +2458,11 @@ static HANDLE map_pdb_file(const struct process* pcs, switch (lookup->kind) { case PDB_JG: - ret = path_find_symbol_file(pcs, module, lookup->filename, NULL, lookup->timestamp, + ret = path_find_symbol_file(pcs, module, lookup->filename, DMT_PDB, NULL, lookup->timestamp, lookup->age, dbg_file_path, &module->module.PdbUnmatched); break; case PDB_DS: - ret = path_find_symbol_file(pcs, module, lookup->filename, &lookup->guid, 0, + ret = path_find_symbol_file(pcs, module, lookup->filename, DMT_PDB, &lookup->guid, 0, lookup->age, dbg_file_path, &module->module.PdbUnmatched); break; } diff --git a/dll/win32/dbghelp/path.c b/dll/win32/dbghelp/path.c index 023adfa1037..4e7354f93ad 100644 --- a/dll/win32/dbghelp/path.c +++ b/dll/win32/dbghelp/path.c @@ -619,7 +619,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) } BOOL path_find_symbol_file(const struct process* pcs, const struct module* module, - PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2, + PCSTR full_path, enum module_type type, const GUID* guid, DWORD dw1, DWORD dw2, WCHAR *buffer, BOOL* is_unmatched) { struct module_find mf; @@ -638,7 +638,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH); filename = file_name(full_pathW); - mf.kind = module_get_type_by_name(filename); + mf.kind = type; *is_unmatched = FALSE; /* first check full path to file */ diff --git a/dll/win32/dbghelp/pe_module.c b/dll/win32/dbghelp/pe_module.c index 62328bb8d49..b915911d6ce 100644 --- a/dll/win32/dbghelp/pe_module.c +++ b/dll/win32/dbghelp/pe_module.c @@ -577,7 +577,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, TRACE("Processing DBG file %s\n", debugstr_a(dbg_name)); - if (path_find_symbol_file(pcs, module, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) && + if (path_find_symbol_file(pcs, module, dbg_name, DMT_DBG, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) && (hFile = CreateFileW(tmp, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE && ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) && diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 0225532289a..c4d061cf398 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: a676c5785ea56fede37370cd6d5e4508e9d8c62a + wine: c8b5a3be55963fcda51b8e13c10bcd45ecc4bc97
4 years, 3 months
1
0
0
0
[reactos] 116/179: [WINESYNC] dbghelp: Use loader_ops for load_debug_info.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87c943516fa3c2547d28d…
commit 87c943516fa3c2547d28d80da716cca782043461 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 17:17:04 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:49 2020 +0200 [WINESYNC] dbghelp: Use loader_ops for load_debug_info. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id a676c5785ea56fede37370cd6d5e4508e9d8c62a by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/dbghelp_private.h | 3 +-- dll/win32/dbghelp/elf_module.c | 10 +++------- dll/win32/dbghelp/macho_module.c | 7 ++----- dll/win32/dbghelp/module.c | 25 +++++++++---------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 16 insertions(+), 31 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index a232547a514..39394ead267 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -424,6 +424,7 @@ struct loader_ops { BOOL (*synchronize_module_list)(struct process* process); struct module* (*load_module)(struct process* process, const WCHAR* name, ULONG_PTR addr); + BOOL (*load_debug_info)(struct process *process, struct module* module); BOOL (*enum_modules)(struct process* process, enum_modules_cb callback, void* user); BOOL (*fetch_file_info)(struct process* process, const WCHAR* name, ULONG_PTR load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum); }; @@ -634,13 +635,11 @@ extern struct cpu* cpu_find(DWORD) DECLSPEC_HIDDEN; extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN; /* elf_module.c */ -extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN; extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; struct elf_thunk_area; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ -extern BOOL macho_load_debug_info(struct process *pcs, struct module* module) DECLSPEC_HIDDEN; extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; /* minidump.c */ diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 038a552e429..20c68dc1ab3 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -1041,7 +1041,7 @@ static BOOL elf_load_debug_info_from_map(struct module* module, * * Loads ELF debugging information from the module image file. */ -BOOL elf_load_debug_info(struct module* module) +static BOOL elf_load_debug_info(struct process* process, struct module* module) { BOOL ret = TRUE; struct pool pool; @@ -1198,7 +1198,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, elf_info->module->module.SymType = SymDeferred; ret = TRUE; } - else ret = elf_load_debug_info(elf_info->module); + else ret = elf_load_debug_info(pcs, elf_info->module); elf_module_info->elf_mark = 1; elf_module_info->elf_loader = 0; @@ -1707,6 +1707,7 @@ static const struct loader_ops elf_loader_ops = { elf_synchronize_module_list, elf_load_module, + elf_load_debug_info, elf_enum_modules, elf_fetch_file_info, }; @@ -1741,11 +1742,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -BOOL elf_load_debug_info(struct module* module) -{ - return FALSE; -} - int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) { diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index c55443905b0..8e2fa796e03 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1281,7 +1281,7 @@ static BOOL image_uses_split_segs(struct process* process, unsigned long load_ad * * Loads Mach-O debugging information from the module image file. */ -BOOL macho_load_debug_info(struct process *pcs, struct module* module) +static BOOL macho_load_debug_info(struct process *pcs, struct module* module) { BOOL ret = FALSE; struct macho_debug_info mdi; @@ -1907,6 +1907,7 @@ static const struct loader_ops macho_loader_ops = { macho_synchronize_module_list, macho_load_module, + macho_load_debug_info, macho_enum_modules, macho_fetch_file_info, }; @@ -1937,8 +1938,4 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -BOOL macho_load_debug_info(struct process *pcs, struct module* module) -{ - return FALSE; -} #endif /* HAVE_MACH_O_LOADER_H */ diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index 4634893eb82..dcc73aa40ff 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -387,14 +387,8 @@ BOOL module_get_debug(struct module_pair* pair) BOOL ret; if (pair->effective->is_virtual) ret = FALSE; - else switch (pair->effective->type) + else if (pair->effective->type == DMT_PE) { -#ifndef DBGHELP_STATIC_LIB - case DMT_ELF: - ret = elf_load_debug_info(pair->effective); - break; -#endif - case DMT_PE: idslW64.SizeOfStruct = sizeof(idslW64); idslW64.BaseOfImage = pair->effective->module.BaseOfImage; idslW64.CheckSum = pair->effective->module.CheckSum; @@ -409,16 +403,9 @@ BOOL module_get_debug(struct module_pair* pair) pcs_callback(pair->pcs, ret ? CBA_DEFERRED_SYMBOL_LOAD_COMPLETE : CBA_DEFERRED_SYMBOL_LOAD_FAILURE, &idslW64); - break; -#ifndef DBGHELP_STATIC_LIB - case DMT_MACHO: - ret = macho_load_debug_info(pair->pcs, pair->effective); - break; -#endif - default: - ret = FALSE; - break; } + else ret = pair->pcs->loader->load_debug_info(pair->pcs, pair->effective); + if (!ret) pair->effective->module.SymType = SymNone; assert(pair->effective->module.SymType != SymDeferred); pair->effective->module.NumSyms = pair->effective->ht_symbols.num_elts; @@ -1457,6 +1444,11 @@ static struct module* native_load_module(struct process* pcs, const WCHAR* name, return NULL; } +static BOOL native_load_debug_info(struct process* process, struct module* module) +{ + return FALSE; +} + static BOOL native_enum_modules(struct process *process, enum_modules_cb cb, void* user) { return FALSE; @@ -1472,6 +1464,7 @@ const struct loader_ops no_loader_ops = { native_synchronize_module_list, native_load_module, + native_load_debug_info, native_enum_modules, native_fetch_file_info, }; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 7a4f813471b..0225532289a 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 5ae3f969d4ec525a14a8109a5ee4c5a2e2238405 + wine: a676c5785ea56fede37370cd6d5e4508e9d8c62a
4 years, 3 months
1
0
0
0
[reactos] 115/179: [WINESYNC] dbghelp: Use loader_ops for load_module.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f308fa857b45f6d9c7314…
commit f308fa857b45f6d9c7314d8dac9e02b04da3be1f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 17:15:29 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:49 2020 +0200 [WINESYNC] dbghelp: Use loader_ops for load_module. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 5ae3f969d4ec525a14a8109a5ee4c5a2e2238405 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/dbghelp_private.h | 5 +---- dll/win32/dbghelp/elf_module.c | 8 ++------ dll/win32/dbghelp/macho_module.c | 8 ++------ dll/win32/dbghelp/module.c | 21 +++++++-------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 13 insertions(+), 31 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 472b05a1b9d..a232547a514 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -423,6 +423,7 @@ typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user); struct loader_ops { BOOL (*synchronize_module_list)(struct process* process); + struct module* (*load_module)(struct process* process, const WCHAR* name, ULONG_PTR addr); BOOL (*enum_modules)(struct process* process, enum_modules_cb callback, void* user); BOOL (*fetch_file_info)(struct process* process, const WCHAR* name, ULONG_PTR load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum); }; @@ -634,16 +635,12 @@ extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN; /* elf_module.c */ extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN; -extern struct module* - elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; struct elf_thunk_area; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ extern BOOL macho_load_debug_info(struct process *pcs, struct module* module) DECLSPEC_HIDDEN; -extern struct module* - macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; /* minidump.c */ diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 64c550a67bd..038a552e429 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -1583,7 +1583,7 @@ static BOOL elf_load_cb(const WCHAR* name, unsigned long load_addr, * Also, find module real name and load address from * the real loaded modules list in pcs address space */ -struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +static struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) { struct elf_load el; @@ -1706,6 +1706,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info) static const struct loader_ops elf_loader_ops = { elf_synchronize_module_list, + elf_load_module, elf_enum_modules, elf_fetch_file_info, }; @@ -1740,11 +1741,6 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) -{ - return NULL; -} - BOOL elf_load_debug_info(struct module* module) { return FALSE; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index df38129e12c..c55443905b0 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1782,7 +1782,7 @@ static BOOL macho_load_cb(const WCHAR* name, unsigned long addr, void* user) * Also, find module real name and load address from * the real loaded modules list in pcs address space. */ -struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +static struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) { struct macho_load ml; @@ -1906,6 +1906,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in static const struct loader_ops macho_loader_ops = { macho_synchronize_module_list, + macho_load_module, macho_enum_modules, macho_fetch_file_info, }; @@ -1936,11 +1937,6 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) -{ - return NULL; -} - BOOL macho_load_debug_info(struct process *pcs, struct module* module) { return FALSE; diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index 61a069ec75b..4634893eb82 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -919,20 +919,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam wImageName) { /* and finally an ELF or Mach-O module */ -#ifndef DBGHELP_STATIC_LIB - switch (module_get_type_by_name(wImageName)) - { - case DMT_ELF: - module = elf_load_module(pcs, wImageName, BaseOfDll); - break; - case DMT_MACHO: - module = macho_load_module(pcs, wImageName, BaseOfDll); - break; - default: - /* Ignored */ - break; - } -#endif + module = pcs->loader->load_module(pcs, wImageName, BaseOfDll); } } if (!module) @@ -1465,6 +1452,11 @@ static BOOL native_synchronize_module_list(struct process* pcs) return FALSE; } +static struct module* native_load_module(struct process* pcs, const WCHAR* name, unsigned long addr) +{ + return NULL; +} + static BOOL native_enum_modules(struct process *process, enum_modules_cb cb, void* user) { return FALSE; @@ -1479,6 +1471,7 @@ static BOOL native_fetch_file_info(struct process* process, const WCHAR* name, U const struct loader_ops no_loader_ops = { native_synchronize_module_list, + native_load_module, native_enum_modules, native_fetch_file_info, }; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 06702ac9f61..7a4f813471b 100644 --- a/sdk/tools/winesync/dbghelp.cfg +++ b/sdk/tools/winesync/dbghelp.cfg @@ -4,4 +4,4 @@ files: include/dbghelp.h: sdk/include/psdk/dbghelp.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h tags: - wine: 16a3481bd22243183281c60ff375d4e61d5c4198 + wine: 5ae3f969d4ec525a14a8109a5ee4c5a2e2238405
4 years, 3 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
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