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
15467577
Commit
15467577
authored
Dec 02, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Add debug logging to some error paths in the Mach-O support.
parent
3fe34fe3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
macho_module.c
dlls/dbghelp/macho_module.c
+19
-3
No files found.
dlls/dbghelp/macho_module.c
View file @
15467577
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <assert.h>
#include <assert.h>
#include <stdarg.h>
#include <stdarg.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
# include <sys/stat.h>
#endif
#endif
...
@@ -432,17 +433,32 @@ static BOOL macho_map_file(const WCHAR* filenameW, struct macho_file_map* fmap)
...
@@ -432,17 +433,32 @@ static BOOL macho_map_file(const WCHAR* filenameW, struct macho_file_map* fmap)
RtlInitializeBitMap
(
&
fmap
->
sect_is_code
,
fmap
->
sect_is_code_buff
,
MAX_SECT
+
1
);
RtlInitializeBitMap
(
&
fmap
->
sect_is_code
,
fmap
->
sect_is_code_buff
,
MAX_SECT
+
1
);
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
filenameW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
filenameW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
(
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
return
FALSE
;
if
(
!
(
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
{
WARN
(
"failed to allocate filename buffer
\n
"
);
return
FALSE
;
}
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
filenameW
,
-
1
,
filename
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
filenameW
,
-
1
,
filename
,
len
,
NULL
,
NULL
);
/* check that the file exists */
/* check that the file exists */
if
(
stat
(
filename
,
&
statbuf
)
==
-
1
||
S_ISDIR
(
statbuf
.
st_mode
))
goto
done
;
if
(
stat
(
filename
,
&
statbuf
)
==
-
1
||
S_ISDIR
(
statbuf
.
st_mode
))
{
TRACE
(
"stat() failed or %s is directory: %s
\n
"
,
debugstr_a
(
filename
),
strerror
(
errno
));
goto
done
;
}
/* Now open the file, so that we can mmap() it. */
/* Now open the file, so that we can mmap() it. */
if
((
fmap
->
fd
=
open
(
filename
,
O_RDONLY
))
==
-
1
)
goto
done
;
if
((
fmap
->
fd
=
open
(
filename
,
O_RDONLY
))
==
-
1
)
{
TRACE
(
"failed to open file %s: %d
\n
"
,
debugstr_a
(
filename
),
errno
);
goto
done
;
}
if
(
read
(
fmap
->
fd
,
&
fat_header
,
sizeof
(
fat_header
))
!=
sizeof
(
fat_header
))
if
(
read
(
fmap
->
fd
,
&
fat_header
,
sizeof
(
fat_header
))
!=
sizeof
(
fat_header
))
{
TRACE
(
"failed to read fat header: %d
\n
"
,
errno
);
goto
done
;
goto
done
;
}
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. */
...
...
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