Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0a1de579
Commit
0a1de579
authored
Oct 09, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use is_host_64bit for handling bitness of mach-o libs.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55650
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
d6096057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
macho_module.c
dlls/dbghelp/macho_module.c
+14
-14
No files found.
dlls/dbghelp/macho_module.c
View file @
0a1de579
...
...
@@ -744,9 +744,9 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
WCHAR
*
filename
;
struct
section_info
info
;
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
)
?
MACHO_LC_SEGMENT_64
:
MACHO_LC_SEGMENT
;
UINT32
target_cpu
=
(
pcs
->
is_
host_
64bit
)
?
MACHO_CPU_TYPE_X86_64
:
MACHO_CPU_TYPE_X86
;
UINT32
target_magic
=
(
pcs
->
is_
host_
64bit
)
?
MACHO_MH_MAGIC_64
:
MACHO_MH_MAGIC_32
;
UINT32
target_cmd
=
(
pcs
->
is_
host_
64bit
)
?
MACHO_LC_SEGMENT_64
:
MACHO_LC_SEGMENT
;
DWORD
bytes_read
;
struct
...
...
@@ -762,8 +762,8 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
ifm
->
modtype
=
DMT_MACHO
;
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
macho_header
)
:
FIELD_OFFSET
(
struct
macho_header
,
reserved
);
ifm
->
addr_size
=
(
pcs
->
is_
host_
64bit
)
?
64
:
32
;
fmap
->
header_size
=
(
pcs
->
is_
host_
64bit
)
?
sizeof
(
struct
macho_header
)
:
FIELD_OFFSET
(
struct
macho_header
,
reserved
);
if
(
!
(
filename
=
get_dos_file_name
(
filenameW
)))
return
FALSE
;
...
...
@@ -1339,8 +1339,8 @@ static BOOL image_uses_split_segs(struct process* process, ULONG_PTR load_addr)
if
(
load_addr
)
{
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
;
UINT32
target_cpu
=
(
process
->
is_
host_
64bit
)
?
MACHO_CPU_TYPE_X86_64
:
MACHO_CPU_TYPE_X86
;
UINT32
target_magic
=
(
process
->
is_
host_
64bit
)
?
MACHO_MH_MAGIC_64
:
MACHO_MH_MAGIC_32
;
struct
macho_header
header
;
if
(
read_process_memory
(
process
,
load_addr
,
&
header
,
FIELD_OFFSET
(
struct
macho_header
,
reserved
))
&&
...
...
@@ -1608,14 +1608,14 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
TRACE
(
"(%p/%p, %s, %p, %p)
\n
"
,
pcs
,
pcs
->
handle
,
debugstr_w
(
main_name
),
cb
,
user
);
if
(
pcs
->
is_64bit
)
if
(
pcs
->
is_
host_
64bit
)
len
=
sizeof
(
image_infos
.
infos64
);
else
len
=
sizeof
(
image_infos
.
infos32
);
if
(
!
pcs
->
dbg_hdr_addr
||
!
read_process_memory
(
pcs
,
pcs
->
dbg_hdr_addr
,
&
image_infos
,
len
))
goto
done
;
if
(
!
pcs
->
is_64bit
)
if
(
!
pcs
->
is_
host_
64bit
)
{
struct
dyld_all_image_infos32
temp
=
image_infos
.
infos32
;
image_infos
.
infos64
.
infoArrayCount
=
temp
.
infoArrayCount
;
...
...
@@ -1625,7 +1625,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
goto
done
;
TRACE
(
"Process has %u image infos at %I64x
\n
"
,
image_infos
.
infos64
.
infoArrayCount
,
image_infos
.
infos64
.
infoArray
);
if
(
pcs
->
is_64bit
)
if
(
pcs
->
is_
host_
64bit
)
len
=
sizeof
(
info_array
->
info64
);
else
len
=
sizeof
(
info_array
->
info32
);
...
...
@@ -1639,7 +1639,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
for
(
i
=
0
;
i
<
image_infos
.
infos64
.
infoArrayCount
;
i
++
)
{
struct
dyld_image_info64
info
;
if
(
pcs
->
is_64bit
)
if
(
pcs
->
is_
host_
64bit
)
info
=
info_array
[
i
].
info64
;
else
{
...
...
@@ -1829,13 +1829,13 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in
char
path
[
1024
];
BOOL
got_path
=
FALSE
;
if
(
pcs
->
is_64bit
)
if
(
pcs
->
is_
host_
64bit
)
len
=
sizeof
(
image_infos
.
infos64
);
else
len
=
sizeof
(
image_infos
.
infos32
);
if
(
read_process_memory
(
pcs
,
pcs
->
dbg_hdr_addr
,
&
image_infos
,
len
))
{
if
(
pcs
->
is_64bit
)
if
(
pcs
->
is_
host_
64bit
)
len
=
sizeof
(
image_info
.
info64
);
else
{
...
...
@@ -1847,7 +1847,7 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in
if
(
image_infos
.
infos64
.
infoArray
&&
image_infos
.
infos64
.
infoArrayCount
&&
read_process_memory
(
pcs
,
image_infos
.
infos64
.
infoArray
,
&
image_info
,
len
))
{
if
(
!
pcs
->
is_64bit
)
if
(
!
pcs
->
is_
host_
64bit
)
{
struct
dyld_image_info32
temp
=
image_info
.
info32
;
image_info
.
info64
.
imageLoadAddress
=
temp
.
imageLoadAddress
;
...
...
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