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
588589b8
Commit
588589b8
authored
Aug 13, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Aug 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Don't ask for module inspection when calling SymInitialize.
parent
13050ac1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
11 deletions
+42
-11
Makefile.in
programs/winedbg/Makefile.in
+1
-1
tgt_active.c
programs/winedbg/tgt_active.c
+41
-10
No files found.
programs/winedbg/Makefile.in
View file @
588589b8
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
winedbg.exe
APPMODE
=
-mconsole
IMPORTS
=
dbghelp advapi32 kernel32 ntdll
IMPORTS
=
psapi
dbghelp advapi32 kernel32 ntdll
DELAYIMPORTS
=
user32
C_SRCS
=
\
...
...
programs/winedbg/tgt_active.c
View file @
588589b8
...
...
@@ -26,6 +26,7 @@
#include <stdarg.h>
#include "debugger.h"
#include "psapi.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/exception.h"
...
...
@@ -405,6 +406,34 @@ 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
,
char
*
buffer
,
size_t
bufsz
,
BOOL
is_pcs
)
{
memory_get_string_indirect
(
dbg_curr_process
,
name_addr
,
unicode
,
buffer
,
bufsz
);
if
(
!
buffer
[
0
]
&&
!
GetModuleFileNameExA
(
dbg_curr_process
->
handle
,
mod_addr
,
buffer
,
bufsz
))
{
if
(
is_pcs
)
{
HMODULE
h
;
WORD
(
WINAPI
*
gpif
)(
HANDLE
,
LPSTR
,
DWORD
);
/* On Windows, when we get the process creation debug event for a process
* created by winedbg, the modules' list is not initialized yet. Hence,
* GetModuleFileNameExA (on the main module) will generate an error.
* Psapi (starting on XP) provides GetProcessImageFileName() which should
* give us the expected result
*/
if
(
!
(
h
=
GetModuleHandleA
(
"psapi"
))
||
!
(
gpif
=
(
void
*
)
GetProcAddress
(
h
,
"GetProcessImageFileName"
))
||
!
(
gpif
)(
dbg_curr_process
->
handle
,
buffer
,
bufsz
))
snprintf
(
buffer
,
bufsz
,
"Process_%08lx"
,
dbg_curr_pid
);
}
else
snprintf
(
buffer
,
bufsz
,
"DLL_%p"
,
mod_addr
);
}
}
static
unsigned
dbg_handle_debug_event
(
DEBUG_EVENT
*
de
)
{
char
buffer
[
256
];
...
...
@@ -456,11 +485,10 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
WINE_ERR
(
"Couldn't create process
\n
"
);
break
;
}
memory_get_string_indirect
(
dbg_curr_process
,
de
->
u
.
CreateProcessInfo
.
lpImageName
,
de
->
u
.
CreateProcessInfo
.
fUnicode
,
buffer
,
sizeof
(
buffer
));
if
(
!
buffer
[
0
])
strcpy
(
buffer
,
"<Debugged Process>"
);
fetch_module_name
(
de
->
u
.
CreateProcessInfo
.
lpImageName
,
de
->
u
.
CreateProcessInfo
.
fUnicode
,
de
->
u
.
CreateProcessInfo
.
lpBaseOfImage
,
buffer
,
sizeof
(
buffer
),
TRUE
);
WINE_TRACE
(
"%08lx:%08lx: create process '%s'/%p @%08lx (%ld<%ld>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
@@ -470,8 +498,11 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
de
->
u
.
CreateProcessInfo
.
nDebugInfoSize
);
dbg_set_process_name
(
dbg_curr_process
,
buffer
);
if
(
!
SymInitialize
(
dbg_curr_process
->
handle
,
NULL
,
TRU
E
))
if
(
!
SymInitialize
(
dbg_curr_process
->
handle
,
NULL
,
FALS
E
))
dbg_printf
(
"Couldn't initiate DbgHelp
\n
"
);
if
(
!
SymLoadModule
(
dbg_curr_process
->
handle
,
de
->
u
.
CreateProcessInfo
.
hFile
,
buffer
,
NULL
,
(
unsigned
long
)
de
->
u
.
CreateProcessInfo
.
lpBaseOfImage
,
0
))
dbg_printf
(
"couldn't load main module (%lx)
\n
"
,
GetLastError
());
WINE_TRACE
(
"%08lx:%08lx: create thread I @%08lx
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
@@ -550,10 +581,10 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
WINE_ERR
(
"Unknown thread
\n
"
);
break
;
}
memory_get_string_indirect
(
dbg_curr_process
,
de
->
u
.
LoadDll
.
lpImageNam
e
,
de
->
u
.
LoadDll
.
fUnicode
,
buffer
,
sizeof
(
buffer
)
);
fetch_module_name
(
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
fUnicod
e
,
de
->
u
.
LoadDll
.
lpBaseOfDll
,
buffer
,
sizeof
(
buffer
),
FALSE
);
WINE_TRACE
(
"%08lx:%08lx: loads DLL %s @%08lx (%ld<%ld>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
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