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
2e46d81c
Commit
2e46d81c
authored
Mar 05, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Extend 'attach' command to load minidump files.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
8a65cdd1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
23 deletions
+37
-23
dbg.y
programs/winedbg/dbg.y
+2
-1
debugger.h
programs/winedbg/debugger.h
+2
-1
tgt_minidump.c
programs/winedbg/tgt_minidump.c
+19
-9
winedbg.c
programs/winedbg/winedbg.c
+1
-1
winedbg.man.in
programs/winedbg/winedbg.man.in
+13
-11
No files found.
programs/winedbg/dbg.y
View file @
2e46d81c
...
...
@@ -141,10 +141,11 @@ command:
| tSYMBOLFILE pathname expr_rvalue { symbol_read_symtable($2, $3); }
| tWHATIS expr_lvalue { dbg_printf("type = "); types_print_type(&$2.type, FALSE, NULL); dbg_printf("\n"); }
| tATTACH tNUM { dbg_attach_debuggee($2); dbg_active_wait_for_first_exception(); }
| tATTACH pathname { minidump_reload($2); }
| tDETACH { dbg_curr_process->process_io->close_process(dbg_curr_process, FALSE); }
| tTHREAD tNUM { dbg_set_curr_thread($2); }
| tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); }
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
| 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); }
| tEXECFILE pathname { dbg_set_exec_file($2); }
| run_command
...
...
programs/winedbg/debugger.h
View file @
2e46d81c
...
...
@@ -488,7 +488,8 @@ extern void fetch_module_name(void* name_addr, void* mod_addr, WCHAR
/* tgt_minidump.c */
extern
void
minidump_write
(
const
char
*
,
const
EXCEPTION_RECORD
*
);
extern
enum
dbg_start
minidump_reload
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
minidump_reload
(
const
char
*
);
extern
enum
dbg_start
minidump_start
(
int
argc
,
char
*
argv
[]);
/* tgt_module.c */
extern
enum
dbg_start
tgt_module_load
(
const
char
*
name
,
BOOL
keep
);
...
...
programs/winedbg/tgt_minidump.c
View file @
2e46d81c
...
...
@@ -307,7 +307,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
const
char
*
str
;
char
tmp
[
128
];
dbg_printf
(
"WineDbg starting
on
minidump on pid %04lx
\n
"
,
pid
);
dbg_printf
(
"WineDbg starting minidump on pid %04lx
\n
"
,
pid
);
switch
(
msi
->
ProcessorArchitecture
)
{
case
PROCESSOR_ARCHITECTURE_UNKNOWN
:
...
...
@@ -564,23 +564,23 @@ static void cleanup(struct tgt_process_minidump_data* data)
static
struct
be_process_io
be_process_minidump_io
;
enum
dbg_start
minidump_reload
(
int
argc
,
char
*
argv
[]
)
enum
dbg_start
minidump_reload
(
const
char
*
filename
)
{
struct
tgt_process_minidump_data
*
data
;
enum
dbg_start
ret
=
start_error_parse
;
/* try the form <myself> minidump-file */
if
(
argc
!=
1
)
return
start_error_parse
;
WINE_TRACE
(
"Processing Minidump file %s
\n
"
,
argv
[
0
])
;
if
(
dbg_curr_process
)
{
dbg_printf
(
"Already attached to a process. Use 'detach' or 'kill' before loading a minidump file'
\n
"
);
return
start_error_init
;
}
data
=
malloc
(
sizeof
(
struct
tgt_process_minidump_data
));
if
(
!
data
)
return
start_error_init
;
data
->
mapping
=
NULL
;
data
->
hMap
=
NULL
;
data
->
hFile
=
INVALID_HANDLE_VALUE
;
if
((
data
->
hFile
=
CreateFileA
(
argv
[
0
],
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
if
((
data
->
hFile
=
CreateFileA
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
))
!=
INVALID_HANDLE_VALUE
&&
((
data
->
hMap
=
CreateFileMappingA
(
data
->
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
))
!=
0
)
&&
((
data
->
mapping
=
MapViewOfFile
(
data
->
hMap
,
FILE_MAP_READ
,
0
,
0
,
0
))
!=
NULL
))
...
...
@@ -594,7 +594,7 @@ enum dbg_start minidump_reload(int argc, char* argv[])
}
__EXCEPT_PAGE_FAULT
{
dbg_printf
(
"Unexpected fault while reading minidump %s
\n
"
,
argv
[
0
]
);
dbg_printf
(
"Unexpected fault while reading minidump %s
\n
"
,
filename
);
dbg_curr_pid
=
0
;
}
__ENDTRY
;
...
...
@@ -603,6 +603,16 @@ enum dbg_start minidump_reload(int argc, char* argv[])
return
ret
;
}
enum
dbg_start
minidump_start
(
int
argc
,
char
*
argv
[])
{
/* try the form <myself> minidump-file */
if
(
argc
!=
1
)
return
start_error_parse
;
WINE_TRACE
(
"Processing Minidump file %s
\n
"
,
argv
[
0
]);
return
minidump_reload
(
argv
[
0
]);
}
static
BOOL
tgt_process_minidump_close_process
(
struct
dbg_process
*
pcs
,
BOOL
kill
)
{
struct
tgt_process_minidump_data
*
data
=
private_data
(
pcs
);
...
...
programs/winedbg/winedbg.c
View file @
2e46d81c
...
...
@@ -786,7 +786,7 @@ int main(int argc, char** argv)
}
if
(
!
argc
)
ds
=
start_ok
;
else
if
((
ds
=
dbg_active_attach
(
argc
,
argv
))
==
start_error_parse
&&
(
ds
=
minidump_
reload
(
argc
,
argv
))
==
start_error_parse
)
(
ds
=
minidump_
start
(
argc
,
argv
))
==
start_error_parse
)
ds
=
dbg_active_launch
(
argc
,
argv
);
switch
(
ds
)
{
...
...
programs/winedbg/winedbg.man.in
View file @
2e46d81c
...
...
@@ -138,18 +138,26 @@ Exits the debugger.
Attach to a Wine process (\fIN\fR is its Windows ID, numeric or hexadecimal).
IDs can be obtained using the \fBinfo\ process\fR command. Note the
\fBinfo\ process\fR command returns hexadecimal values
.IP
.IP \fBattach\ \fIfile.mdmp\fR
Reload the state of a debuggee from the minidump \fIfile.mdmp\fR.
See the \fBminidump\fR command to save such a file.
.IP \fBdetach\fR
Detach from a Wine-process.
.IP \fBthread\ \fIN\fR
Change the current thread to \fIN\fR (its Windows TID, numeric or hexadecimal).
.IP
Detach the current Wine-process. The process is no longer debugged by WineDbg,
but is still running (for a live target).
.IP \fBkill\fR
Kills the current Wine-process. The process is no longer debugged by WineDbg,
and is also terminated (for a live target).
.IP \fBminidump\fR\ \fIfile.mdmp\fR
Saves the debugging context of the debuggee into a minidump file called
\fIfile.mdmp\fR.
.IP \fBrun\fR
Re-run the same process with the same arguments.
Note: all breakpoints of precedent process are no longer available.
.IP \fBrun\ \fIarg1\ arg2...\fR
Re-run the same process with arguments \fIarg1\ arg2...\fR.
Note: all breakpoints of precedent process are no longer available.
.IP \fBthread\ \fIN\fR
Change the current thread to \fIN\fR (its Windows TID, numeric or hexadecimal).
.PP
\fIHelp commands\fR
.IP \fBhelp\fR
...
...
@@ -355,12 +363,6 @@ When specifying an identifier, if several symbols with
this name exist, the debugger will prompt for the symbol you want to
use. Pick up the one you want from its number.
.PP
\fIMisc.\fR
.PP
.BI "minidump " file.mdmp
saves the debugging context of the debuggee into a minidump file called
\fIfile.mdmp\fR.
.PP
\fIInformation on Wine internals\fR
.IP \fBinfo\ class\fR
Lists all Windows classes registered in Wine
...
...
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