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
588a4422
Commit
588a4422
authored
Sep 25, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Fixed regression in gdb startup (especially gdb proxy).
parent
e3f8799a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
42 deletions
+35
-42
dbg.y
programs/winedbg/dbg.y
+1
-1
debugger.h
programs/winedbg/debugger.h
+4
-2
stack.c
programs/winedbg/stack.c
+2
-1
tgt_active.c
programs/winedbg/tgt_active.c
+21
-38
winedbg.c
programs/winedbg/winedbg.c
+7
-0
No files found.
programs/winedbg/dbg.y
View file @
588a4422
...
...
@@ -139,7 +139,7 @@ command:
| tSYMBOLFILE pathname { symbol_read_symtable($2, 0); }
| tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); }
| tWHATIS expr_lvalue { dbg_printf("type = "); types_print_type(&$2.type, FALSE); dbg_printf("\n"); }
| tATTACH tNUM { dbg_attach_debuggee($2, FALSE
, TRUE
); }
| tATTACH tNUM { dbg_attach_debuggee($2, FALSE
); dbg_active_wait_for_first_exception(
); }
| tDETACH { dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE); }
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
| tECHO tSTRING { dbg_printf("%s\n", $2); }
...
...
programs/winedbg/debugger.h
View file @
588a4422
...
...
@@ -205,7 +205,8 @@ struct dbg_process
void
*
pio_data
;
const
char
*
imageName
;
struct
dbg_thread
*
threads
;
unsigned
continue_on_first_exception
;
unsigned
continue_on_first_exception
:
1
,
active_debuggee
:
1
;
struct
dbg_breakpoint
bp
[
MAX_BREAKPOINTS
];
unsigned
next_bp
;
struct
dbg_delayed_bp
*
delayed_bp
;
...
...
@@ -378,7 +379,8 @@ extern void dbg_wait_next_exception(DWORD cont, int count, int mode)
extern
enum
dbg_start
dbg_active_attach
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
dbg_active_launch
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
dbg_active_auto
(
int
argc
,
char
*
argv
[]);
extern
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
,
BOOL
wfe
);
extern
void
dbg_active_wait_for_first_exception
(
void
);
extern
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
);
/* tgt_minidump.c */
extern
void
minidump_write
(
const
char
*
,
const
EXCEPTION_RECORD
*
);
...
...
programs/winedbg/stack.c
View file @
588a4422
...
...
@@ -364,13 +364,14 @@ static void backtrace_all(void)
if
(
entry
.
th32OwnerProcessID
!=
dbg_curr_pid
)
{
if
(
!
dbg_attach_debuggee
(
entry
.
th32OwnerProcessID
,
FALSE
,
TRUE
))
if
(
!
dbg_attach_debuggee
(
entry
.
th32OwnerProcessID
,
FALSE
))
{
dbg_printf
(
"
\n
warning: could not attach to 0x%lx
\n
"
,
entry
.
th32OwnerProcessID
);
continue
;
}
dbg_curr_pid
=
dbg_curr_process
->
pid
;
dbg_active_wait_for_first_exception
();
}
dbg_printf
(
"
\n
Backtracing for thread 0x%lx in process 0x%lx (%s):
\n
"
,
...
...
programs/winedbg/tgt_active.c
View file @
588a4422
...
...
@@ -70,10 +70,8 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de);
* wfe is set to TRUE if dbg_attach_debuggee should also proceed with all debug events
* until the first exception is received (aka: attach to an already running process)
*/
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
,
BOOL
wfe
)
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
)
{
DEBUG_EVENT
de
;
if
(
!
(
dbg_curr_process
=
dbg_add_process
(
&
be_process_active_io
,
pid
,
0
)))
return
FALSE
;
if
(
!
DebugActiveProcess
(
pid
))
...
...
@@ -86,15 +84,7 @@ BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe, BOOL wfe)
SetEnvironmentVariableA
(
"DBGHELP_NOLIVE"
,
NULL
);
if
(
wfe
)
/* shall we proceed all debug events until we get an exception ? */
{
dbg_interactiveP
=
FALSE
;
while
(
dbg_curr_process
&&
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
dbg_handle_debug_event
(
&
de
))
break
;
}
if
(
dbg_curr_process
)
dbg_interactiveP
=
TRUE
;
}
dbg_curr_process
->
active_debuggee
=
TRUE
;
return
TRUE
;
}
...
...
@@ -667,9 +657,19 @@ static void dbg_resume_debuggee(DWORD cont)
dbg_printf
(
"Cannot continue on %lu (%lu)
\n
"
,
dbg_curr_tid
,
cont
);
}
static
void
wait_exception
(
void
)
{
DEBUG_EVENT
de
;
while
(
dbg_curr_process
&&
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
dbg_handle_debug_event
(
&
de
))
break
;
}
dbg_interactiveP
=
TRUE
;
}
void
dbg_wait_next_exception
(
DWORD
cont
,
int
count
,
int
mode
)
{
DEBUG_EVENT
de
;
ADDRESS64
addr
;
char
hexbuf
[
MAX_OFFSET_TO_STR_LEN
];
...
...
@@ -680,12 +680,8 @@ void dbg_wait_next_exception(DWORD cont, int count, int mode)
}
dbg_resume_debuggee
(
cont
);
while
(
dbg_curr_process
&&
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
dbg_handle_debug_event
(
&
de
))
break
;
}
wait_exception
();
if
(
!
dbg_curr_process
)
return
;
dbg_interactiveP
=
TRUE
;
memory_get_current_pc
(
&
addr
);
WINE_TRACE
(
"Entering debugger PC=%s mode=%d count=%d
\n
"
,
...
...
@@ -694,18 +690,11 @@ void dbg_wait_next_exception(DWORD cont, int count, int mode)
dbg_curr_thread
->
exec_count
);
}
static
void
dbg
_wait_for_first_exception
(
void
)
void
dbg_active
_wait_for_first_exception
(
void
)
{
DEBUG_EVENT
de
;
if
(
dbg_curr_process
)
dbg_printf
(
"WineDbg starting on pid 0x%lx
\n
"
,
dbg_curr_pid
);
dbg_interactiveP
=
FALSE
;
/* wait for first exception */
while
(
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
dbg_handle_debug_event
(
&
de
))
break
;
}
wait_exception
();
}
static
unsigned
dbg_start_debuggee
(
LPSTR
cmdLine
)
...
...
@@ -749,7 +738,7 @@ static unsigned dbg_start_debuggee(LPSTR cmdLine)
}
dbg_curr_pid
=
info
.
dwProcessId
;
if
(
!
(
dbg_curr_process
=
dbg_add_process
(
&
be_process_active_io
,
dbg_curr_pid
,
0
)))
return
FALSE
;
dbg_
wait_for_first_exception
()
;
dbg_
curr_process
->
active_debuggee
=
TRUE
;
return
TRUE
;
}
...
...
@@ -763,18 +752,13 @@ void dbg_run_debuggee(const char* args)
}
else
{
DEBUG_EVENT
de
;
if
(
!
dbg_last_cmd_line
)
{
dbg_printf
(
"Cannot find previously used command line.
\n
"
);
return
;
}
dbg_start_debuggee
(
dbg_last_cmd_line
);
while
(
dbg_curr_process
&&
WaitForDebugEvent
(
&
de
,
INFINITE
))
{
if
(
dbg_handle_debug_event
(
&
de
))
break
;
}
dbg_active_wait_for_first_exception
();
source_list_from_addr
(
NULL
,
0
);
}
}
...
...
@@ -801,14 +785,14 @@ enum dbg_start dbg_active_attach(int argc, char* argv[])
/* try the form <myself> pid */
if
(
argc
==
1
&&
str2int
(
argv
[
0
],
&
pid
)
&&
pid
!=
0
)
{
if
(
!
dbg_attach_debuggee
(
pid
,
FALSE
,
FALSE
))
if
(
!
dbg_attach_debuggee
(
pid
,
FALSE
))
return
start_error_init
;
}
/* try the form <myself> pid evt (Win32 JIT debugger) */
else
if
(
argc
==
2
&&
str2int
(
argv
[
0
],
&
pid
)
&&
pid
!=
0
&&
str2int
(
argv
[
1
],
&
evt
)
&&
evt
!=
0
)
{
if
(
!
dbg_attach_debuggee
(
pid
,
TRUE
,
FALSE
))
if
(
!
dbg_attach_debuggee
(
pid
,
TRUE
))
{
/* don't care about result */
SetEvent
((
HANDLE
)
evt
);
...
...
@@ -824,7 +808,6 @@ enum dbg_start dbg_active_attach(int argc, char* argv[])
else
return
start_error_parse
;
dbg_curr_pid
=
pid
;
dbg_wait_for_first_exception
();
return
start_ok
;
}
...
...
programs/winedbg/winedbg.c
View file @
588a4422
...
...
@@ -287,6 +287,7 @@ struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid,
p
->
imageName
=
NULL
;
p
->
threads
=
NULL
;
p
->
continue_on_first_exception
=
FALSE
;
p
->
active_debuggee
=
FALSE
;
p
->
next_bp
=
1
;
/* breakpoint 0 is reserved for step-over */
memset
(
p
->
bp
,
0
,
sizeof
(
p
->
bp
));
p
->
delayed_bp
=
NULL
;
...
...
@@ -583,6 +584,12 @@ int main(int argc, char** argv)
case
start_error_init
:
return
-
1
;
}
if
(
dbg_curr_process
)
{
dbg_printf
(
"WineDbg starting on pid 0x%lx
\n
"
,
dbg_curr_pid
);
if
(
dbg_curr_process
->
active_debuggee
)
dbg_active_wait_for_first_exception
();
}
dbg_interactiveP
=
TRUE
;
parser_handle
(
hFile
);
...
...
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