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
dcbec3bf
Commit
dcbec3bf
authored
Jun 24, 2015
by
Ken Thomases
Committed by
Alexandre Julliard
Jun 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use existing IMAGE_NO_MAP constant instead of redundant MACHO_NO_MAP.
parent
41d74176
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+0
-1
macho_module.c
dlls/dbghelp/macho_module.c
+15
-14
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
dcbec3bf
...
...
@@ -569,7 +569,6 @@ struct elf_thunk_area;
extern
int
elf_is_in_thunk_area
(
unsigned
long
addr
,
const
struct
elf_thunk_area
*
thunks
)
DECLSPEC_HIDDEN
;
/* macho_module.c */
#define MACHO_NO_MAP ((const void*)-1)
extern
BOOL
macho_enum_modules
(
HANDLE
hProc
,
enum_modules_cb
,
void
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
macho_fetch_file_info
(
const
WCHAR
*
name
,
DWORD_PTR
*
base
,
DWORD
*
size
,
DWORD
*
checksum
)
DECLSPEC_HIDDEN
;
extern
BOOL
macho_load_debug_info
(
struct
module
*
module
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/macho_module.c
View file @
dcbec3bf
...
...
@@ -65,6 +65,7 @@ struct dyld_all_image_infos {
#include "winternl.h"
#include "wine/library.h"
#include "wine/debug.h"
#include "image_private.h"
#ifdef WORDS_BIGENDIAN
#define swap_ulong_be_to_host(n) (n)
...
...
@@ -190,7 +191,7 @@ static const char* macho_map_range(const struct macho_file_map* fmap, unsigned l
TRACE
(
"Mapped (0x%08lx - 0x%08lx) to %p
\n
"
,
aligned_offset
,
aligned_map_end
,
aligned_ptr
);
if
(
aligned_ptr
==
MAP_FAILED
)
return
MACHO
_NO_MAP
;
if
(
aligned_ptr
==
MAP_FAILED
)
return
IMAGE
_NO_MAP
;
return
(
const
char
*
)
aligned_ptr
+
misalign
;
}
...
...
@@ -204,7 +205,7 @@ static void macho_unmap_range(const void** mapped, const struct macho_file_map*
{
TRACE
(
"(%p, %p/%d, 0x%08lx, 0x%08lx)
\n
"
,
mapped
,
fmap
,
fmap
->
fd
,
offset
,
len
);
if
(
mapped
&&
*
mapped
!=
MACHO
_NO_MAP
)
if
(
mapped
&&
*
mapped
!=
IMAGE
_NO_MAP
)
{
unsigned
long
misalign
,
aligned_offset
,
aligned_map_end
,
map_size
;
void
*
aligned_ptr
;
...
...
@@ -216,7 +217,7 @@ static void macho_unmap_range(const void** mapped, const struct macho_file_map*
if
(
munmap
(
aligned_ptr
,
map_size
)
<
0
)
WARN
(
"Couldn't unmap the range
\n
"
);
TRACE
(
"Unmapped (0x%08lx - 0x%08lx) from %p - %p
\n
"
,
aligned_offset
,
aligned_map_end
,
aligned_ptr
,
(
char
*
)
aligned_ptr
+
map_size
);
*
mapped
=
MACHO
_NO_MAP
;
*
mapped
=
IMAGE
_NO_MAP
;
}
}
...
...
@@ -244,10 +245,10 @@ static BOOL macho_map_ranges(const struct macho_file_map* fmap,
if
(
aligned_map_end1
<
aligned_offset2
||
aligned_map_end2
<
aligned_offset1
)
{
*
mapped1
=
macho_map_range
(
fmap
,
offset1
,
len1
);
if
(
*
mapped1
!=
MACHO
_NO_MAP
)
if
(
*
mapped1
!=
IMAGE
_NO_MAP
)
{
*
mapped2
=
macho_map_range
(
fmap
,
offset2
,
len2
);
if
(
*
mapped2
==
MACHO
_NO_MAP
)
if
(
*
mapped2
==
IMAGE
_NO_MAP
)
macho_unmap_range
(
mapped1
,
fmap
,
offset1
,
len1
);
}
}
...
...
@@ -256,20 +257,20 @@ static BOOL macho_map_ranges(const struct macho_file_map* fmap,
if
(
offset1
<
offset2
)
{
*
mapped1
=
macho_map_range
(
fmap
,
offset1
,
offset2
+
len2
-
offset1
);
if
(
*
mapped1
!=
MACHO
_NO_MAP
)
if
(
*
mapped1
!=
IMAGE
_NO_MAP
)
*
mapped2
=
(
const
char
*
)
*
mapped1
+
offset2
-
offset1
;
}
else
{
*
mapped2
=
macho_map_range
(
fmap
,
offset2
,
offset1
+
len1
-
offset2
);
if
(
*
mapped2
!=
MACHO
_NO_MAP
)
if
(
*
mapped2
!=
IMAGE
_NO_MAP
)
*
mapped1
=
(
const
char
*
)
*
mapped2
+
offset1
-
offset2
;
}
}
TRACE
(
" => %p, %p
\n
"
,
*
mapped1
,
*
mapped2
);
return
(
*
mapped1
!=
MACHO_NO_MAP
)
&&
(
*
mapped2
!=
MACHO
_NO_MAP
);
return
(
*
mapped1
!=
IMAGE_NO_MAP
)
&&
(
*
mapped2
!=
IMAGE
_NO_MAP
);
}
/******************************************************************
...
...
@@ -303,12 +304,12 @@ static void macho_unmap_ranges(const struct macho_file_map* fmap,
if
(
offset1
<
offset2
)
{
macho_unmap_range
(
mapped1
,
fmap
,
offset1
,
offset2
+
len2
-
offset1
);
*
mapped2
=
MACHO
_NO_MAP
;
*
mapped2
=
IMAGE
_NO_MAP
;
}
else
{
macho_unmap_range
(
mapped2
,
fmap
,
offset2
,
offset1
+
len1
-
offset2
);
*
mapped1
=
MACHO
_NO_MAP
;
*
mapped1
=
IMAGE
_NO_MAP
;
}
}
}
...
...
@@ -320,7 +321,7 @@ static void macho_unmap_ranges(const struct macho_file_map* fmap,
*/
static
const
struct
load_command
*
macho_map_load_commands
(
struct
macho_file_map
*
fmap
)
{
if
(
fmap
->
load_commands
==
MACHO
_NO_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
);
...
...
@@ -337,7 +338,7 @@ static const struct load_command* macho_map_load_commands(struct macho_file_map*
*/
static
void
macho_unmap_load_commands
(
struct
macho_file_map
*
fmap
)
{
if
(
fmap
->
load_commands
!=
MACHO
_NO_MAP
)
if
(
fmap
->
load_commands
!=
IMAGE
_NO_MAP
)
{
TRACE
(
"Unmapping load commands: %p
\n
"
,
fmap
->
load_commands
);
macho_unmap_range
((
const
void
**
)
&
fmap
->
load_commands
,
fmap
,
...
...
@@ -376,7 +377,7 @@ static int macho_enum_load_commands(struct macho_file_map* fmap, unsigned cmd,
TRACE
(
"(%p/%d, %u, %p, %p)
\n
"
,
fmap
,
fmap
->
fd
,
cmd
,
cb
,
user
);
if
((
lc
=
macho_map_load_commands
(
fmap
))
==
MACHO
_NO_MAP
)
return
-
1
;
if
((
lc
=
macho_map_load_commands
(
fmap
))
==
IMAGE
_NO_MAP
)
return
-
1
;
TRACE
(
"%d total commands
\n
"
,
fmap
->
mach_header
.
ncmds
);
...
...
@@ -456,7 +457,7 @@ static BOOL macho_map_file(const WCHAR* filenameW, struct macho_file_map* fmap)
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
filenameW
),
fmap
);
fmap
->
fd
=
-
1
;
fmap
->
load_commands
=
MACHO
_NO_MAP
;
fmap
->
load_commands
=
IMAGE
_NO_MAP
;
RtlInitializeBitMap
(
&
fmap
->
sect_is_code
,
fmap
->
sect_is_code_buff
,
MAX_SECT
+
1
);
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
filenameW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
...
...
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