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] 154/179: [WINESYNC] dbghelp: Don't bother trying to initialize loader backend if we can't get debug base address from PEB.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e2e7cce46f0c587da93f9…
commit e2e7cce46f0c587da93f9bed8fa5dfd8673bd97c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:43 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:56 2020 +0200 [WINESYNC] dbghelp: Don't bother trying to initialize loader backend if we can't get debug base address from PEB. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3047385437c7ef36996d0418ac378677f3e9d67c by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/dbghelp.c | 5 +++++ dll/win32/dbghelp/macho_module.c | 3 +-- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c index a5acc786606..a92b3dd2893 100644 --- a/dll/win32/dbghelp/dbghelp.c +++ b/dll/win32/dbghelp/dbghelp.c @@ -309,6 +309,11 @@ static BOOL check_live_target(struct process* pcs) base = base32; } else ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], &base, sizeof(base), NULL); +#ifndef __REACTOS__ + /* Wine store their loader base address in peb.reserved[0] and load its symbol from there. + * ReactOS does not care about it */ + if (!base) return FALSE; +#endif 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); diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 8aa232e1ed2..413a25c663d 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -1845,8 +1845,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in len = sizeof(image_infos.infos64); else len = sizeof(image_infos.infos32); - if (pcs->dbg_hdr_addr && - ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) + if (ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &image_infos, len, NULL)) { if (pcs->is_64bit) len = sizeof(image_info.info64); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 4b2aa38d50d..4018c66b2e1 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: f2b8af7e7e159a5259aaab42169c4f8220b121eb + wine: 3047385437c7ef36996d0418ac378677f3e9d67c
4 years, 3 months
1
0
0
0
[reactos] 153/179: [WINESYNC] dbghelp: Get rid of get_dyld_image_info_address.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13d60fef36e09b84008de…
commit 13d60fef36e09b84008de8ec239e4fd72729cba6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:43 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:55 2020 +0200 [WINESYNC] dbghelp: Get rid of get_dyld_image_info_address. We should get the address from PEB anyway. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f2b8af7e7e159a5259aaab42169c4f8220b121eb by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 45 +--------------------------------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 795b8500d9d..8aa232e1ed2 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -37,12 +37,6 @@ #include <assert.h> #include <stdarg.h> #include <errno.h> -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef HAVE_SYS_MMAN_H -# include <sys/mman.h> -#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -54,8 +48,6 @@ #ifdef HAVE_MACH_O_LOADER_H -#include <mach-o/nlist.h> - struct dyld_image_info32 { UINT32 imageLoadAddress; /* const struct mach_header* */ @@ -1455,41 +1447,6 @@ static void macho_module_remove(struct process* pcs, struct module_format* modfm HeapFree(GetProcessHeap(), 0, modfmt); } -/****************************************************************** - * get_dyld_image_info_address - */ -static ULONG_PTR get_dyld_image_info_address(struct process* pcs) -{ - ULONG_PTR dyld_image_info_address = 0; - -#ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ - if (!dyld_image_info_address) - { - static void* dyld_all_image_infos_addr; - - /* Our next best guess is that dyld was loaded at its base address - and we can find the dyld image infos address by looking up its symbol. */ - if (!dyld_all_image_infos_addr) - { - struct nlist nl[2]; - memset(nl, 0, sizeof(nl)); - nl[0].n_un.n_name = (char*)"_dyld_all_image_infos"; - if (!nlist("/usr/lib/dyld", nl)) - dyld_all_image_infos_addr = (void*)nl[0].n_value; - } - - if (dyld_all_image_infos_addr) - { - TRACE("got dyld_image_info_address %p from /usr/lib/dyld symbol table\n", - dyld_all_image_infos_addr); - dyld_image_info_address = (ULONG_PTR)dyld_all_image_infos_addr; - } - } -#endif - - return dyld_image_info_address; -} - /****************************************************************** * macho_load_file * @@ -1964,7 +1921,7 @@ 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); - pcs->dbg_hdr_addr = addr ? addr : get_dyld_image_info_address(pcs); + pcs->dbg_hdr_addr = addr; 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; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 93502e635a9..4b2aa38d50d 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: dab78486d3d0063e32e99fb795311b74eb632d3a + wine: f2b8af7e7e159a5259aaab42169c4f8220b121eb
4 years, 3 months
1
0
0
0
[reactos] 152/179: [WINESYNC] dbghelp: Don't use _NSGetExecutablePath in macho_search_loader.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7a5f84b3a8c8b4f64f043…
commit 7a5f84b3a8c8b4f64f043f5acd5d54d114ac1415 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:43 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:55 2020 +0200 [WINESYNC] dbghelp: Don't use _NSGetExecutablePath in macho_search_loader. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id dab78486d3d0063e32e99fb795311b74eb632d3a by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 13 ------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index e33313ec639..795b8500d9d 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -55,7 +55,6 @@ #ifdef HAVE_MACH_O_LOADER_H #include <mach-o/nlist.h> -#include <mach-o/dyld.h> struct dyld_image_info32 { @@ -1923,18 +1922,6 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in } } - /* If we couldn't get the executable path from the target process, try our - own. It will almost always be the same. */ - if (!got_path) - { - len = sizeof(path); - if (!_NSGetExecutablePath(path, &len)) - { - got_path = TRUE; - TRACE("using own executable path: %s\n", debugstr_a(path)); - } - } - if (got_path) { WCHAR* pathW; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index b1cbcf02a21..93502e635a9 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: e341bd7fe4f2572597ee10cbed5bb2a76ddcc03a + wine: dab78486d3d0063e32e99fb795311b74eb632d3a
4 years, 3 months
1
0
0
0
[reactos] 151/179: [WINESYNC] dbghelp: Use local constants definitions instead of mach-o/loader.h.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad13638bd6c772c4c9124…
commit ad13638bd6c772c4c9124df8087242fec027a803 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:43 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:55 2020 +0200 [WINESYNC] dbghelp: Use local constants definitions instead of mach-o/loader.h. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id e341bd7fe4f2572597ee10cbed5bb2a76ddcc03a by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 40 +++++++++++++++++++++++++++------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 026f2191a2e..e33313ec639 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -54,7 +54,6 @@ #ifdef HAVE_MACH_O_LOADER_H -#include <mach-o/loader.h> #include <mach-o/nlist.h> #include <mach-o/dyld.h> @@ -173,6 +172,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho); #define MACHO_CPU_TYPE_X86 0x00000007 #define MACHO_CPU_TYPE_X86_64 0x01000007 +#define MACHO_MH_EXECUTE 0x2 +#define MACHO_MH_DYLIB 0x6 +#define MACHO_MH_DYLINKER 0x7 +#define MACHO_MH_BUNDLE 0x8 +#define MACHO_MH_DSYM 0xa + +#define MACHO_LC_SEGMENT 0x01 +#define MACHO_LC_SYMTAB 0x02 +#define MACHO_LC_SEGMENT_64 0x19 +#define MACHO_LC_UUID 0x1b + +#define MACHO_SECTION_TYPE 0x000000ff +#define MACHO_S_ATTR_PURE_INSTRUCTIONS 0x80000000 +#define MACHO_S_ATTR_SOME_INSTRUCTIONS 0x00000400 + #define UUID_STRING_LEN 37 /* 16 bytes at 2 hex digits apiece, 4 dashes, and the null terminator */ @@ -660,7 +674,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach /* 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, so ignore them. */ - ignore = (info->split_segs && strcmp(segname, SEG_TEXT)); + ignore = (info->split_segs && strcmp(segname, "__TEXT")); if (!strncmp(segname, "WINE_", 5)) TRACE("Ignoring special Wine segment %s\n", debugstr_an(segname, sizeof(segname))); @@ -750,7 +764,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, BOOL ret = FALSE; UINT32 target_cpu = (pcs->is_64bit) ? MACHO_CPU_TYPE_X86_64 : MACHO_CPU_TYPE_X86; UINT32 target_magic = (pcs->is_64bit) ? MACHO_MH_MAGIC_64 : MACHO_MH_MAGIC_32; - UINT32 target_cmd = (pcs->is_64bit) ? LC_SEGMENT_64 : LC_SEGMENT; + UINT32 target_cmd = (pcs->is_64bit) ? MACHO_LC_SEGMENT_64 : MACHO_LC_SEGMENT; DWORD bytes_read; struct @@ -831,11 +845,11 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, /* Make sure the file type is one of the ones we expect. */ switch (mach_header.filetype) { - case MH_EXECUTE: - case MH_DYLIB: - case MH_DYLINKER: - case MH_BUNDLE: - case MH_DSYM: + case MACHO_MH_EXECUTE: + case MACHO_MH_DYLIB: + case MACHO_MH_DYLINKER: + case MACHO_MH_BUNDLE: + case MACHO_MH_DSYM: break; default: goto done; @@ -866,7 +880,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, 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) + if (macho_enum_load_commands(ifm, MACHO_LC_UUID, find_uuid, NULL) < 0) goto done; if (fmap->uuid) { @@ -939,8 +953,8 @@ static BOOL macho_sect_is_code(struct macho_file_map* fmap, unsigned char sectid sectidx--; /* convert from 1-based to 0-based */ if (sectidx >= fmap->num_sections || fmap->sect[sectidx].ignored) return FALSE; - ret = (!(fmap->sect[sectidx].section.flags & SECTION_TYPE) && - (fmap->sect[sectidx].section.flags & (S_ATTR_PURE_INSTRUCTIONS|S_ATTR_SOME_INSTRUCTIONS))); + ret = (!(fmap->sect[sectidx].section.flags & MACHO_SECTION_TYPE) && + (fmap->sect[sectidx].section.flags & (MACHO_S_ATTR_PURE_INSTRUCTIONS | MACHO_S_ATTR_SOME_INSTRUCTIONS))); TRACE("-> %d\n", ret); return ret; } @@ -1389,7 +1403,7 @@ static BOOL macho_load_debug_info(struct process *pcs, struct module* module) mdi.module = module; pool_init(&mdi.pool, 65536); hash_table_init(&mdi.pool, &mdi.ht_symtab, 256); - result = macho_enum_load_commands(ifm, LC_SYMTAB, macho_parse_symtab, &mdi); + result = macho_enum_load_commands(ifm, MACHO_LC_SYMTAB, macho_parse_symtab, &mdi); if (result > 0) ret = TRUE; else if (result < 0) @@ -1398,7 +1412,7 @@ static BOOL macho_load_debug_info(struct process *pcs, struct module* module) if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY) && fmap->dsym) { mdi.fmap = &fmap->dsym->u.macho; - result = macho_enum_load_commands(fmap->dsym, LC_SYMTAB, macho_parse_symtab, &mdi); + result = macho_enum_load_commands(fmap->dsym, MACHO_LC_SYMTAB, macho_parse_symtab, &mdi); if (result > 0) ret = TRUE; else if (result < 0) diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index c9dcb220d12..b1cbcf02a21 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: 1420e64e5f1df4c8bbb016d1b8ff71337cda4884 + wine: e341bd7fe4f2572597ee10cbed5bb2a76ddcc03a
4 years, 3 months
1
0
0
0
[reactos] 150/179: [WINESYNC] dbghelp: Don't use stdint.h types.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1358cd2d9ba5e833aa1f6…
commit 1358cd2d9ba5e833aa1f69d726eb7cb6609f7fab Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:42 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:55 2020 +0200 [WINESYNC] dbghelp: Don't use stdint.h types. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 1420e64e5f1df4c8bbb016d1b8ff71337cda4884 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 48 ++++++++++++++++++++++------------------ sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 093b853dcd2..026f2191a2e 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -58,28 +58,32 @@ #include <mach-o/nlist.h> #include <mach-o/dyld.h> -struct dyld_image_info32 { - uint32_t /* const struct mach_header* */ imageLoadAddress; - uint32_t /* const char* */ imageFilePath; - uint32_t /* uintptr_t */ imageFileModDate; +struct dyld_image_info32 +{ + UINT32 imageLoadAddress; /* const struct mach_header* */ + UINT32 imageFilePath; /* const char* */ + UINT32 imageFileModDate; /* uintptr_t */ }; -struct dyld_all_image_infos32 { - uint32_t version; - uint32_t infoArrayCount; - uint32_t /* const struct dyld_image_info* */ infoArray; +struct dyld_all_image_infos32 +{ + UINT32 version; + UINT32 infoArrayCount; + UINT32 infoArray; /* const struct dyld_image_info* */ }; -struct dyld_image_info64 { - uint64_t /* const struct mach_header* */ imageLoadAddress; - uint64_t /* const char* */ imageFilePath; - uint64_t /* uintptr_t */ imageFileModDate; +struct dyld_image_info64 +{ + UINT64 imageLoadAddress; /* const struct mach_header* */ + UINT64 imageFilePath; /* const char* */ + UINT64 imageFileModDate; /* uintptr_t */ }; -struct dyld_all_image_infos64 { - uint32_t version; - uint32_t infoArrayCount; - uint64_t /* const struct dyld_image_info* */ infoArray; +struct dyld_all_image_infos64 +{ + UINT32 version; + UINT32 infoArrayCount; + UINT64 infoArray; /* const struct dyld_image_info* */ }; union wine_image_info { @@ -198,7 +202,7 @@ struct macho_info static void macho_unmap_file(struct image_file_map* fmap); -static char* format_uuid(const uint8_t uuid[16], char out[UUID_STRING_LEN]) +static char* format_uuid(const UINT8 uuid[16], char out[UUID_STRING_LEN]) { sprintf(out, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], @@ -588,7 +592,7 @@ static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd, static int macho_count_sections(struct image_file_map* ifm, const struct macho_load_command* lc, void* user) { char segname[16]; - uint32_t nsects; + size_t nsects; if (ifm->addr_size == 32) { @@ -624,9 +628,9 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach BOOL ignore; int i; ULONG_PTR tmp, page_mask = sysinfo.dwPageSize - 1; - uint64_t vmaddr, vmsize; + UINT64 vmaddr, vmsize; char segname[16]; - uint32_t nsects; + size_t nsects; const void *sections; if (ifm->addr_size == 32) @@ -746,7 +750,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, BOOL ret = FALSE; UINT32 target_cpu = (pcs->is_64bit) ? MACHO_CPU_TYPE_X86_64 : MACHO_CPU_TYPE_X86; UINT32 target_magic = (pcs->is_64bit) ? MACHO_MH_MAGIC_64 : MACHO_MH_MAGIC_32; - uint32_t target_cmd = (pcs->is_64bit) ? LC_SEGMENT_64 : LC_SEGMENT; + UINT32 target_cmd = (pcs->is_64bit) ? LC_SEGMENT_64 : LC_SEGMENT; DWORD bytes_read; struct @@ -1863,7 +1867,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in BOOL ret = FALSE; union wine_all_image_infos image_infos; union wine_image_info image_info; - uint32_t len; + unsigned int len; char path[PATH_MAX]; BOOL got_path = FALSE; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index f27a525b0f0..c9dcb220d12 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: 0c56a8f87bac01488349af0ffe3923a1672e72a0 + wine: 1420e64e5f1df4c8bbb016d1b8ff71337cda4884
4 years, 3 months
1
0
0
0
[reactos] 149/179: [WINESYNC] dbghelp.c: Use local mach header declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95450374ace951d229c29…
commit 95450374ace951d229c29a09aec312ed76acd8d6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:42 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:55 2020 +0200 [WINESYNC] dbghelp.c: Use local mach header declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 0c56a8f87bac01488349af0ffe3923a1672e72a0 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 39 ++++++++++++++++++++++++++++----------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 4ca9bee48ec..093b853dcd2 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -92,6 +92,18 @@ union wine_all_image_infos { struct dyld_all_image_infos64 infos64; }; +struct macho_header +{ + UINT32 magic; /* mach magic number identifier */ + UINT32 cputype; /* cpu specifier */ + UINT32 cpusubtype; /* machine specifier */ + UINT32 filetype; /* type of file */ + UINT32 ncmds; /* number of load commands */ + UINT32 sizeofcmds; /* the size of all the load commands */ + UINT32 flags; /* flags */ + UINT32 reserved; /* reserved */ +}; + struct macho_segment_command { UINT32 cmd; /* LC_SEGMENT_64 */ @@ -150,7 +162,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho); memory by dyld. */ #define MACHO_DYLD_IN_SHARED_CACHE 0x80000000 -#define MACHO_FAT_MAGIC 0xcafebabe +#define MACHO_FAT_MAGIC 0xcafebabe +#define MACHO_MH_MAGIC_32 0xfeedface +#define MACHO_MH_MAGIC_64 0xfeedfacf + +#define MACHO_CPU_TYPE_X86 0x00000007 +#define MACHO_CPU_TYPE_X86_64 0x01000007 #define UUID_STRING_LEN 37 /* 16 bytes at 2 hex digits apiece, 4 dashes, and the null terminator */ @@ -722,13 +739,13 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, BOOL split_segs, struct image_file_map* ifm) { struct macho_file_map* fmap = &ifm->u.macho; - struct mach_header mach_header; + struct macho_header mach_header; int i; WCHAR* filename; struct section_info info; BOOL ret = FALSE; - cpu_type_t target_cpu = (pcs->is_64bit) ? CPU_TYPE_X86_64 : CPU_TYPE_X86; - uint32_t target_magic = (pcs->is_64bit) ? MH_MAGIC_64 : MH_MAGIC; + UINT32 target_cpu = (pcs->is_64bit) ? MACHO_CPU_TYPE_X86_64 : MACHO_CPU_TYPE_X86; + UINT32 target_magic = (pcs->is_64bit) ? MACHO_MH_MAGIC_64 : MACHO_MH_MAGIC_32; uint32_t target_cmd = (pcs->is_64bit) ? LC_SEGMENT_64 : LC_SEGMENT; DWORD bytes_read; @@ -746,7 +763,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, ifm->ops = &macho_file_map_ops; ifm->alternate = NULL; ifm->addr_size = (pcs->is_64bit) ? 64 : 32; - fmap->header_size = (pcs->is_64bit) ? sizeof(struct mach_header_64) : sizeof(struct mach_header); + fmap->header_size = (pcs->is_64bit) ? sizeof(struct macho_header) : FIELD_OFFSET(struct macho_header, reserved); if (!(filename = get_dos_file_name(filenameW))) return FALSE; @@ -799,8 +816,8 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, /* Individual architecture (standalone or within a fat file) is in its native byte order. */ SetFilePointer(fmap->handle, fmap->arch_offset, 0, FILE_BEGIN); - if (!ReadFile(fmap->handle, &mach_header, sizeof(mach_header), &bytes_read, NULL) - || bytes_read != sizeof(mach_header)) + if (!ReadFile(fmap->handle, &mach_header, fmap->header_size, &bytes_read, NULL) + || bytes_read != fmap->header_size) goto done; TRACE("... got possible Mach header\n"); /* and check for a Mach-O header */ @@ -1314,11 +1331,11 @@ static BOOL image_uses_split_segs(struct process* process, ULONG_PTR load_addr) if (load_addr) { - cpu_type_t target_cpu = (process->is_64bit) ? CPU_TYPE_X86_64 : CPU_TYPE_X86; - uint32_t target_magic = (process->is_64bit) ? MH_MAGIC_64 : MH_MAGIC; - struct mach_header header; + UINT32 target_cpu = (process->is_64bit) ? MACHO_CPU_TYPE_X86_64 : MACHO_CPU_TYPE_X86; + UINT32 target_magic = (process->is_64bit) ? MACHO_MH_MAGIC_64 : MACHO_MH_MAGIC_32; + struct macho_header header; - if (ReadProcessMemory(process->handle, (void*)load_addr, &header, sizeof(header), NULL) && + if (ReadProcessMemory(process->handle, (void*)load_addr, &header, FIELD_OFFSET(struct macho_header, reserved), NULL) && header.magic == target_magic && header.cputype == target_cpu && header.flags & MACHO_DYLD_IN_SHARED_CACHE) { diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 1b194b5e913..f27a525b0f0 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: 7b2e53f5b550e8a4d844c5e74941b02d1c770b0b + wine: 0c56a8f87bac01488349af0ffe3923a1672e72a0
4 years, 3 months
1
0
0
0
[reactos] 148/179: [WINESYNC] dbghelp: Use local symtab and segment commands declarations.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92dc946e863a8b8c3638e…
commit 92dc946e863a8b8c3638e6c17350cb1e5111aa65 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:41 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:54 2020 +0200 [WINESYNC] dbghelp: Use local symtab and segment commands declarations. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7b2e53f5b550e8a4d844c5e74941b02d1c770b0b by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 50 ++++++++++++++++++++++++++++++++++++---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 6710385a88c..4ca9bee48ec 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -92,6 +92,46 @@ union wine_all_image_infos { struct dyld_all_image_infos64 infos64; }; +struct macho_segment_command +{ + UINT32 cmd; /* LC_SEGMENT_64 */ + UINT32 cmdsize; /* includes sizeof section_64 structs */ + char segname[16]; /* segment name */ + UINT64 vmaddr; /* memory address of this segment */ + UINT64 vmsize; /* memory size of this segment */ + UINT64 fileoff; /* file offset of this segment */ + UINT64 filesize; /* amount to map from the file */ + UINT32 maxprot; /* maximum VM protection */ + UINT32 initprot; /* initial VM protection */ + UINT32 nsects; /* number of sections in segment */ + UINT32 flags; /* flags */ +}; + +struct macho_segment_command32 +{ + UINT32 cmd; /* LC_SEGMENT */ + UINT32 cmdsize; /* includes sizeof section structs */ + char segname[16]; /* segment name */ + UINT32 vmaddr; /* memory address of this segment */ + UINT32 vmsize; /* memory size of this segment */ + UINT32 fileoff; /* file offset of this segment */ + UINT32 filesize; /* amount to map from the file */ + UINT32 maxprot; /* maximum VM protection */ + UINT32 initprot; /* initial VM protection */ + UINT32 nsects; /* number of sections in segment */ + UINT32 flags; /* flags */ +}; + +struct macho_symtab_command +{ + UINT32 cmd; /* LC_SYMTAB */ + UINT32 cmdsize; /* sizeof(struct symtab_command) */ + UINT32 symoff; /* symbol table offset */ + UINT32 nsyms; /* number of symbol table entries */ + UINT32 stroff; /* string table offset */ + UINT32 strsize; /* string table size in bytes */ +}; + #ifdef WORDS_BIGENDIAN #define swap_ulong_be_to_host(n) (n) #else @@ -535,13 +575,13 @@ static int macho_count_sections(struct image_file_map* ifm, const struct macho_l if (ifm->addr_size == 32) { - const struct segment_command *sc = (const struct segment_command *)lc; + const struct macho_segment_command32 *sc = (const struct macho_segment_command32 *)lc; memcpy(segname, sc->segname, sizeof(segname)); nsects = sc->nsects; } else { - const struct segment_command_64 *sc = (const struct segment_command_64 *)lc; + const struct macho_segment_command *sc = (const struct macho_segment_command *)lc; memcpy(segname, sc->segname, sizeof(segname)); nsects = sc->nsects; } @@ -574,7 +614,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach if (ifm->addr_size == 32) { - const struct segment_command *sc = (const struct segment_command *)lc; + const struct macho_segment_command32 *sc = (const struct macho_segment_command32 *)lc; vmaddr = sc->vmaddr; vmsize = sc->vmsize; memcpy(segname, sc->segname, sizeof(segname)); @@ -583,7 +623,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach } else { - const struct segment_command_64 *sc = (const struct segment_command_64 *)lc; + const struct macho_segment_command *sc = (const struct macho_segment_command *)lc; vmaddr = sc->vmaddr; vmsize = sc->vmsize; memcpy(segname, sc->segname, sizeof(segname)); @@ -943,7 +983,7 @@ static int macho_parse_symtab(struct image_file_map* ifm, const struct macho_load_command* lc, void* user) { struct macho_file_map* fmap = &ifm->u.macho; - const struct symtab_command* sc = (const struct symtab_command*)lc; + const struct macho_symtab_command* sc = (const struct macho_symtab_command*)lc; struct macho_debug_info* mdi = user; const char* stabstr; int ret = 0; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 7bb2f98904c..1b194b5e913 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: 8230889f1f2e545222f3a51ba9b47fa02196eb98 + wine: 7b2e53f5b550e8a4d844c5e74941b02d1c770b0b
4 years, 3 months
1
0
0
0
[reactos] 147/179: [WINESYNC] dbghelp: Use local fat header declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=63f681c1e6743b9996640…
commit 63f681c1e6743b99966401c600b93d014175ffc7 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 19:00:41 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:54 2020 +0200 [WINESYNC] dbghelp: Use local fat header declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8230889f1f2e545222f3a51ba9b47fa02196eb98 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/macho_module.c | 21 +++++++++++++++++---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 0e532c354b3..6710385a88c 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -54,7 +54,6 @@ #ifdef HAVE_MACH_O_LOADER_H -#include <mach-o/fat.h> #include <mach-o/loader.h> #include <mach-o/nlist.h> #include <mach-o/dyld.h> @@ -111,6 +110,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho); memory by dyld. */ #define MACHO_DYLD_IN_SHARED_CACHE 0x80000000 +#define MACHO_FAT_MAGIC 0xcafebabe #define UUID_STRING_LEN 37 /* 16 bytes at 2 hex digits apiece, 4 dashes, and the null terminator */ @@ -682,7 +682,6 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, BOOL split_segs, struct image_file_map* ifm) { struct macho_file_map* fmap = &ifm->u.macho; - struct fat_header fat_header; struct mach_header mach_header; int i; WCHAR* filename; @@ -693,6 +692,12 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, uint32_t target_cmd = (pcs->is_64bit) ? LC_SEGMENT_64 : LC_SEGMENT; DWORD bytes_read; + struct + { + UINT32 magic; /* FAT_MAGIC or FAT_MAGIC_64 */ + UINT32 nfat_arch; /* number of structs that follow */ + } fat_header; + TRACE("(%s, %p)\n", debugstr_w(filenameW), fmap); reset_file_map(ifm); @@ -721,12 +726,20 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, TRACE("... got possible fat header\n"); /* Fat header is always in big-endian order. */ - if (swap_ulong_be_to_host(fat_header.magic) == FAT_MAGIC) + if (swap_ulong_be_to_host(fat_header.magic) == MACHO_FAT_MAGIC) { int narch = swap_ulong_be_to_host(fat_header.nfat_arch); for (i = 0; i < narch; i++) { - struct fat_arch fat_arch; + struct + { + UINT32 cputype; /* cpu specifier (int) */ + UINT32 cpusubtype; /* machine specifier (int) */ + UINT32 offset; /* file offset to this object file */ + UINT32 size; /* size of this object file */ + UINT32 align; /* alignment as a power of 2 */ + } fat_arch; + if (!ReadFile(fmap->handle, &fat_arch, sizeof(fat_arch), &bytes_read, NULL) || bytes_read != sizeof(fat_arch)) goto done; if (swap_ulong_be_to_host(fat_arch.cputype) == target_cpu) diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index c05f3af56ae..7bb2f98904c 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: 64341284c58bcc22f13f8146bcb6c8a08c0c4ff2 + wine: 8230889f1f2e545222f3a51ba9b47fa02196eb98
4 years, 3 months
1
0
0
0
[reactos] 146/179: [WINESYNC] dbghelp: Use local macho section declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eff9360f470df98758c0f…
commit eff9360f470df98758c0fb103632cc0349a91d1d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:59:48 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:54 2020 +0200 [WINESYNC] dbghelp: Use local macho section declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 64341284c58bcc22f13f8146bcb6c8a08c0c4ff2 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/image_private.h | 45 ++++++++++++++++++++++++++++----------- dll/win32/dbghelp/macho_module.c | 4 ++-- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 947ee4aee67..1a5a24bc580 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -21,16 +21,6 @@ #pragma once -#ifdef HAVE_LINK_H -# include <link.h> -#endif -#ifdef HAVE_SYS_LINK_H -# include <sys/link.h> -#endif -#ifdef HAVE_MACH_O_LOADER_H -#include <mach-o/loader.h> -#endif - #define IMAGE_NO_MAP ((void*)-1) struct elf_header @@ -78,6 +68,37 @@ struct macho_uuid_command UINT8 uuid[16]; }; +struct macho_section +{ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + UINT64 addr; /* memory address of this section */ + UINT64 size; /* size in bytes of this section */ + UINT32 offset; /* file offset of this section */ + UINT32 align; /* section alignment (power of 2) */ + UINT32 reloff; /* file offset of relocation entries */ + UINT32 nreloc; /* number of relocation entries */ + UINT32 flags; /* flags (section type and attributes)*/ + UINT32 reserved1; /* reserved (for offset or index) */ + UINT32 reserved2; /* reserved (for count or sizeof) */ + UINT32 reserved3; /* reserved */ +}; + +struct macho_section32 +{ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + UINT32 addr; /* memory address of this section */ + UINT32 size; /* size in bytes of this section */ + UINT32 offset; /* file offset of this section */ + UINT32 align; /* section alignment (power of 2) */ + UINT32 reloff; /* file offset of relocation entries */ + UINT32 nreloc; /* number of relocation entries */ + UINT32 flags; /* flags (section type and attributes)*/ + UINT32 reserved1; /* reserved (for offset or index) */ + UINT32 reserved2; /* reserved (for count or sizeof) */ +}; + /* structure holding information while handling an ELF image * allows one by one section mapping for memory savings */ @@ -120,15 +141,13 @@ struct image_file_map * read from arch_offset. */ unsigned arch_offset; -#ifdef HAVE_MACH_O_LOADER_H int num_sections; struct { - struct section_64 section; + struct macho_section section; const char* mapped; unsigned int ignored : 1; }* sect; -#endif } macho; struct pe_file_map { diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index ac4e8cbb7e5..0e532c354b3 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -624,7 +624,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach { if (ifm->addr_size == 32) { - const struct section *section = &((const struct section *)sections)[i]; + const struct macho_section32 *section = &((const struct macho_section32 *)sections)[i]; memcpy(fmap->sect[info->section_index].section.sectname, section->sectname, sizeof(section->sectname)); memcpy(fmap->sect[info->section_index].section.segname, section->segname, sizeof(section->segname)); fmap->sect[info->section_index].section.addr = section->addr; @@ -636,7 +636,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct mach fmap->sect[info->section_index].section.flags = section->flags; } else - fmap->sect[info->section_index].section = ((const struct section_64 *)sections)[i]; + fmap->sect[info->section_index].section = ((const struct macho_section *)sections)[i]; fmap->sect[info->section_index].mapped = IMAGE_NO_MAP; fmap->sect[info->section_index].ignored = ignore; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index b5400813eb8..c05f3af56ae 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: c695e7e99e0a06b6039d46f98fea35c363aa6cbe + wine: 64341284c58bcc22f13f8146bcb6c8a08c0c4ff2
4 years, 3 months
1
0
0
0
[reactos] 145/179: [WINESYNC] dbghelp: Use local macho load command declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=739259ac2f74da4a8c5b9…
commit 739259ac2f74da4a8c5b91774b602ad1619d1478 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:59:48 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:54 2020 +0200 [WINESYNC] dbghelp: Use local macho load command declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id c695e7e99e0a06b6039d46f98fea35c363aa6cbe by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/image_private.h | 19 ++++++++++++++++--- dll/win32/dbghelp/macho_module.c | 22 +++++++++++----------- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 6406c2e43e3..947ee4aee67 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -65,6 +65,19 @@ struct elf_section_header UINT64 sh_entsize; /* Entry size if section holds table */ }; +struct macho_load_command +{ + UINT32 cmd; /* type of load command */ + UINT32 cmdsize; /* total size of command in bytes */ +}; + +struct macho_uuid_command +{ + UINT32 cmd; /* LC_UUID */ + UINT32 cmdsize; + UINT8 uuid[16]; +}; + /* structure holding information while handling an ELF image * allows one by one section mapping for memory savings */ @@ -100,14 +113,14 @@ struct image_file_map size_t commands_size; size_t commands_count; -#ifdef HAVE_MACH_O_LOADER_H - const struct load_command* load_commands; - const struct uuid_command* uuid; + const struct macho_load_command* load_commands; + const struct macho_uuid_command* uuid; /* The offset in the file which is this architecture. mach_header was * read from arch_offset. */ unsigned arch_offset; +#ifdef HAVE_MACH_O_LOADER_H int num_sections; struct { diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 5d3f8615e87..ac4e8cbb7e5 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -443,11 +443,11 @@ static const struct image_file_map_ops macho_file_map_ops = * * Maps the load commands from a Mach-O file into memory */ -static const struct load_command* macho_map_load_commands(struct macho_file_map* fmap) +static const struct macho_load_command* macho_map_load_commands(struct macho_file_map* fmap) { if (fmap->load_commands == IMAGE_NO_MAP) { - fmap->load_commands = (const struct load_command*) macho_map_range( + fmap->load_commands = (const struct macho_load_command*) macho_map_range( fmap, fmap->header_size, fmap->commands_size, NULL); TRACE("Mapped load commands: %p\n", fmap->load_commands); } @@ -475,9 +475,9 @@ static void macho_unmap_load_commands(struct macho_file_map* fmap) * * Advance to the next load command */ -static const struct load_command* macho_next_load_command(const struct load_command* lc) +static const struct macho_load_command* macho_next_load_command(const struct macho_load_command* lc) { - return (const struct load_command*)((const char*)lc + lc->cmdsize); + return (const struct macho_load_command*)((const char*)lc + lc->cmdsize); } /****************************************************************** @@ -492,11 +492,11 @@ static const struct load_command* macho_next_load_command(const struct load_comm * processed. */ static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd, - int (*cb)(struct image_file_map*, const struct load_command*, void*), + int (*cb)(struct image_file_map*, const struct macho_load_command*, void*), void* user) { struct macho_file_map* fmap = &ifm->u.macho; - const struct load_command* lc; + const struct macho_load_command* lc; int i; int count = 0; @@ -528,7 +528,7 @@ static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd, * significant sections in a Mach-O file. All commands are * expected to be of LC_SEGMENT[_64] type. */ -static int macho_count_sections(struct image_file_map* ifm, const struct load_command* lc, void* user) +static int macho_count_sections(struct image_file_map* ifm, const struct macho_load_command* lc, void* user) { char segname[16]; uint32_t nsects; @@ -560,7 +560,7 @@ static int macho_count_sections(struct image_file_map* ifm, const struct load_co * range covered by the segments of a Mach-O file and builds the * section map. All commands are expected to be of LC_SEGMENT[_64] type. */ -static int macho_load_section_info(struct image_file_map* ifm, const struct load_command* lc, void* user) +static int macho_load_section_info(struct image_file_map* ifm, const struct macho_load_command* lc, void* user) { struct macho_file_map* fmap = &ifm->u.macho; struct section_info* info = user; @@ -652,9 +652,9 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load * Callback for macho_enum_load_commands. Records the UUID load * command of a Mach-O file. */ -static int find_uuid(struct image_file_map* ifm, const struct load_command* lc, void* user) +static int find_uuid(struct image_file_map* ifm, const struct macho_load_command* lc, void* user) { - ifm->u.macho.uuid = (const struct uuid_command*)lc; + ifm->u.macho.uuid = (const struct macho_uuid_command*)lc; return 1; } @@ -927,7 +927,7 @@ static void macho_stabs_def_cb(struct module* module, ULONG_PTR load_offset, * load commands from the Mach-O file. */ static int macho_parse_symtab(struct image_file_map* ifm, - const struct load_command* lc, void* user) + const struct macho_load_command* lc, void* user) { struct macho_file_map* fmap = &ifm->u.macho; const struct symtab_command* sc = (const struct symtab_command*)lc; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 504be41c2ab..b5400813eb8 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: 7254579417f337063734933975b25d21da4d31f3 + wine: c695e7e99e0a06b6039d46f98fea35c363aa6cbe
4 years, 3 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
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