Module: wine Branch: refs/heads/master Commit: 81198f3971ffc60a5742705330daf89ce72b26cb URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=81198f3971ffc60a57427053...
Author: Eric Pouech eric.pouech@wanadoo.fr Date: Wed Mar 1 21:05:39 2006 +0100
winedbg: Bring usage() and .man up to date.
---
programs/winedbg/winedbg.c | 31 +++++++++++++--- programs/winedbg/winedbg.man.in | 75 ++++++++++++++++++++++++++++----------- 2 files changed, 79 insertions(+), 27 deletions(-)
diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 99f04ef..6f2fdea 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -450,9 +450,25 @@ static void dbg_init_console(void) SetConsoleTitle("Wine Debugger"); }
-static int dbg_winedbg_usage(void) +static int dbg_winedbg_usage(BOOL advanced) { - dbg_printf("Usage: winedbg [--command cmd|--file file|--auto] [--gdb [--no-start] [--with-xterm]] cmdline\n"); + if (advanced) + { + dbg_printf("Usage:\n" + " winedbg cmdline launch process 'cmdline' (as if you were starting\n" + " it with wine) and run WineDbg on it\n" + " winedbg <num> attach to running process of pid <num> and run\n" + " WineDbg on it\n" + " winedbg --gdb cmdline launch process 'cmdline' (as if you were starting\n" + " wine) and run gdb (proxied) on it\n" + " winedbg --gdb <num> attach to running process of pid <num> and run\n" + " gdb (proxied) on it\n" + " winedbg file.mdmp reload the minidump file.mdmp into memory and run\n" + " WineDbg on it\n" + " winedbg --help prints advanced options\n"); + } + else + dbg_printf("Usage:\n\twinedbg [ [ --gdb ] [ prog-name [ prog-args ] | <num> | file.mdmp | --help ]\n"); return -1; }
@@ -491,10 +507,13 @@ int main(int argc, char** argv) /* as we don't care about exec name */ argc--; argv++;
+ if (argc && !strcmp(argv[0], "--help")) + return dbg_winedbg_usage(TRUE); + if (argc && !strcmp(argv[0], "--gdb")) { retv = gdb_main(argc, argv); - if (retv == -1) dbg_winedbg_usage(); + if (retv == -1) dbg_winedbg_usage(FALSE); return retv; } dbg_init_console(); @@ -510,7 +529,7 @@ int main(int argc, char** argv) switch (dbg_active_auto(argc, argv)) { case start_ok: return 0; - case start_error_parse: return dbg_winedbg_usage(); + case start_error_parse: return dbg_winedbg_usage(FALSE); case start_error_init: return -1; } } @@ -547,7 +566,7 @@ int main(int argc, char** argv) argc--; argv++; break; } - return dbg_winedbg_usage(); + return dbg_winedbg_usage(FALSE); } if (!argc) ds = start_ok; else if ((ds = dbg_active_attach(argc, argv)) == start_error_parse && @@ -556,7 +575,7 @@ int main(int argc, char** argv) switch (ds) { case start_ok: break; - case start_error_parse: return dbg_winedbg_usage(); + case start_error_parse: return dbg_winedbg_usage(FALSE); case start_error_init: return -1; }
diff --git a/programs/winedbg/winedbg.man.in b/programs/winedbg/winedbg.man.in index 9934547..a064b5c 100644 --- a/programs/winedbg/winedbg.man.in +++ b/programs/winedbg/winedbg.man.in @@ -3,17 +3,32 @@ .SH NAME winedbg - Wine's debugger .SH SYNOPSIS -.BR "winedbg [" -.RI "[ " " options " "]" -.BR "| --auto |" +.BR "winedbg " +.RI "[" " options " "] [" +.BI "program name" +.RI "[ program arguments ] |" +.BI "pid" +.RI "]" +.PP +.BR "winedbg " .BI "--gdb" -.RI "[" " options " "] ] [" +.RI "[" " options " "] [" .BI "program name" -.RI "[" -.BI "program arguments" -.RI "] |" +.RI "[ program arguments ] |" .BI "pid" .RI "]" +.PP +.BR "winedbg " +.BI "--auto " +.BI "pid" +.PP +.BR "winedbg " +.BI "--minidump " +.RI "[ file.mdmp ]" +.BI "pid" +.PP +.BR "winedbg" +.BI "file.mdmp" .SH DESCRIPTION .B winedbg is a debugger for Wine. It allows: @@ -27,21 +42,32 @@ is a debugger for Wine. It allows: .PP
.SH MODES -\fBwinedbg\fR can be used in three modes. The first argument to the +\fBwinedbg\fR can be used in five modes. The first argument to the program determines the mode winedbg will run in. .IP \fBdefault\fR Without any explicit mode, this is standard \fBwinedbg\fR operating mode. \fBwinedbg\fR will act as the front end for the user. +.IP \fB--gdb\fR +\fBwinedbg\fR will be used as a proxy for \fBgdb\fR. \fBgdb\fR will be +the front end for command handling, and \fBwinedbg\fR will proxy all +debugging requests from \fBgdb\fR to the Win32 APIs. .IP \fB--auto\fR -This mode is used when \fBwinedbg\fR is setup in \fIAeDebug\fR +This mode is used when \fBwinedbg\fR is set up in \fIAeDebug\fR registry entry as the default debugger. \fBwinedbg\fR will then display basic information about a crash. This is useful for users who don't want to debug a crash, but rather gather relevant information about the crash to be sent to developers. -.IP \fB--gdb\fR -\fBwinedbg\fR will be used as a proxy for \fBgdb\fR. \fBgdb\fR will be -the front end for command handling, and \fBwinedbg\fR will proxy all -debugging requests from \fBgdb\fR to the Win32 APIs. +.IP \fB--minidump\fR +This mode is similar to the \fB--auto\fR one, except that instead of +printing the information on the screen (as \fB--auto\fR does), it's +saved into a minidump file. The name of the file is either passed on +the command line, or generated by \fBWineDbg\fR when none is given. +This file could later on be reloaded into \fBwinedbg\fR for further +examination. +.IP \fBfile.mdmp\fR +This mode allows to reload into \fBwinedbg\fR the state of a debuggee +which has been saved into a minidump file. See either the \fBminidump\fR +command below, or the \fB--minidump mode\fR.
.SH OPTIONS When in \fBdefault\fR mode, the following options are available: @@ -58,7 +84,8 @@ will exit.
When in \fBgdb\fR proxy mode, the following options are available: .PP -.IP \fI--no-start\fR \fBgdb\fR will not be automatically +.IP \fI--no-start\fR +\fBgdb\fR will not be automatically started. Relevant information for starting \fBgdb\fR are printed on screen. This is somehow useful when not directly using \fBgdb\fR but some graphical front-ends, like \fBddd\fR or \fBkgbd\fR. @@ -82,7 +109,7 @@ If nothing is specified, you will enter nor attached process. You'll have to do the job yourself.
.SH COMMANDS -.SS Default mode: +.SS Default mode, and while reloading a minidump file: .PP Most of commands used in \fBwinedbg\fR are similar to the ones from \fBgdb\fR. Please refer to the \fBgdb\fR documentations for some more @@ -147,7 +174,7 @@ breakpoint isn't triggered. Adds a breakpoint at address \fBN\fR .IP \fBbreak\ <id>\fR Adds a breakpoint at the address of symbol \fB<id>\fR -.IP \fBbreak <id> N\fR +.IP \fBbreak\ <id>\ N\fR Adds a breakpoint at the line \fBN\fR inside symbol \fB<id>\fR. .IP \fBbreak\ N\fR Adds a breakpoint at line \fBN\fR of current source file. @@ -183,7 +210,7 @@ Goes up \fBN\fR frames in current thread Goes down one frame in current thread's stack .IP \fBdn\ N\fR Goes down \fBN\fR frames in current thread's stack -.IP \fBframe N\fR +.IP \fBframe\ N\fR Sets \fBN\fR as the current frame for current thread's stack. .IP \fBinfo\ locals\fR Prints information on local variables for current function frame. @@ -303,6 +330,12 @@ When specifying an identifier \fB<id>\fR 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 +.IP \fBminidump\ file.mdmp\fR +saves the debugging context of the debuggee into a minidump file called +file.mdmp +.PP \fIInformation on Wine's internals\fR .IP \fBinfo\ class\fR Lists all Windows' class registered in Wine @@ -317,7 +350,7 @@ Prints information on module at address Prints the value of the CPU registers .IP \fBinfo\ segment\fR Lists all allocated segments (i386 only) -.IP \fBinfo\ segment N\fR +.IP \fBinfo\ segment\ N\fR Prints information on segment \fBN\fR (i386 only) .IP \fBinfo\ stack\fR Prints the values on top of the stack @@ -355,12 +388,12 @@ However, a few Wine's extension are avai \fBmonitor\fR command: .IP \fBmonitor\ wnd\fR Lists all window in the Wine session -.IP \fBmonitor proc\fR +.IP \fBmonitor\ proc\fR Lists all processes in the Wine session -.IP \fBmonitor mem \fR +.IP \fBmonitor\ mem\fR Displays memory mapping of debugged process .PP -.SS Auto mode: +.SS Auto and minidump modes: .PP Since no user input is possible, no commands are available.