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
dea7ced7
Commit
dea7ced7
authored
Jan 16, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Split minidump option handling to a separate function.
parent
adad80f4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
12 deletions
+40
-12
debugger.h
programs/winedbg/debugger.h
+2
-0
tgt_active.c
programs/winedbg/tgt_active.c
+27
-7
winedbg.c
programs/winedbg/winedbg.c
+11
-5
No files found.
programs/winedbg/debugger.h
View file @
dea7ced7
...
@@ -255,6 +255,7 @@ extern struct dbg_thread* dbg_curr_thread;
...
@@ -255,6 +255,7 @@ extern struct dbg_thread* dbg_curr_thread;
extern
DWORD_PTR
dbg_curr_tid
;
extern
DWORD_PTR
dbg_curr_tid
;
extern
CONTEXT
dbg_context
;
extern
CONTEXT
dbg_context
;
extern
BOOL
dbg_interactiveP
;
extern
BOOL
dbg_interactiveP
;
extern
HANDLE
dbg_houtput
;
struct
dbg_internal_var
struct
dbg_internal_var
{
{
...
@@ -419,6 +420,7 @@ extern void dbg_wait_next_exception(DWORD cont, int count, int mode)
...
@@ -419,6 +420,7 @@ 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_attach
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
dbg_active_launch
(
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
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
void
dbg_active_wait_for_first_exception
(
void
);
extern
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
);
extern
BOOL
dbg_attach_debuggee
(
DWORD
pid
,
BOOL
cofe
);
...
...
programs/winedbg/tgt_active.c
View file @
dea7ced7
...
@@ -757,8 +757,8 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
...
@@ -757,8 +757,8 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
HANDLE
hFile
;
HANDLE
hFile
;
enum
dbg_start
ds
=
start_error_parse
;
enum
dbg_start
ds
=
start_error_parse
;
if
(
!
strcmp
(
argv
[
0
],
"--auto"
))
DBG_IVAR
(
BreakOnDllLoad
)
=
0
;
{
/* auto mode */
/* auto mode */
argc
--
;
argv
++
;
argc
--
;
argv
++
;
ds
=
dbg_active_attach
(
argc
,
argv
);
ds
=
dbg_active_attach
(
argc
,
argv
);
...
@@ -775,12 +775,34 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
...
@@ -775,12 +775,34 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
hFile
=
parser_generate_command_file
(
"echo Modules:"
,
"info share"
,
hFile
=
parser_generate_command_file
(
"echo Modules:"
,
"info share"
,
"echo Threads:"
,
"info threads"
,
"echo Threads:"
,
"info threads"
,
"kill"
,
NULL
);
"kill"
,
NULL
);
}
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
start_error_parse
;
else
if
(
!
strcmp
(
argv
[
0
],
"--minidump"
))
{
dbg_houtput
=
GetStdHandle
(
STD_ERROR_HANDLE
);
if
(
dbg_curr_process
->
active_debuggee
)
dbg_active_wait_for_first_exception
();
dbg_interactiveP
=
TRUE
;
parser_handle
(
hFile
);
return
start_ok
;
}
/******************************************************************
* dbg_active_minidump
*
* Starts (<pid> or <pid> <evt>) in minidump mode
*/
enum
dbg_start
dbg_active_minidump
(
int
argc
,
char
*
argv
[])
{
HANDLE
hFile
;
enum
dbg_start
ds
=
start_error_parse
;
const
char
*
file
=
NULL
;
const
char
*
file
=
NULL
;
char
tmp
[
8
+
1
+
MAX_PATH
];
/* minidump <file> */
char
tmp
[
8
+
1
+
MAX_PATH
];
/* minidump <file> */
dbg_houtput
=
GetStdHandle
(
STD_ERROR_HANDLE
);
DBG_IVAR
(
BreakOnDllLoad
)
=
0
;
argc
--
;
argv
++
;
argc
--
;
argv
++
;
/* hard stuff now ; we can get things like:
/* hard stuff now ; we can get things like:
* --minidump <pid> 1 arg
* --minidump <pid> 1 arg
...
@@ -824,8 +846,6 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
...
@@ -824,8 +846,6 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
dbg_printf
(
"Capturing program state in %s
\n
"
,
tmp
+
9
);
dbg_printf
(
"Capturing program state in %s
\n
"
,
tmp
+
9
);
}
}
hFile
=
parser_generate_command_file
(
tmp
,
"detach"
,
NULL
);
hFile
=
parser_generate_command_file
(
tmp
,
"detach"
,
NULL
);
}
else
return
start_error_parse
;
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
start_error_parse
;
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
start_error_parse
;
if
(
dbg_curr_process
->
active_debuggee
)
if
(
dbg_curr_process
->
active_debuggee
)
...
...
programs/winedbg/winedbg.c
View file @
dea7ced7
...
@@ -89,11 +89,11 @@ DWORD_PTR dbg_curr_tid = 0;
...
@@ -89,11 +89,11 @@ DWORD_PTR dbg_curr_tid = 0;
DWORD_PTR
dbg_curr_pid
=
0
;
DWORD_PTR
dbg_curr_pid
=
0
;
CONTEXT
dbg_context
;
CONTEXT
dbg_context
;
BOOL
dbg_interactiveP
=
FALSE
;
BOOL
dbg_interactiveP
=
FALSE
;
HANDLE
dbg_houtput
=
0
;
static
struct
list
dbg_process_list
=
LIST_INIT
(
dbg_process_list
);
static
struct
list
dbg_process_list
=
LIST_INIT
(
dbg_process_list
);
struct
dbg_internal_var
dbg_internal_vars
[
DBG_IV_LAST
];
struct
dbg_internal_var
dbg_internal_vars
[
DBG_IV_LAST
];
static
HANDLE
dbg_houtput
;
static
void
dbg_outputA
(
const
char
*
buffer
,
int
len
)
static
void
dbg_outputA
(
const
char
*
buffer
,
int
len
)
{
{
...
@@ -668,11 +668,8 @@ int main(int argc, char** argv)
...
@@ -668,11 +668,8 @@ int main(int argc, char** argv)
SymSetOptions
((
SymGetOptions
()
&
~
(
SYMOPT_UNDNAME
))
|
SymSetOptions
((
SymGetOptions
()
&
~
(
SYMOPT_UNDNAME
))
|
SYMOPT_LOAD_LINES
|
SYMOPT_DEFERRED_LOADS
|
SYMOPT_AUTO_PUBLICS
);
SYMOPT_LOAD_LINES
|
SYMOPT_DEFERRED_LOADS
|
SYMOPT_AUTO_PUBLICS
);
if
(
argc
&&
(
!
strcmp
(
argv
[
0
],
"--auto"
)
||
!
strcmp
(
argv
[
0
],
"--minidump"
)
))
if
(
argc
&&
!
strcmp
(
argv
[
0
],
"--auto"
))
{
{
/* force some internal variables */
DBG_IVAR
(
BreakOnDllLoad
)
=
0
;
dbg_houtput
=
GetStdHandle
(
STD_ERROR_HANDLE
);
switch
(
dbg_active_auto
(
argc
,
argv
))
switch
(
dbg_active_auto
(
argc
,
argv
))
{
{
case
start_ok
:
return
0
;
case
start_ok
:
return
0
;
...
@@ -680,6 +677,15 @@ int main(int argc, char** argv)
...
@@ -680,6 +677,15 @@ int main(int argc, char** argv)
case
start_error_init
:
return
-
1
;
case
start_error_init
:
return
-
1
;
}
}
}
}
if
(
argc
&&
!
strcmp
(
argv
[
0
],
"--minidump"
))
{
switch
(
dbg_active_minidump
(
argc
,
argv
))
{
case
start_ok
:
return
0
;
case
start_error_parse
:
return
dbg_winedbg_usage
(
FALSE
);
case
start_error_init
:
return
-
1
;
}
}
/* parse options */
/* parse options */
while
(
argc
>
0
&&
argv
[
0
][
0
]
==
'-'
)
while
(
argc
>
0
&&
argv
[
0
][
0
]
==
'-'
)
{
{
...
...
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