[WINESYNC] dbghelp: Fix loading of Mach-O load commands for 64-bit binaries.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 3ff8fa7ed1d28b38703125b0c8c632410e3fd980 by Ken Thomases <ken@codeweavers.com>
This commit is contained in:
winesync 2020-09-11 13:16:16 +02:00 committed by Jérôme Gardou
parent 4e89603929
commit 148591a8a6
3 changed files with 5 additions and 3 deletions

View file

@ -91,6 +91,7 @@ struct image_file_map
#ifdef HAVE_MACH_O_LOADER_H
struct mach_header mach_header;
size_t header_size; /* size of real header in file */
const struct load_command* load_commands;
const struct uuid_command* uuid;

View file

@ -415,7 +415,7 @@ static const struct load_command* macho_map_load_commands(struct macho_file_map*
if (fmap->load_commands == IMAGE_NO_MAP)
{
fmap->load_commands = (const struct load_command*) macho_map_range(
fmap, sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds, NULL);
fmap, fmap->header_size, fmap->mach_header.sizeofcmds, NULL);
TRACE("Mapped load commands: %p\n", fmap->load_commands);
}
@ -433,7 +433,7 @@ static void macho_unmap_load_commands(struct macho_file_map* fmap)
{
TRACE("Unmapping load commands: %p\n", fmap->load_commands);
macho_unmap_range(NULL, (const void**)&fmap->load_commands, fmap,
sizeof(fmap->mach_header), fmap->mach_header.sizeofcmds);
fmap->header_size, fmap->mach_header.sizeofcmds);
}
}
@ -666,6 +666,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
ifm->modtype = DMT_MACHO;
ifm->addr_size = (pcs->is_64bit) ? 64 : 32;
fmap->header_size = (pcs->is_64bit) ? sizeof(struct mach_header_64) : sizeof(struct mach_header);
len = WideCharToMultiByte(CP_UNIXCP, 0, filenameW, -1, NULL, 0, NULL, NULL);
if (!(filename = HeapAlloc(GetProcessHeap(), 0, len)))

View file

@ -3,4 +3,4 @@ directories:
files:
include/dbghelp.h: sdk/include/psdk/dbghelp.h
tags:
wine: 053a7e225c8190fd7416b3f3c3186f1ac230eeb3
wine: 3ff8fa7ed1d28b38703125b0c8c632410e3fd980