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
039d54a4
Commit
039d54a4
authored
Feb 21, 2007
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Make elf_enum_modules a Unicode function.
parent
89bc6569
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
elf_module.c
dlls/dbghelp/elf_module.c
+13
-6
minidump.c
dlls/dbghelp/minidump.c
+5
-5
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
039d54a4
...
...
@@ -416,7 +416,7 @@ extern void* fetch_buffer(struct process* pcs, unsigned size);
/* elf_module.c */
#define ELF_NO_MAP ((const void*)0xffffffff)
typedef
BOOL
(
*
elf_enum_modules_cb
)(
const
char
*
,
unsigned
long
addr
,
void
*
user
);
typedef
BOOL
(
*
elf_enum_modules_cb
)(
const
WCHAR
*
,
unsigned
long
addr
,
void
*
user
);
extern
BOOL
elf_enum_modules
(
HANDLE
hProc
,
elf_enum_modules_cb
,
void
*
);
extern
BOOL
elf_fetch_file_info
(
const
char
*
name
,
DWORD
*
base
,
DWORD
*
size
,
DWORD
*
checksum
);
struct
elf_file_map
;
...
...
dlls/dbghelp/elf_module.c
View file @
039d54a4
...
...
@@ -1358,9 +1358,10 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
void
*
lm_addr
;
struct
link_map
lm
;
char
bufstr
[
256
];
WCHAR
bufstrW
[
MAX_PATH
];
if
(
!
pcs
->
dbg_hdr_addr
||
!
ReadProcessMemory
(
pcs
->
handle
,
(
void
*
)
pcs
->
dbg_hdr_addr
,
!
ReadProcessMemory
(
pcs
->
handle
,
(
void
*
)
pcs
->
dbg_hdr_addr
,
&
dbg_hdr
,
sizeof
(
dbg_hdr
),
NULL
))
return
FALSE
;
...
...
@@ -1380,7 +1381,8 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
{
bufstr
[
sizeof
(
bufstr
)
-
1
]
=
'\0'
;
if
(
main_name
&&
!
bufstr
[
0
])
strcpy
(
bufstr
,
main_name
);
if
(
!
cb
(
bufstr
,
(
unsigned
long
)
lm
.
l_addr
,
user
))
break
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
bufstr
,
-
1
,
bufstrW
,
sizeof
(
bufstrW
)
/
sizeof
(
WCHAR
));
if
(
!
cb
(
bufstrW
,
(
unsigned
long
)
lm
.
l_addr
,
user
))
break
;
}
}
return
TRUE
;
...
...
@@ -1392,14 +1394,16 @@ struct elf_sync
struct
elf_info
elf_info
;
};
static
BOOL
elf_enum_sync_cb
(
const
char
*
name
,
unsigned
long
addr
,
void
*
user
)
static
BOOL
elf_enum_sync_cb
(
const
WCHAR
*
name
,
unsigned
long
addr
,
void
*
user
)
{
struct
elf_sync
*
es
=
user
;
char
tmp
[
MAX_PATH
];
elf_search_and_load_file
(
es
->
pcs
,
name
,
addr
,
&
es
->
elf_info
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
tmp
,
sizeof
(
tmp
),
0
,
0
);
elf_search_and_load_file
(
es
->
pcs
,
tmp
,
addr
,
&
es
->
elf_info
);
return
TRUE
;
}
/******************************************************************
* elf_synchronize_module_list
*
...
...
@@ -1520,10 +1524,13 @@ struct elf_load
* Callback for elf_load_module, used to walk the list of loaded
* modules.
*/
static
BOOL
elf_load_cb
(
const
char
*
name
,
unsigned
long
addr
,
void
*
user
)
static
BOOL
elf_load_cb
(
const
WCHAR
*
nameW
,
unsigned
long
addr
,
void
*
user
)
{
struct
elf_load
*
el
=
user
;
const
char
*
p
;
char
name
[
MAX_PATH
];
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
nameW
,
-
1
,
name
,
sizeof
(
name
),
0
,
0
);
/* memcmp is needed for matches when bufstr contains also version information
* el->name: libc.so, name: libc.so.6.0
...
...
dlls/dbghelp/minidump.c
View file @
039d54a4
...
...
@@ -270,22 +270,22 @@ static BOOL WINAPI fetch_pe_module_info_cb(WCHAR* name, DWORD64 base, DWORD size
*
* Callback for accumulating in dump_context an ELF modules set
*/
static
BOOL
fetch_elf_module_info_cb
(
const
char
*
name
,
unsigned
long
base
,
static
BOOL
fetch_elf_module_info_cb
(
const
WCHAR
*
name
,
unsigned
long
base
,
void
*
user
)
{
struct
dump_context
*
dc
=
(
struct
dump_context
*
)
user
;
DWORD
rbase
,
size
,
checksum
;
WCHAR
tmp
[
MAX_PATH
];
char
tmp
[
MAX_PATH
];
/* FIXME: there's no relevant timestamp on ELF modules */
/* NB: if we have a non-null base from the live-target use it (whenever
* the ELF module is relocatable or not). If we have a null base (ELF
* module isn't relocatable) then grab its base address from ELF file
*/
if
(
!
elf_fetch_file_info
(
name
,
&
rbase
,
&
size
,
&
checksum
))
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
tmp
,
sizeof
(
tmp
),
0
,
0
);
if
(
!
elf_fetch_file_info
(
tmp
,
&
rbase
,
&
size
,
&
checksum
))
size
=
checksum
=
0
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
name
,
-
1
,
tmp
,
sizeof
(
tmp
)
/
sizeof
(
WCHAR
));
add_module
(
dc
,
tmp
,
base
?
base
:
rbase
,
size
,
0
/* FIXME */
,
checksum
,
TRUE
);
add_module
(
dc
,
name
,
base
?
base
:
rbase
,
size
,
0
/* FIXME */
,
checksum
,
TRUE
);
return
TRUE
;
}
...
...
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