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
c050df12
Commit
c050df12
authored
Apr 13, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Use GetMappedFileNameW() as fallback when fetching module names.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39b20a2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
debugger.h
programs/winedbg/debugger.h
+1
-0
gdbproxy.c
programs/winedbg/gdbproxy.c
+2
-4
tgt_active.c
programs/winedbg/tgt_active.c
+14
-9
No files found.
programs/winedbg/debugger.h
View file @
c050df12
...
...
@@ -419,6 +419,7 @@ extern enum dbg_start dbg_active_auto(int argc, char* argv[]);
extern
enum
dbg_start
dbg_active_minidump
(
int
argc
,
char
*
argv
[]);
extern
void
dbg_active_wait_for_first_exception
(
void
);
extern
BOOL
dbg_attach_debuggee
(
DWORD
pid
);
extern
void
fetch_module_name
(
void
*
name_addr
,
void
*
mod_addr
,
WCHAR
*
buffer
,
size_t
bufsz
);
/* tgt_minidump.c */
extern
void
minidump_write
(
const
char
*
,
const
EXCEPTION_RECORD
*
);
...
...
programs/winedbg/gdbproxy.c
View file @
c050df12
...
...
@@ -443,10 +443,8 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx)
return
TRUE
;
case
LOAD_DLL_DEBUG_EVENT
:
memory_get_string_indirect
(
gdbctx
->
process
,
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
fUnicode
,
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
));
fetch_module_name
(
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
lpBaseOfDll
,
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
)
);
fprintf
(
stderr
,
"%04x:%04x: loads DLL %s @%p (%u<%u>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
dbg_W2A
(
u
.
buffer
,
-
1
),
...
...
programs/winedbg/tgt_active.c
View file @
c050df12
...
...
@@ -296,16 +296,23 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
static
BOOL
tgt_process_active_close_process
(
struct
dbg_process
*
pcs
,
BOOL
kill
);
static
void
fetch_module_name
(
void
*
name_addr
,
BOOL
unicode
,
void
*
mod_addr
,
WCHAR
*
buffer
,
size_t
bufsz
)
void
fetch_module_name
(
void
*
name_addr
,
void
*
mod_addr
,
WCHAR
*
buffer
,
size_t
bufsz
)
{
static
const
WCHAR
dlladdr
[]
=
{
'D'
,
'L'
,
'L'
,
'_'
,
'%'
,
'0'
,
'8'
,
'l'
,
'x'
,
0
};
memory_get_string_indirect
(
dbg_curr_process
,
name_addr
,
unicode
,
buffer
,
bufsz
);
if
(
!
buffer
[
0
]
&&
!
GetModuleFileNameExW
(
dbg_curr_process
->
handle
,
mod_addr
,
buffer
,
bufsz
))
memory_get_string_indirect
(
dbg_curr_process
,
name_addr
,
TRUE
,
buffer
,
bufsz
);
if
(
!
buffer
[
0
]
&&
!
GetModuleFileNameExW
(
dbg_curr_process
->
handle
,
mod_addr
,
buffer
,
bufsz
))
{
snprintfW
(
buffer
,
bufsz
,
dlladdr
,
(
ULONG_PTR
)
mod_addr
);
if
(
GetMappedFileNameW
(
dbg_curr_process
->
handle
,
mod_addr
,
buffer
,
bufsz
))
{
/* FIXME: proper NT->Dos conversion */
static
const
WCHAR
nt_prefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
};
if
(
!
strncmpW
(
buffer
,
nt_prefixW
,
4
))
memmove
(
buffer
,
buffer
+
4
,
(
lstrlenW
(
buffer
+
4
)
+
1
)
*
sizeof
(
WCHAR
)
);
}
else
snprintfW
(
buffer
,
bufsz
,
dlladdr
,
(
ULONG_PTR
)
mod_addr
);
}
}
...
...
@@ -462,9 +469,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
WINE_ERR
(
"Unknown thread
\n
"
);
break
;
}
fetch_module_name
(
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
fUnicode
,
de
->
u
.
LoadDll
.
lpBaseOfDll
,
fetch_module_name
(
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
lpBaseOfDll
,
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
));
WINE_TRACE
(
"%04x:%04x: loads DLL %s @%p (%u<%u>)
\n
"
,
...
...
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