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
8e0dcc41
Commit
8e0dcc41
authored
Feb 11, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attach command no longer worked as expected, fixed it.
parent
fdd0bfa1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
dbg.y
programs/winedbg/dbg.y
+3
-3
debugger.h
programs/winedbg/debugger.h
+1
-1
winedbg.c
programs/winedbg/winedbg.c
+30
-8
No files found.
programs/winedbg/dbg.y
View file @
8e0dcc41
...
...
@@ -150,7 +150,7 @@ command:
| tSYMBOLFILE pathname tEOL { DEBUG_ReadSymbolTable($2, 0); }
| tSYMBOLFILE pathname tNUM tEOL { DEBUG_ReadSymbolTable($2, $3); }
| tWHATIS expr_addr tEOL { DEBUG_PrintType(&$2); DEBUG_FreeExprMem(); }
| tATTACH tNUM tEOL { DEBUG_Attach($2, FALSE); }
| tATTACH tNUM tEOL { DEBUG_Attach($2, FALSE
, TRUE
); }
| tDETACH tEOL { return DEBUG_Detach(); /* FIXME: we shouldn't return, but since we cannot simply clean the symbol table, exit debugger for now */ }
| list_command
| disassemble_command
...
...
@@ -426,7 +426,7 @@ static void set_default_channels(void)
/***********************************************************************
* DEBUG_Parser
*
* Debugger
edit
line parser
* Debugger
command
line parser
*/
void DEBUG_Parser(LPCSTR filename)
{
...
...
@@ -453,7 +453,7 @@ void DEBUG_Parser(LPCSTR filename)
do
{
__TRY
{
{
ret_ok = TRUE;
yyparse();
}
...
...
programs/winedbg/debugger.h
View file @
8e0dcc41
...
...
@@ -531,7 +531,7 @@ extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__(
extern
int
DEBUG_Printf
(
int
chn
,
const
char
*
format
,
...);
#endif
extern
DBG_INTVAR
*
DEBUG_GetIntVar
(
const
char
*
);
extern
BOOL
DEBUG_Attach
(
DWORD
pid
,
BOOL
cofe
);
extern
BOOL
DEBUG_Attach
(
DWORD
pid
,
BOOL
cofe
,
BOOL
wfe
);
extern
BOOL
DEBUG_Detach
(
void
);
extern
void
DEBUG_Run
(
const
char
*
args
);
extern
DBG_PROCESS
*
DEBUG_AddProcess
(
DWORD
pid
,
HANDLE
h
,
const
char
*
imageName
);
...
...
programs/winedbg/winedbg.c
View file @
8e0dcc41
...
...
@@ -262,7 +262,7 @@ DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid,
t
->
exec_mode
=
EXEC_CONT
;
t
->
exec_count
=
0
;
s
printf
(
t
->
name
,
"%08lx"
,
tid
);
s
nprintf
(
t
->
name
,
sizeof
(
t
->
name
)
,
"%08lx"
,
tid
);
p
->
num_threads
++
;
t
->
next
=
p
->
threads
;
...
...
@@ -303,17 +303,40 @@ void DEBUG_DelThread(DBG_THREAD* t)
DBG_free
(
t
);
}
BOOL
DEBUG_Attach
(
DWORD
pid
,
BOOL
cofe
)
static
BOOL
DEBUG_HandleDebugEvent
(
DEBUG_EVENT
*
de
);
/******************************************************************
* DEBUG_Attach
*
* Sets the debuggee to <pid>
* cofe instructs winedbg what to do when first exception is received
* (break=FALSE, continue=TRUE)
* wfe is set to TRUE if DEBUG_Attach should also proceed with all debug events
* until the first exception is received (aka: attach to an already running process)
*/
BOOL
DEBUG_Attach
(
DWORD
pid
,
BOOL
cofe
,
BOOL
wfe
)
{
DEBUG_EVENT
de
;
if
(
!
(
DEBUG_CurrProcess
=
DEBUG_AddProcess
(
pid
,
0
,
NULL
)))
return
FALSE
;
if
(
!
DebugActiveProcess
(
pid
))
{
DEBUG_Printf
(
DBG_CHN_MESG
,
"Can't attach process %lx: error %ld
\n
"
,
pid
,
GetLastError
());
DEBUG_DelProcess
(
DEBUG_CurrProcess
);
DEBUG_CurrProcess
=
NULL
;
return
FALSE
;
}
DEBUG_CurrProcess
->
continue_on_first_exception
=
cofe
;
if
(
wfe
)
/* shall we proceed all debug events until we get an exception ? */
{
DEBUG_InteractiveP
=
FALSE
;
while
(
DEBUG_CurrProcess
&&
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
DEBUG_HandleDebugEvent
(
&
de
))
break
;
ContinueDebugEvent
(
de
.
dwProcessId
,
de
.
dwThreadId
,
DBG_CONTINUE
);
}
if
(
DEBUG_CurrProcess
)
DEBUG_InteractiveP
=
TRUE
;
}
return
TRUE
;
}
...
...
@@ -329,7 +352,6 @@ BOOL DEBUG_Detach(void)
SetThreadContext
(
DEBUG_CurrThread
->
handle
,
&
DEBUG_context
);
DebugActiveProcessStop
(
DEBUG_CurrProcess
->
pid
);
DEBUG_DelProcess
(
DEBUG_CurrProcess
);
DEBUG_CurrProcess
=
NULL
;
/* FIXME: should zero out the symbol table too */
return
TRUE
;
}
...
...
@@ -1040,18 +1062,18 @@ int main(int argc, char** argv)
if
(
local_mode
==
none_mode
)
local_mode
=
winedbg_mode
;
/* try the f
ro
m <myself> pid */
/* try the f
or
m <myself> pid */
if
(
DEBUG_CurrPid
==
0
&&
argc
==
2
)
{
char
*
ptr
;
DEBUG_CurrPid
=
strtol
(
argv
[
1
],
&
ptr
,
10
);
if
(
DEBUG_CurrPid
==
0
||
ptr
==
NULL
||
!
DEBUG_Attach
(
DEBUG_CurrPid
,
local_mode
!=
gdb_mode
))
!
DEBUG_Attach
(
DEBUG_CurrPid
,
local_mode
!=
gdb_mode
,
FALSE
))
DEBUG_CurrPid
=
0
;
}
/* try the f
ro
m <myself> pid evt (Win32 JIT debugger) */
/* try the f
or
m <myself> pid evt (Win32 JIT debugger) */
if
(
DEBUG_CurrPid
==
0
&&
argc
==
3
)
{
HANDLE
hEvent
;
...
...
@@ -1061,7 +1083,7 @@ int main(int argc, char** argv)
if
((
pid
=
strtol
(
argv
[
1
],
&
ptr
,
10
))
!=
0
&&
ptr
!=
NULL
&&
(
hEvent
=
(
HANDLE
)
strtol
(
argv
[
2
],
&
ptr
,
10
))
!=
0
&&
ptr
!=
NULL
)
{
if
(
!
DEBUG_Attach
(
pid
,
TRUE
))
if
(
!
DEBUG_Attach
(
pid
,
TRUE
,
FALSE
))
{
/* don't care about result */
SetEvent
(
hEvent
);
...
...
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