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
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 -----
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] 54/179: [WINESYNC] dbghelp: Avoid using inline assembly in do_x86cpuid().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=719c13083f2db9b363741…
commit 719c13083f2db9b363741489955ccd337a8001fc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:55:24 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: Avoid using inline assembly in do_x86cpuid(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b7f3e6ba317bec299e43156efcdb5469f39a8a3c by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/minidump.c | 36 +++++++++++++++++++++++++----------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/dll/win32/dbghelp/minidump.c b/dll/win32/dbghelp/minidump.c index 975bb45c9a4..d01b44484b8 100644 --- a/dll/win32/dbghelp/minidump.c +++ b/dll/win32/dbghelp/minidump.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" #include <time.h> #define NONAMELESSUNION @@ -542,20 +543,33 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf) return sz; } -/* Calls cpuid with an eax of 'ax' and returns the 16 bytes in *p - * We are compiled with -fPIC, so we can't clobber ebx. - */ -static inline void do_x86cpuid(unsigned int ax, unsigned int *p) +#ifdef __i386__ +#ifndef __REACTOS__ +extern void do_x86cpuid(unsigned int ax, unsigned int *p); +__ASM_GLOBAL_FUNC( do_x86cpuid, + "pushl %esi\n\t" + "pushl %ebx\n\t" + "movl 12(%esp),%eax\n\t" + "movl 16(%esp),%esi\n\t" + "cpuid\n\t" + "movl %eax,(%esi)\n\t" + "movl %ebx,4(%esi)\n\t" + "movl %ecx,8(%esi)\n\t" + "movl %edx,12(%esi)\n\t" + "popl %ebx\n\t" + "popl %esi\n\t" + "ret" ) +#else +static void do_x86cpuid(unsigned int ax, unsigned int *p) { -#if defined(__GNUC__) && defined(__i386__) - __asm__("pushl %%ebx\n\t" - "cpuid\n\t" - "movl %%ebx, %%esi\n\t" - "popl %%ebx" - : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); + __cpuid((int*)p, ax); +} #endif +#else +static void do_x86cpuid(unsigned int ax, unsigned int *p) +{ } +#endif /* From xf86info havecpuid.c 1.11 */ static inline int have_x86cpuid(void) diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 0db6fe0d30d..9bc1bc767d6 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: 74f425e70dfbc43da1eaf9048f45bed52ef1d66c + wine: b7f3e6ba317bec299e43156efcdb5469f39a8a3c
4 years
1
0
0
0
[reactos] 53/179: [WINESYNC] dbghelp: Fix build failure on macOS.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5f9c500b2ccaa88f1aa8f…
commit 5f9c500b2ccaa88f1aa8ff0109bf4f224efd5007 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:55:24 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: Fix build failure on macOS. This was caused by commit 8d096fb5e262e5e87866d1a4a397da144a09b635. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 74f425e70dfbc43da1eaf9048f45bed52ef1d66c by Huw Davies <huw(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index a3f838f88ff..a0623352a73 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1096,7 +1096,7 @@ static void macho_finish_stabs(struct module* module, struct hash_table* ht_symt if (ste->is_public && !(dbghelp_options & SYMOPT_NO_PUBLICS)) { - symt_new_public(module, ste->compiland, ste->ht_elt.name, ste->addr, 0); + symt_new_public(module, ste->compiland, ste->ht_elt.name, ste->is_code, ste->addr, 0); } } } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 1814690ca8a..0db6fe0d30d 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: d614ac46718311f49541b32ac726c17a06077ae1 + wine: 74f425e70dfbc43da1eaf9048f45bed52ef1d66c
4 years
1
0
0
0
[reactos] 52/179: [WINESYNC] dbghelp: SymFromAddr: Handle 2 or more symbols at the same address correct.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=667215841f89130815903…
commit 667215841f89130815903a0f387144256f59c8d3 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:55:23 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: SymFromAddr: Handle 2 or more symbols at the same address correct. Signed-off-by: Andreas Maier <staubim(a)quantentunnel.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d614ac46718311f49541b32ac726c17a06077ae1 by Andreas Maier <staubim(a)quantentunnel.de> --- dll/win32/dbghelp/symbol.c | 54 +++++++++++++++++++++++++++--------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/dll/win32/dbghelp/symbol.c b/dll/win32/dbghelp/symbol.c index 38d2a5b7291..25cff440d78 100644 --- a/dll/win32/dbghelp/symbol.c +++ b/dll/win32/dbghelp/symbol.c @@ -874,6 +874,33 @@ static void symt_get_length(struct module* module, const struct symt* symt, ULON *size = 0x1000; /* arbitrary value */ } +/* neede by symt_find_nearest */ +int symt_get_best_at(struct module* module, int idx_sorttab) +{ + ULONG64 ref_addr; + int idx_sorttab_orig = idx_sorttab; + if (module->addr_sorttab[idx_sorttab]->symt.tag == SymTagPublicSymbol) + { + symt_get_address(&module->addr_sorttab[idx_sorttab]->symt, &ref_addr); + while (idx_sorttab > 0 && + module->addr_sorttab[idx_sorttab]->symt.tag == SymTagPublicSymbol && + !cmp_sorttab_addr(module, idx_sorttab - 1, ref_addr)) + idx_sorttab--; + if (module->addr_sorttab[idx_sorttab]->symt.tag == SymTagPublicSymbol) + { + idx_sorttab = idx_sorttab_orig; + while (idx_sorttab < module->num_sorttab - 1 && + module->addr_sorttab[idx_sorttab]->symt.tag == SymTagPublicSymbol && + !cmp_sorttab_addr(module, idx_sorttab + 1, ref_addr)) + idx_sorttab++; + } + /* if no better symbol fond restore original */ + if (module->addr_sorttab[idx_sorttab]->symt.tag == SymTagPublicSymbol) + idx_sorttab = idx_sorttab_orig; + } + return idx_sorttab; +} + /* assume addr is in module */ struct symt_ht* symt_find_nearest(struct module* module, DWORD_PTR addr) { @@ -892,7 +919,12 @@ struct symt_ht* symt_find_nearest(struct module* module, DWORD_PTR addr) high = module->num_sorttab; symt_get_address(&module->addr_sorttab[0]->symt, &ref_addr); - if (addr < ref_addr) return NULL; + if (addr <= ref_addr) + { + low = symt_get_best_at(module, 0); + return module->addr_sorttab[low]; + } + if (high) { symt_get_address(&module->addr_sorttab[high - 1]->symt, &ref_addr); @@ -915,23 +947,7 @@ struct symt_ht* symt_find_nearest(struct module* module, DWORD_PTR addr) /* If found symbol is a public symbol, check if there are any other entries that * might also have the same address, but would get better information */ - if (module->addr_sorttab[low]->symt.tag == SymTagPublicSymbol) - { - symt_get_address(&module->addr_sorttab[low]->symt, &ref_addr); - if (low > 0 && - module->addr_sorttab[low - 1]->symt.tag != SymTagPublicSymbol && - !cmp_sorttab_addr(module, low - 1, ref_addr)) - low--; - else if (low < module->num_sorttab - 1 && - module->addr_sorttab[low + 1]->symt.tag != SymTagPublicSymbol && - !cmp_sorttab_addr(module, low + 1, ref_addr)) - low++; - } - /* finally check that we fit into the found symbol */ - symt_get_address(&module->addr_sorttab[low]->symt, &ref_addr); - if (addr < ref_addr) return NULL; - symt_get_length(module, &module->addr_sorttab[low]->symt, &ref_size); - if (addr >= ref_addr + ref_size) return NULL; + low = symt_get_best_at(module, low); return module->addr_sorttab[low]; } @@ -1260,7 +1276,7 @@ BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address, symt_fill_sym_info(&pair, NULL, &sym->symt, Symbol); if (Displacement) - *Displacement = Address - Symbol->Address; + *Displacement = (Address >= Symbol->Address) ? (Address - Symbol->Address) : (DWORD64)-1; return TRUE; } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index c852ca21564..1814690ca8a 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: 6c3418914df3196bf5a464649ef302a5e942dd90 + wine: d614ac46718311f49541b32ac726c17a06077ae1
4 years
1
0
0
0
[reactos] 51/179: [WINESYNC] dbghelp: Set last error for SymGetModuleBase-calls to ERROR_MOD_NOT_FOUND.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a139418eb5bdfb00c12d…
commit 9a139418eb5bdfb00c12dc5545372252bb9254ca Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:55:23 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: Set last error for SymGetModuleBase-calls to ERROR_MOD_NOT_FOUND. Signed-off-by: Andreas Maier <staubim(a)quantentunnel.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6c3418914df3196bf5a464649ef302a5e942dd90 by Andreas Maier <staubim(a)quantentunnel.de> --- dll/win32/dbghelp/module.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/dbghelp/module.c b/dll/win32/dbghelp/module.c index 0c3cdda3d65..8a47c152c25 100644 --- a/dll/win32/dbghelp/module.c +++ b/dll/win32/dbghelp/module.c @@ -455,7 +455,7 @@ struct module* module_find_by_addr(const struct process* pcs, DWORD64 addr, return module; } } - SetLastError(ERROR_INVALID_ADDRESS); + SetLastError(ERROR_MOD_NOT_FOUND); return module; } diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 9c666dfc02c..c852ca21564 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: 8d096fb5e262e5e87866d1a4a397da144a09b635 + wine: 6c3418914df3196bf5a464649ef302a5e942dd90
4 years
1
0
0
0
[reactos] 50/179: [WINESYNC] dbghelp: Set correct values in symt_fill_sym_info (SYMBOL_INFO).
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=575196093ae5636dc9858…
commit 575196093ae5636dc9858ab207aeb9e1a408581c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:08 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: Set correct values in symt_fill_sym_info (SYMBOL_INFO). Signed-off-by: Andreas Maier <staubim(a)quantentunnel.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8d096fb5e262e5e87866d1a4a397da144a09b635 by Andreas Maier <staubim(a)quantentunnel.de> --- dll/win32/dbghelp/compat.h | 7 +++++++ dll/win32/dbghelp/dbghelp_private.h | 5 ++++- dll/win32/dbghelp/elf_module.c | 1 + dll/win32/dbghelp/msc.c | 5 ++++- dll/win32/dbghelp/pe_module.c | 11 ++++++----- dll/win32/dbghelp/rsym.c | 4 ++-- dll/win32/dbghelp/symbol.c | 13 ++++++++++--- sdk/tools/winesync/dbghelp.cfg | 2 +- 8 files changed, 35 insertions(+), 13 deletions(-) diff --git a/dll/win32/dbghelp/compat.h b/dll/win32/dbghelp/compat.h index 76ea07df7fc..4917889ca1c 100644 --- a/dll/win32/dbghelp/compat.h +++ b/dll/win32/dbghelp/compat.h @@ -736,6 +736,13 @@ typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT; #define SYMFLAG_THUNK 0x00002000 #define SYMFLAG_TLSREL 0x00004000 #define SYMFLAG_SLOT 0x00008000 +#define SYMFLAG_ILREL 0x00010000 +#define SYMFLAG_METADATA 0x00020000 +#define SYMFLAG_CLR_TOKEN 0x00040000 +#define SYMFLAG_NULL 0x00080000 +#define SYMFLAG_FUNC_NO_RETURN 0x00100000 +#define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000 +#define SYMFLAG_PUBLIC_CODE 0x00400000 #define UNDNAME_COMPLETE (0x0000) #define UNDNAME_NAME_ONLY (0x1000) typedef struct _TI_FINDCHILDREN_PARAMS diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 3cf215a25e2..2138bd65154 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -244,6 +244,7 @@ struct symt_public struct symt symt; struct hash_table_elt hash_elt; struct symt* container; /* compiland */ + BOOL is_function; unsigned long address; unsigned long size; }; @@ -755,7 +756,9 @@ extern struct symt_public* symt_new_public(struct module* module, struct symt_compiland* parent, const char* typename, - unsigned long address, unsigned size) DECLSPEC_HIDDEN; + BOOL is_function, + unsigned long address, + unsigned size) DECLSPEC_HIDDEN; extern struct symt_data* symt_new_global_variable(struct module* module, struct symt_compiland* parent, diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 6b8d47a1e40..96b16fd5c0c 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -927,6 +927,7 @@ static int elf_new_public_symbols(struct module* module, const struct hash_table while ((ste = hash_table_iter_up(&hti))) { symt_new_public(module, ste->compiland, ste->ht_elt.name, + FALSE, module->reloc_delta + ste->sym.st_value, ste->sym.st_size); } diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index ae51884abc6..adb66d68809 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2072,6 +2072,7 @@ static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BY { symt_new_public(msc_dbg->module, compiland, terminate_string(&sym->public_v1.p_name), + sym->public_v1.symtype == SYMTYPE_FUNCTION, codeview_get_address(msc_dbg, sym->public_v1.segment, sym->public_v1.offset), 1); } break; @@ -2080,6 +2081,7 @@ static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BY { symt_new_public(msc_dbg->module, compiland, terminate_string(&sym->public_v2.p_name), + sym->public_v2.symtype == SYMTYPE_FUNCTION, codeview_get_address(msc_dbg, sym->public_v2.segment, sym->public_v2.offset), 1); } break; @@ -2089,6 +2091,7 @@ static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BY { symt_new_public(msc_dbg->module, compiland, sym->public_v3.name, + sym->public_v3.symtype == SYMTYPE_FUNCTION, codeview_get_address(msc_dbg, sym->public_v3.segment, sym->public_v3.offset), 1); } break; @@ -2885,7 +2888,7 @@ static BOOL pdb_process_file(const struct process* pcs, if (ret) { struct pdb_module_info* pdb_info = msc_dbg->module->format_info[DFI_PDB]->u.pdb_info; - msc_dbg->module->module.SymType = SymCv; + msc_dbg->module->module.SymType = SymPdb; if (pdb_info->pdb_files[0].kind == PDB_JG) msc_dbg->module->module.PdbSig = pdb_info->pdb_files[0].u.jg.timestamp; else diff --git a/dll/win32/dbghelp/pe_module.c b/dll/win32/dbghelp/pe_module.c index 6d0a9a6b5f9..eca81bf9876 100644 --- a/dll/win32/dbghelp/pe_module.c +++ b/dll/win32/dbghelp/pe_module.c @@ -444,7 +444,7 @@ static BOOL pe_load_coff_symbol_table(struct module* module) source_new(module, NULL, lastfilename)); if (!(dbghelp_options & SYMOPT_NO_PUBLICS)) - symt_new_public(module, compiland, name, + symt_new_public(module, compiland, name, FALSE, module->module.BaseOfImage + sect[isym->SectionNumber - 1].VirtualAddress + isym->Value, 1); @@ -674,11 +674,11 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* #if 0 /* Add start of DLL (better use the (yet unimplemented) Exe SymTag for this) */ /* FIXME: module.ModuleName isn't correctly set yet if it's passed in SymLoadModule */ - symt_new_public(module, NULL, module->module.ModuleName, base, 1); + symt_new_public(module, NULL, module->module.ModuleName, FALSE, base, 1); #endif /* Add entry point */ - symt_new_public(module, NULL, "EntryPoint", + symt_new_public(module, NULL, "EntryPoint", FALSE, base + nth->OptionalHeader.AddressOfEntryPoint, 1); #if 0 /* FIXME: we'd better store addresses linked to sections rather than @@ -689,7 +689,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader); for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) { - symt_new_public(module, NULL, section->Name, + symt_new_public(module, NULL, section->Name, FALSE, RtlImageRvaToVa(nth, mapping, section->VirtualAddress, NULL), 1); } #endif @@ -715,6 +715,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* if (!names[i]) continue; symt_new_public(module, NULL, RtlImageRvaToVa(nth, mapping, names[i], NULL), + FALSE, base + functions[ordinals[i]], 1); } @@ -726,7 +727,7 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, struct module* if ((ordinals[j] == i) && names[j]) break; if (j < exports->NumberOfNames) continue; snprintf(buffer, sizeof(buffer), "%d", i + exports->Base); - symt_new_public(module, NULL, buffer, base + (DWORD)functions[i], 1); + symt_new_public(module, NULL, buffer, FALSE, base + (DWORD)functions[i], 1); } } } diff --git a/dll/win32/dbghelp/rsym.c b/dll/win32/dbghelp/rsym.c index 9b7bf4ee1d7..cc04ecee4a4 100644 --- a/dll/win32/dbghelp/rsym.c +++ b/dll/win32/dbghelp/rsym.c @@ -49,7 +49,7 @@ static void rsym_finalize_function(struct module* module, struct symt_function* { loc.kind = loc_absolute; loc.offset = il.Address - func->address; - symt_add_function_point(module, func, SymTagFuncDebugStart, + symt_add_function_point(module, func, SymTagFuncDebugStart, &loc, NULL); } } @@ -125,7 +125,7 @@ BOOL rsym_parse(struct module* module, unsigned long load_offset, if (use_raw_address(SymbolName)) Address = Entry->Address; - symt_new_public(module, NULL, SymbolName, Address, Size); + symt_new_public(module, NULL, SymbolName, FALSE, Address, Size); } else { diff --git a/dll/win32/dbghelp/symbol.c b/dll/win32/dbghelp/symbol.c index 2a0710b658d..38d2a5b7291 100644 --- a/dll/win32/dbghelp/symbol.c +++ b/dll/win32/dbghelp/symbol.c @@ -226,6 +226,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, struct symt_public* symt_new_public(struct module* module, struct symt_compiland* compiland, const char* name, + BOOL is_function, unsigned long address, unsigned size) { struct symt_public* sym; @@ -241,6 +242,7 @@ struct symt_public* symt_new_public(struct module* module, sym->symt.tag = SymTagPublicSymbol; sym->hash_elt.name = pool_strdup(&module->pool, name); sym->container = compiland ? &compiland->symt : NULL; + sym->is_function = is_function; sym->address = address; sym->size = size; symt_add_module_ht(module, (struct symt_ht*)sym); @@ -697,11 +699,16 @@ static void symt_fill_sym_info(struct module_pair* pair, } break; case SymTagPublicSymbol: - sym_info->Flags |= SYMFLAG_EXPORT; - symt_get_address(sym, &sym_info->Address); + { + const struct symt_public* pub = (const struct symt_public*)sym; + if (pub->is_function) + sym_info->Flags |= SYMFLAG_PUBLIC_CODE; + else + sym_info->Flags |= SYMFLAG_EXPORT; + symt_get_address(sym, &sym_info->Address); + } break; case SymTagFunction: - sym_info->Flags |= SYMFLAG_FUNCTION; symt_get_address(sym, &sym_info->Address); break; case SymTagThunk: diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index bf5358ef159..9c666dfc02c 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: 3b01149d8677fa86addfb67414d793684779c5ce + wine: 8d096fb5e262e5e87866d1a4a397da144a09b635
4 years
1
0
0
0
[reactos] 49/179: [WINESYNC] dbghelp: Add SYMFLAG_- and SYMTYPE_-defines.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94e2d456dbf17d0f1759e…
commit 94e2d456dbf17d0f1759e94f7af15070cf47d516 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:07 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:39 2020 +0200 [WINESYNC] dbghelp: Add SYMFLAG_- and SYMTYPE_-defines. Signed-off-by: Andreas Maier <staubim(a)quantentunnel.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3b01149d8677fa86addfb67414d793684779c5ce by Andreas Maier <staubim(a)quantentunnel.de> --- sdk/include/psdk/dbghelp.h | 7 +++++++ sdk/include/reactos/wine/mscvpdb.h | 7 +++++++ sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sdk/include/psdk/dbghelp.h b/sdk/include/psdk/dbghelp.h index 183e09686aa..aa0cdff1c69 100644 --- a/sdk/include/psdk/dbghelp.h +++ b/sdk/include/psdk/dbghelp.h @@ -1110,6 +1110,13 @@ BOOL WINAPI SymUnloadModule64(_In_ HANDLE, _In_ DWORD64); #define SYMFLAG_THUNK 0x00002000 #define SYMFLAG_TLSREL 0x00004000 #define SYMFLAG_SLOT 0x00008000 +#define SYMFLAG_ILREL 0x00010000 +#define SYMFLAG_METADATA 0x00020000 +#define SYMFLAG_CLR_TOKEN 0x00040000 +#define SYMFLAG_NULL 0x00080000 +#define SYMFLAG_FUNC_NO_RETURN 0x00100000 +#define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000 +#define SYMFLAG_PUBLIC_CODE 0x00400000 #define MAX_SYM_NAME 2000 diff --git a/sdk/include/reactos/wine/mscvpdb.h b/sdk/include/reactos/wine/mscvpdb.h index f11f4065de8..af521ffe56f 100644 --- a/sdk/include/reactos/wine/mscvpdb.h +++ b/sdk/include/reactos/wine/mscvpdb.h @@ -1229,6 +1229,13 @@ union codeview_fieldtype #define LF_COMPLEX128 0x800f #define LF_VARSTRING 0x8010 +/* symtype e.g. for public_vx.symtype */ +#define SYMTYPE_NONE 0x0000 +#define SYMTYPE_CODE 0x0001 +#define SYMTYPE_FUNCTION 0x0002 +#define SYMTYPE_MANAGED 0x0004 +#define SYMTYPE_MSIL 0x0008 + /* ======================================== * * Symbol information * ======================================== */ diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 150a7377b38..bf5358ef159 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: dbcf9728fa13ade68cc9d380002a5f6ae50fc0c0 + wine: 3b01149d8677fa86addfb67414d793684779c5ce
4 years
1
0
0
0
[reactos] 48/179: [WINESYNC] dbghelp: Use correct record in codeview_snarf_public.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=616fb16a529069d0aab80…
commit 616fb16a529069d0aab801667533d92f85bfe215 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:06 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:38 2020 +0200 [WINESYNC] dbghelp: Use correct record in codeview_snarf_public. Use public_vx iststead of data_vx for public symbols. Signed-off-by: Andreas Maier <staubim(a)quantentunnel.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id dbcf9728fa13ade68cc9d380002a5f6ae50fc0c0 by Andreas Maier <staubim(a)quantentunnel.de> --- dll/win32/dbghelp/msc.c | 18 +++++++++--------- sdk/include/reactos/wine/mscvpdb.h | 10 ++++++++++ sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 493c440ea7b..ae51884abc6 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2067,29 +2067,29 @@ static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BY switch (sym->generic.id) { - case S_PUB_V1: /* FIXME is this really a 'data_v1' structure ?? */ + case S_PUB_V1: if (!(dbghelp_options & SYMOPT_NO_PUBLICS)) { symt_new_public(msc_dbg->module, compiland, - terminate_string(&sym->data_v1.p_name), - codeview_get_address(msc_dbg, sym->data_v1.segment, sym->data_v1.offset), 1); + terminate_string(&sym->public_v1.p_name), + codeview_get_address(msc_dbg, sym->public_v1.segment, sym->public_v1.offset), 1); } break; - case S_PUB_V2: /* FIXME is this really a 'data_v2' structure ?? */ + case S_PUB_V2: if (!(dbghelp_options & SYMOPT_NO_PUBLICS)) { symt_new_public(msc_dbg->module, compiland, - terminate_string(&sym->data_v2.p_name), - codeview_get_address(msc_dbg, sym->data_v2.segment, sym->data_v2.offset), 1); + terminate_string(&sym->public_v2.p_name), + codeview_get_address(msc_dbg, sym->public_v2.segment, sym->public_v2.offset), 1); } - break; + break; case S_PUB_V3: if (!(dbghelp_options & SYMOPT_NO_PUBLICS)) { symt_new_public(msc_dbg->module, compiland, - sym->data_v3.name, - codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset), 1); + sym->public_v3.name, + codeview_get_address(msc_dbg, sym->public_v3.segment, sym->public_v3.offset), 1); } break; case S_PUB_FUNC1_V3: diff --git a/sdk/include/reactos/wine/mscvpdb.h b/sdk/include/reactos/wine/mscvpdb.h index 744c17faba4..f11f4065de8 100644 --- a/sdk/include/reactos/wine/mscvpdb.h +++ b/sdk/include/reactos/wine/mscvpdb.h @@ -1350,6 +1350,16 @@ union codeview_symbol char name[1]; } proc_v3; + struct + { + short int len; + short int id; + unsigned int offset; + unsigned short segment; + unsigned short symtype; + struct p_string p_name; + } public_v1; + struct { short int len; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index f53d6d3b02b..150a7377b38 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: 63ef9854fb6fc91a8c956a9d91abc07e906a4a33 + wine: dbcf9728fa13ade68cc9d380002a5f6ae50fc0c0
4 years
1
0
0
0
[reactos] 47/179: [WINESYNC] dbghelp: Only check process architecture if we are actually given a process.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dfc5f68673bb6b9fca8e4…
commit dfc5f68673bb6b9fca8e49f9abf21d3c8086af86 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:05 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:38 2020 +0200 [WINESYNC] dbghelp: Only check process architecture if we are actually given a process. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45407
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 63ef9854fb6fc91a8c956a9d91abc07e906a4a33 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/dbghelp/dbghelp.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c index 1c540cb74f4..76ea6e62470 100644 --- a/dll/win32/dbghelp/dbghelp.c +++ b/dll/win32/dbghelp/dbghelp.c @@ -324,7 +324,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP IsWow64Process(GetCurrentProcess(), &wow64); - if (!IsWow64Process(hProcess, &child_wow64)) + if (GetProcessId(hProcess) && !IsWow64Process(hProcess, &child_wow64)) return FALSE; pcs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pcs)); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 9088f216084..f53d6d3b02b 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: 3e1a56290191e37aded204c554f2e550c0257300 + wine: 63ef9854fb6fc91a8c956a9d91abc07e906a4a33
4 years
1
0
0
0
[reactos] 46/179: [WINESYNC] dbghelp: Return a Unicode path in path_find_symbol_file().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=58e2e22449927df874dc2…
commit 58e2e22449927df874dc27e5f156eb4ca4e25bca Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:04 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:38 2020 +0200 [WINESYNC] dbghelp: Return a Unicode path in path_find_symbol_file(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3e1a56290191e37aded204c554f2e550c0257300 by Alexandre Julliard <julliard(a)winehq.org> --- dll/win32/dbghelp/dbghelp_private.h | 2 +- dll/win32/dbghelp/msc.c | 4 ++-- dll/win32/dbghelp/path.c | 29 ++++++++++------------------- dll/win32/dbghelp/pe_module.c | 6 +++--- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index 759aaa93c98..3cf215a25e2 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -690,7 +690,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, - PSTR buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN; + WCHAR *buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN; /* pe_module.c */ extern BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 6003bc34017..493c440ea7b 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2444,7 +2444,7 @@ static HANDLE map_pdb_file(const struct process* pcs, struct module* module) { HANDLE hFile, hMap = NULL; - char dbg_file_path[MAX_PATH]; + WCHAR dbg_file_path[MAX_PATH]; BOOL ret = FALSE; switch (lookup->kind) @@ -2463,7 +2463,7 @@ static HANDLE map_pdb_file(const struct process* pcs, WARN("\tCouldn't find %s\n", lookup->filename); return NULL; } - if ((hFile = CreateFileA(dbg_file_path, GENERIC_READ, FILE_SHARE_READ, NULL, + if ((hFile = CreateFileW(dbg_file_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) { hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); diff --git a/dll/win32/dbghelp/path.c b/dll/win32/dbghelp/path.c index 0b9a1e35b17..a0fc0cf5b17 100644 --- a/dll/win32/dbghelp/path.c +++ b/dll/win32/dbghelp/path.c @@ -623,11 +623,10 @@ 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, - PSTR buffer, BOOL* is_unmatched) + WCHAR *buffer, BOOL* is_unmatched) { struct module_find mf; WCHAR full_pathW[MAX_PATH]; - WCHAR tmp[MAX_PATH]; WCHAR* ptr; const WCHAR* filename; WCHAR* searchPath = pcs->search_path; @@ -648,7 +647,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul /* first check full path to file */ if (module_find_cb(full_pathW, &mf)) { - WideCharToMultiByte(CP_ACP, 0, full_pathW, -1, buffer, MAX_PATH, NULL, NULL); + strcpyW( buffer, full_pathW ); return TRUE; } @@ -662,38 +661,30 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul (dll may be exe, or sys depending on the file extension) */ /* 2. check module-path */ - file_pathW(module->module.LoadedImageName, tmp); - if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf)) - { - WideCharToMultiByte(CP_ACP, 0, tmp, -1, buffer, MAX_PATH, NULL, NULL); - return TRUE; - } + file_pathW(module->module.LoadedImageName, buffer); + if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE; while (searchPath) { ptr = strchrW(searchPath, ';'); if (ptr) { - memcpy(tmp, searchPath, (ptr - searchPath) * sizeof(WCHAR)); - tmp[ptr - searchPath] = '\0'; + memcpy(buffer, searchPath, (ptr - searchPath) * sizeof(WCHAR)); + buffer[ptr - searchPath] = '\0'; searchPath = ptr + 1; } else { - strcpyW(tmp, searchPath); + strcpyW(buffer, searchPath); searchPath = NULL; } - if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf)) - { - /* return first fully matched file */ - WideCharToMultiByte(CP_ACP, 0, tmp, -1, buffer, MAX_PATH, NULL, NULL); - return TRUE; - } + /* return first fully matched file */ + if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE; } /* if no fully matching file is found, return the best matching file if any */ if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched) { - WideCharToMultiByte(CP_ACP, 0, mf.filename, -1, buffer, MAX_PATH, NULL, NULL); + strcpyW( buffer, mf.filename ); *is_unmatched = TRUE; return TRUE; } diff --git a/dll/win32/dbghelp/pe_module.c b/dll/win32/dbghelp/pe_module.c index 4b9eac4f032..6d0a9a6b5f9 100644 --- a/dll/win32/dbghelp/pe_module.c +++ b/dll/win32/dbghelp/pe_module.c @@ -553,7 +553,7 @@ static BOOL pe_load_rsym(struct module* module) static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, const char* dbg_name, DWORD timestamp) { - char tmp[MAX_PATH]; + WCHAR tmp[MAX_PATH]; HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0; const BYTE* dbg_mapping = NULL; BOOL ret = FALSE; @@ -561,7 +561,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) && - (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL, + (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) && ((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)) @@ -584,7 +584,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, hdr->DebugDirectorySize / sizeof(*dbg)); } else - ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_a(tmp)); + ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_w(tmp)); if (dbg_mapping) UnmapViewOfFile(dbg_mapping); if (hMap) CloseHandle(hMap); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 0b9cafb96c7..9088f216084 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: 6030ee5f6f64a2ebe6df2e505e2588eb300222c2 + wine: 3e1a56290191e37aded204c554f2e550c0257300
4 years
1
0
0
0
[reactos] 45/179: [WINESYNC] dbghelp: Search for debug files in module path too.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=989a748f8157cf4d78baf…
commit 989a748f8157cf4d78baf550cfc91e3443676ba0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 15:53:03 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:38 2020 +0200 [WINESYNC] dbghelp: Search for debug files in module path too. Signed-off-by: Andreas Maier <andy1.m(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6030ee5f6f64a2ebe6df2e505e2588eb300222c2 by Andreas Maier <andy1.m(a)gmx.de> --- dll/win32/dbghelp/dbghelp_private.h | 6 +++--- dll/win32/dbghelp/msc.c | 4 ++-- dll/win32/dbghelp/path.c | 32 +++++++++++++++++++++++++++++--- dll/win32/dbghelp/pe_module.c | 2 +- sdk/tools/winesync/dbghelp.cfg | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp_private.h b/dll/win32/dbghelp/dbghelp_private.h index e0c4801584f..759aaa93c98 100644 --- a/dll/win32/dbghelp/dbghelp_private.h +++ b/dll/win32/dbghelp/dbghelp_private.h @@ -688,9 +688,9 @@ extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip, union ctx *context, struct pdb_cmd_pair *cpair) DECLSPEC_HIDDEN; /* path.c */ -extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, - const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer, - BOOL* is_unmatched) DECLSPEC_HIDDEN; +extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module, + PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2, + PSTR buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN; /* pe_module.c */ extern BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth) DECLSPEC_HIDDEN; diff --git a/dll/win32/dbghelp/msc.c b/dll/win32/dbghelp/msc.c index 0508e120bd8..6003bc34017 100644 --- a/dll/win32/dbghelp/msc.c +++ b/dll/win32/dbghelp/msc.c @@ -2450,11 +2450,11 @@ static HANDLE map_pdb_file(const struct process* pcs, switch (lookup->kind) { case PDB_JG: - ret = path_find_symbol_file(pcs, lookup->filename, NULL, lookup->timestamp, + ret = path_find_symbol_file(pcs, module, lookup->filename, NULL, lookup->timestamp, lookup->age, dbg_file_path, &module->module.PdbUnmatched); break; case PDB_DS: - ret = path_find_symbol_file(pcs, lookup->filename, &lookup->guid, 0, + ret = path_find_symbol_file(pcs, module, lookup->filename, &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 8c74426eec3..0b9a1e35b17 100644 --- a/dll/win32/dbghelp/path.c +++ b/dll/win32/dbghelp/path.c @@ -49,6 +49,15 @@ static inline const WCHAR* file_nameW(const WCHAR* str) return p + 1; } +static inline void file_pathW(const WCHAR *src, WCHAR *dst) +{ + int len; + + for (len = strlenW(src) - 1; (len > 0) && (!is_sepW(src[len])); len--); + memcpy( dst, src, len * sizeof(WCHAR) ); + dst[len] = 0; +} + /****************************************************************** * FindDebugInfoFile (DBGHELP.@) * @@ -612,9 +621,9 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) return mf->matched == 2; } -BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, - const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer, - BOOL* is_unmatched) +BOOL path_find_symbol_file(const struct process* pcs, const struct module* module, + PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2, + PSTR buffer, BOOL* is_unmatched) { struct module_find mf; WCHAR full_pathW[MAX_PATH]; @@ -643,6 +652,23 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, return TRUE; } + /* FIXME: Use Environment-Variables (see MS docs) + _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH + FIXME: Implement "Standard Path Elements" (Path) ... (see MS docs) + do a search for (every?) path-element like this ... + <path> + <path>\dll + <path>\symbols\dll + (dll may be exe, or sys depending on the file extension) */ + + /* 2. check module-path */ + file_pathW(module->module.LoadedImageName, tmp); + if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf)) + { + WideCharToMultiByte(CP_ACP, 0, tmp, -1, buffer, MAX_PATH, NULL, NULL); + return TRUE; + } + while (searchPath) { ptr = strchrW(searchPath, ';'); diff --git a/dll/win32/dbghelp/pe_module.c b/dll/win32/dbghelp/pe_module.c index 376a780653b..4b9eac4f032 100644 --- a/dll/win32/dbghelp/pe_module.c +++ b/dll/win32/dbghelp/pe_module.c @@ -560,7 +560,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, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) && + if (path_find_symbol_file(pcs, module, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) && (hFile = CreateFileA(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 9778ba52557..0b9cafb96c7 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: f333c4a210e25bbb8af2adeeae0dbe006354519b + wine: 6030ee5f6f64a2ebe6df2e505e2588eb300222c2
4 years
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
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