Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8230889f
Commit
8230889f
authored
Apr 01, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use local fat header declaration.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
64341284
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
macho_module.c
dlls/dbghelp/macho_module.c
+17
-4
No files found.
dlls/dbghelp/macho_module.c
View file @
8230889f
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
#ifdef HAVE_MACH_O_LOADER_H
#ifdef HAVE_MACH_O_LOADER_H
#include <mach-o/fat.h>
#include <mach-o/loader.h>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#include <mach-o/nlist.h>
#include <mach-o/dyld.h>
#include <mach-o/dyld.h>
...
@@ -111,6 +110,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho);
...
@@ -111,6 +110,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho);
memory by dyld. */
memory by dyld. */
#define MACHO_DYLD_IN_SHARED_CACHE 0x80000000
#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 */
#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,
...
@@ -682,7 +682,6 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
BOOL
split_segs
,
struct
image_file_map
*
ifm
)
BOOL
split_segs
,
struct
image_file_map
*
ifm
)
{
{
struct
macho_file_map
*
fmap
=
&
ifm
->
u
.
macho
;
struct
macho_file_map
*
fmap
=
&
ifm
->
u
.
macho
;
struct
fat_header
fat_header
;
struct
mach_header
mach_header
;
struct
mach_header
mach_header
;
int
i
;
int
i
;
WCHAR
*
filename
;
WCHAR
*
filename
;
...
@@ -693,6 +692,12 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
...
@@ -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
;
uint32_t
target_cmd
=
(
pcs
->
is_64bit
)
?
LC_SEGMENT_64
:
LC_SEGMENT
;
DWORD
bytes_read
;
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
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
filenameW
),
fmap
);
reset_file_map
(
ifm
);
reset_file_map
(
ifm
);
...
@@ -721,12 +726,20 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
...
@@ -721,12 +726,20 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
TRACE
(
"... got possible fat header
\n
"
);
TRACE
(
"... got possible fat header
\n
"
);
/* Fat header is always in big-endian order. */
/* 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
);
int
narch
=
swap_ulong_be_to_host
(
fat_header
.
nfat_arch
);
for
(
i
=
0
;
i
<
narch
;
i
++
)
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
))
if
(
!
ReadFile
(
fmap
->
handle
,
&
fat_arch
,
sizeof
(
fat_arch
),
&
bytes_read
,
NULL
)
||
bytes_read
!=
sizeof
(
fat_arch
))
goto
done
;
goto
done
;
if
(
swap_ulong_be_to_host
(
fat_arch
.
cputype
)
==
target_cpu
)
if
(
swap_ulong_be_to_host
(
fat_arch
.
cputype
)
==
target_cpu
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment