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
3bae7d03
Commit
3bae7d03
authored
Jan 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Add a helper function to determine the name of the wine loader.
parent
22cd7e0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
41 deletions
+34
-41
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
elf_module.c
dlls/dbghelp/elf_module.c
+1
-17
macho_module.c
dlls/dbghelp/macho_module.c
+1
-19
module.c
dlls/dbghelp/module.c
+31
-4
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
3bae7d03
...
...
@@ -528,7 +528,6 @@ extern BOOL macho_synchronize_module_list(struct process* pcs);
/* module.c */
extern
const
WCHAR
S_ElfW
[];
extern
const
WCHAR
S_WineLoaderW
[];
extern
const
WCHAR
S_WineW
[];
extern
const
WCHAR
S_SlashW
[];
extern
struct
module
*
...
...
@@ -555,6 +554,7 @@ extern void module_reset_debug_info(struct module* module);
extern
BOOL
module_remove
(
struct
process
*
pcs
,
struct
module
*
module
);
extern
void
module_set_module
(
struct
module
*
module
,
const
WCHAR
*
name
);
extern
const
WCHAR
*
get_wine_loader_name
(
void
);
/* msc.c */
extern
BOOL
pe_load_debug_directory
(
const
struct
process
*
pcs
,
...
...
dlls/dbghelp/elf_module.c
View file @
3bae7d03
...
...
@@ -1458,23 +1458,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
*/
static
BOOL
elf_search_loader
(
struct
process
*
pcs
,
struct
elf_info
*
elf_info
)
{
BOOL
ret
;
const
char
*
ptr
;
/* All binaries are loaded with WINELOADER (if run from tree) or by the
* main executable
*/
if
((
ptr
=
getenv
(
"WINELOADER"
)))
{
WCHAR
tmp
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
)
/
sizeof
(
WCHAR
));
ret
=
elf_search_and_load_file
(
pcs
,
tmp
,
0
,
0
,
elf_info
);
}
else
{
ret
=
elf_search_and_load_file
(
pcs
,
S_WineW
,
0
,
0
,
elf_info
);
}
return
ret
;
return
elf_search_and_load_file
(
pcs
,
get_wine_loader_name
(),
0
,
0
,
elf_info
);
}
/******************************************************************
...
...
dlls/dbghelp/macho_module.c
View file @
3bae7d03
...
...
@@ -1274,25 +1274,7 @@ BOOL macho_synchronize_module_list(struct process* pcs)
*/
static
BOOL
macho_search_loader
(
struct
process
*
pcs
,
struct
macho_info
*
macho_info
)
{
BOOL
ret
;
const
char
*
ptr
;
TRACE
(
"(%p/%p, %p)
\n
"
,
pcs
,
pcs
->
handle
,
macho_info
);
/* All binaries are loaded with WINELOADER (if run from tree) or by the
* main executable
*/
if
((
ptr
=
getenv
(
"WINELOADER"
)))
{
WCHAR
tmp
[
MAX_PATH
];
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
ptr
,
-
1
,
tmp
,
sizeof
(
tmp
)
/
sizeof
(
WCHAR
));
ret
=
macho_search_and_load_file
(
pcs
,
tmp
,
0
,
macho_info
);
}
else
{
ret
=
macho_search_and_load_file
(
pcs
,
S_WineW
,
0
,
macho_info
);
}
return
ret
;
return
macho_search_and_load_file
(
pcs
,
get_wine_loader_name
(),
0
,
macho_info
);
}
/******************************************************************
...
...
dlls/dbghelp/module.c
View file @
3bae7d03
...
...
@@ -38,7 +38,6 @@ static const WCHAR S_DotSoW[] = {'.','s','o','\0'};
static
const
WCHAR
S_DotDylibW
[]
=
{
'.'
,
'd'
,
'y'
,
'l'
,
'i'
,
'b'
,
'\0'
};
static
const
WCHAR
S_DotPdbW
[]
=
{
'.'
,
'p'
,
'd'
,
'b'
,
'\0'
};
static
const
WCHAR
S_DotDbgW
[]
=
{
'.'
,
'd'
,
'b'
,
'g'
,
'\0'
};
const
WCHAR
S_WineW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
0
};
const
WCHAR
S_SlashW
[]
=
{
'/'
,
'\0'
};
static
const
WCHAR
S_AcmW
[]
=
{
'.'
,
'a'
,
'c'
,
'm'
,
'\0'
};
...
...
@@ -78,6 +77,7 @@ static const WCHAR* get_filename(const WCHAR* name, const WCHAR* endptr)
static
void
module_fill_module
(
const
WCHAR
*
in
,
WCHAR
*
out
,
size_t
size
)
{
const
WCHAR
*
loader
=
get_wine_loader_name
();
const
WCHAR
*
ptr
,
*
endptr
;
size_t
len
,
l
;
...
...
@@ -87,7 +87,7 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
out
[
len
]
=
'\0'
;
if
(
len
>
4
&&
(
l
=
match_ext
(
out
,
len
)))
out
[
len
-
l
]
=
'\0'
;
else
if
(
len
>
4
&&
!
strcmpiW
(
out
+
len
-
4
,
S_WineW
))
else
if
(
len
>
strlenW
(
loader
)
&&
!
strcmpiW
(
out
+
len
-
strlenW
(
loader
),
loader
))
lstrcpynW
(
out
,
S_WineLoaderW
,
size
);
else
{
...
...
@@ -106,6 +106,29 @@ void module_set_module(struct module* module, const WCHAR* name)
NULL
,
NULL
);
}
const
WCHAR
*
get_wine_loader_name
(
void
)
{
static
const
WCHAR
wineW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
*
loader
;
const
char
*
ptr
;
if
(
!
loader
)
{
/* All binaries are loaded with WINELOADER (if run from tree) or by the
* main executable
*/
if
((
ptr
=
getenv
(
"WINELOADER"
)))
{
DWORD
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
ptr
,
-
1
,
NULL
,
0
);
WCHAR
*
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
ptr
,
-
1
,
buffer
,
len
);
loader
=
buffer
;
}
else
loader
=
wineW
;
}
return
loader
;
}
static
const
char
*
get_module_type
(
enum
module_type
type
,
BOOL
virtual
)
{
switch
(
type
)
...
...
@@ -417,7 +440,8 @@ static BOOL module_is_container_loaded(const struct process* pcs,
*/
enum
module_type
module_get_type_by_name
(
const
WCHAR
*
name
)
{
int
len
=
strlenW
(
name
);
int
loader_len
,
len
=
strlenW
(
name
);
const
WCHAR
*
loader
;
/* Skip all version extensions (.[digits]) regex: "(\.\d+)*$" */
do
...
...
@@ -452,7 +476,10 @@ enum module_type module_get_type_by_name(const WCHAR* name)
return
DMT_DBG
;
/* wine is also a native module (Mach-O on Mac OS X, ELF elsewhere) */
if
(((
len
>
4
&&
name
[
len
-
5
]
==
'/'
)
||
len
==
4
)
&&
!
strcmpiW
(
name
+
len
-
4
,
S_WineW
))
loader
=
get_wine_loader_name
();
loader_len
=
strlenW
(
loader
);
if
((
len
==
loader_len
||
(
len
>
loader_len
&&
name
[
len
-
loader_len
-
1
]
==
'/'
))
&&
!
strcmpiW
(
name
+
len
-
loader_len
,
loader
))
{
#ifdef __APPLE__
return
DMT_MACHO
;
...
...
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