qcap/tests: Add media tests for the SmartTee filter.
[wine/multimedia.git] / programs / winedbg / winedbg.man.in
blobd6e5dc9c101fa0c382cec4811af81823ce21de79
1 .TH WINEDBG 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
2 .SH NAME
3 winedbg \- Wine debugger
4 .SH SYNOPSIS
5 .B winedbg
6 .RI "[ " options " ] [ " program_name " [ " program_arguments " ] | " wpid " ]"
7 .PP
8 .B winedbg --gdb
9 .RI "[ " options " ] [ " program_name " [ " program_arguments " ] | " wpid " ]"
10 .PP
11 .BI "winedbg --auto " wpid
12 .PP
13 .B winedbg --minidump
14 .RI "[ " file.mdmp " ] " wpid
15 .PP
16 .BI "winedbg " file.mdmp
17 .SH DESCRIPTION
18 .B winedbg
19 is a debugger for Wine. It allows:
20 .RS 4
21 .nf
22 + debugging native Win32 applications
23 + debugging Winelib applications
24 + being a drop-in replacement for Dr Watson
25 .fi
26 .RE
27 .PP
29 .SH MODES
30 \fBwinedbg\fR can be used in five modes.  The first argument to the
31 program determines the mode winedbg will run in.
32 .IP \fBdefault\fR
33 Without any explicit mode, this is standard \fBwinedbg\fR operating
34 mode. \fBwinedbg\fR will act as the front end for the user.
35 .IP \fB--gdb\fR
36 \fBwinedbg\fR will be used as a proxy for \fBgdb\fR. \fBgdb\fR will be
37 the front end for command handling, and \fBwinedbg\fR will proxy all
38 debugging requests from \fBgdb\fR to the Win32 APIs.
39 .IP \fB--auto\fR
40 This mode is used when \fBwinedbg\fR is set up in \fIAeDebug\fR
41 registry entry as the default debugger. \fBwinedbg\fR will then
42 display basic information about a crash. This is useful for users
43 who don't want to debug a crash, but rather gather relevant
44 information about the crash to be sent to developers.
45 .IP \fB--minidump\fR
46 This mode is similar to the \fB--auto\fR one, except that instead of
47 printing the information on the screen (as \fB--auto\fR does), it's
48 saved into a minidump file. The name of the file is either passed on
49 the command line, or generated by \fBWineDbg\fR when none is given.
50 This file could later on be reloaded into \fBwinedbg\fR for further
51 examination.
52 .IP \fBfile.mdmp\fR
53 In this mode \fBwinedbg\fR reloads the state of a debuggee which
54 has been saved into a minidump file. See either the \fBminidump\fR
55 command below, or the \fB--minidump mode\fR.
57 .SH OPTIONS
58 When in \fBdefault\fR mode, the following options are available:
59 .PP
60 .IP \fB--command\ \fIstring\fR
61 \fBwinedbg\fR will execute the command \fIstring\fR as if it was keyed on
62 winedbg command line, and then will exit. This can be handy for
63 getting the pid of running processes (winedbg --command "info proc").
64 .IP \fB--file\ \fIfilename\fR
65 \fBwinedbg\fR will execute the list of commands contained in file
66 filename as if they were keyed on winedbg command line, and then
67 will exit.
68 .PP
69 When in \fBgdb\fR proxy mode, the following options are available:
70 .PP
71 .IP \fB--no-start\fR
72 \fBgdb\fR will not be automatically
73 started. Relevant information for starting \fBgdb\fR is printed on
74 screen. This is somehow useful when not directly using \fBgdb\fR but
75 some graphical front-ends, like \fBddd\fR or \fBkgbd\fR. 
76 .IP \fB--with-xterm\fR
77 This will run \fBgdb\fR in its own xterm instead of using the current
78 Unix console for textual display.
79 .PP
80 In all modes, the rest of the command line, when passed, is used to 
81 identify which programs, if any, has to debugged:
82 .IP \fIprogram_name\fR
83 This is the name of an executable to start for a debugging
84 session.  \fBwinedbg\fR will actually create a process with this
85 executable. If \fIprograms_arguments\fR are also given, they will be
86 used as arguments for creating the process to be debugged.
87 .IP \fIwpid\fR
88 \fBwinedbg\fR will attach to the process which Windows pid is \fIwpid\fR.
89 Use the \fBinfo proc\fR command within \fBwinedbg\fR to list running processes
90 and their Windows pids.
91 .IP \fBdefault\fR
92 If nothing is specified, you will enter the debugger without any run
93 nor attached process. You'll have to do the job yourself.
95 .SH COMMANDS
96 .SS Default mode, and while reloading a minidump file:
97 .PP
98 Most of commands used in \fBwinedbg\fR are similar to the ones from
99 \fBgdb\fR. Please refer to the \fBgdb\fR documentations for some more
100 details. See the \fIgdb\ differences\fR section later on to get a list
101 of variations from \fBgdb\fR commands.
103 \fIMisc. commands\fR
104 .IP \fBabort\fR
105 Aborts the debugger.
106 .IP \fBquit\fR
107 Exits the debugger.
108 .IP \fBattach\ \fIN\fR
109 Attach to a Wine process (\fIN\fR is its Windows ID, numeric or hexadecimal).
110 IDs can be obtained using the \fBinfo\ process\fR command.  Note the
111 \fBinfo\ process\fR command returns hexadecimal values
112 .IP 
113 .IP \fBdetach\fR
114 Detach from a Wine-process.
116 \fIHelp commands\fR
117 .IP \fBhelp\fR
118 Prints some help on the commands.
119 .IP \fBhelp\ info\fR
120 Prints some help on info commands
122 \fIFlow control commands\fR
123 .IP \fBcont\fR
124 Continue execution until next breakpoint or exception.
125 .IP \fBpass\fR
126 Pass the exception event up to the filter chain.
127 .IP \fBstep\fR
128 Continue execution until next C line of code (enters function call)
129 .IP \fBnext\fR
130 Continue execution until next C line of code (doesn't enter function
131 call)
132 .IP \fBstepi\fR
133 Execute next assembly instruction (enters function call)
134 .IP \fBnexti\fR
135 Execute next assembly instruction (doesn't enter function call)
136 .IP \fBfinish\fR
137 Execute until return of current function is reached.
139 \fBcont\fR, \fBstep\fR, \fBnext\fR, \fBstepi\fR, \fBnexti\fR can be
140 postfixed by a number (N), meaning that the command must be executed N
141 times before control is returned to the user.
143 \fIBreakpoints, watchpoints
144 .IP \fBenable\ \fIN\fR
145 Enables (break|watch)-point \fIN\fR
146 .IP \fBdisable\ \fIN\fR
147 Disables (break|watch)-point \fIN\fR
148 .IP \fBdelete\ \fIN\fR
149 Deletes (break|watch)-point \fIN\fR
150 .IP \fBcond\ \fIN\fR
151 Removes any existing condition to (break|watch)-point \fIN\fR
152 .IP \fBcond\ \fIN\ expr\fR
153 Adds condition \fIexpr\fR to (break|watch)-point
154 \fIN\fR. \fIexpr\fR will be evaluated each time the
155 (break|watch)-point is hit. If the result is a zero value, the
156 breakpoint isn't triggered.
157 .IP \fBbreak\ *\ \fIN\fR
158 Adds a breakpoint at address \fIN\fR
159 .IP \fBbreak\ \fIid\fR
160 Adds a breakpoint at the address of symbol \fIid\fR
161 .IP \fBbreak\ \fIid\ N\fR
162 Adds a breakpoint at the line \fIN\fR inside symbol \fIid\fR.
163 .IP \fBbreak\ \fIN\fR
164 Adds a breakpoint at line \fIN\fR of current source file.
165 .IP \fBbreak\fR
166 Adds a breakpoint at current \f$PC\fR address.
167 .IP \fBwatch\ *\ \fIN\fR
168 Adds a watch command (on write) at address \fIN\fR (on 4 bytes).
169 .IP \fBwatch\ \fIid\fR
170 Adds a watch command (on write) at the address of symbol
171 \fIid\fR. Size depends on size of \fIid\fR.
172 .IP \fBrwatch\ *\ \fIN\fR
173 Adds a watch command (on read) at address \fIN\fR (on 4 bytes).
174 .IP \fBrwatch\ \fIid\fR
175 Adds a watch command (on read) at the address of symbol
176 \fIid\fR. Size depends on size of \fIid\fR.
177 .IP \fBinfo\ break\fR
178 Lists all (break|watch)-points (with their state).
180 You can use the symbol \fBEntryPoint\fR to stand for the entry point of the Dll.
182 When setting a (break|watch)-point by \fIid\fR, if the symbol cannot
183 be found (for example, the symbol is contained in a not yet loaded
184 module), \fBwinedbg\fR will recall the name of the symbol and will try
185 to set the breakpoint each time a new module is loaded (until it succeeds). 
187 \fIStack manipulation\fR
188 .IP \fBbt\fR
189 Print calling stack of current thread.
190 .IP \fBbt\ \fIN\fR
191 Print calling stack of thread of ID \fIN\fR. Note: this doesn't change
192 the position of the current frame as manipulated by the \fBup\fR &
193 \fBdn\fR commands).
194 .IP \fBup\fR
195 Goes up one frame in current thread's stack
196 .IP \fBup\ \fIN\fR
197 Goes up \fIN\fR frames in current thread's stack
198 .IP \fBdn\fR
199 Goes down one frame in current thread's stack
200 .IP \fBdn\ \fIN\fR
201 Goes down \fIN\fR frames in current thread's stack
202 .IP \fBframe\ \fIN\fR
203 Sets \fIN\fR as the current frame for current thread's stack.
204 .IP \fBinfo\ locals\fR
205 Prints information on local variables for current function frame.
207 \fIDirectory & source file manipulation\fR
208 .IP \fBshow\ dir\fR
209 Prints the list of dirs where source files are looked for.
210 .IP \fBdir\ \fIpathname\fR
211 Adds \fIpathname\fR to the list of dirs where to look for source
212 files
213 .IP \fBdir\fR
214 Deletes the list of dirs where to look for source files
215 .IP \fBsymbolfile\ \fIpathname\fR
216 Loads external symbol definition file \fIpathname\fR
217 .IP \fBsymbolfile\ \fIpathname\ N\fR
218 Loads external symbol definition file \fIpathname\fR (applying
219 an offset of \fIN\fR to addresses)
220 .IP \fBlist\fR
221 Lists 10 source lines forwards from current position.
222 .IP \fBlist\ -\fR
223 Lists 10 source lines backwards from current position
224 .IP \fBlist\ \fIN\fR
225 Lists 10 source lines from line \fIN\fR in current file
226 .IP \fBlist\ \fIpathname\fB:\fIN\fR
227 Lists 10 source lines from line \fIN\fR in file \fIpathname\fR
228 .IP \fBlist\ \fIid\fR
229 Lists 10 source lines of function \fIid\fR
230 .IP \fBlist\ *\ \fIN\fR
231 Lists 10 source lines from address \fIN\fR
233 You can specify the end target (to change the 10 lines value) using
234 the ',' separator. For example:
235 .IP \fBlist\ 123,\ 234\fR
236 lists source lines from line 123 up to line 234 in current file
237 .IP \fBlist\ foo.c:1,56\fR
238 lists source lines from line 1 up to 56 in file foo.c
240 \fIDisplaying\fR
242 A display is an expression that's evaluated and printed after the
243 execution of any \fBwinedbg\fR command.
244 .IP \fBdisplay\fR
245 .IP \fBinfo\ display\fR
246 Lists the active displays
247 .IP \fBdisplay\ \fIexpr\fR
248 Adds a display for expression \fIexpr\fR
249 .IP \fBdisplay\ /\fIfmt\ \fIexpr\fR
250 Adds a display for expression \fIexpr\fR. Printing evaluated
251 \fIexpr\fR is done using the given format (see \fBprint\ command\fR
252 for more on formats)
253 .IP \fBdel\ display\ \fIN\fR
254 .IP \fBundisplay\ \fIN\fR
255 Deletes display \fIN\fR
257 \fIDisassembly\fR
258 .IP \fBdisas\fR
259 Disassemble from current position
260 .IP \fBdisas\ \fIexpr\fR
261 Disassemble from address \fIexpr\fR
262 .IP \fBdisas\ \fIexpr\fB,\fIexpr\fR
263 Disassembles code between addresses specified by the two expressions
265 \fIMemory\ (reading,\ writing,\ typing)\fR
266 .IP \fBx\ \fIexpr\fR
267 Examines memory at address \fIexpr\fR
268 .IP \fBx\ /\fIfmt\ expr\fR
269 Examines memory at address \fIexpr\fR using format \fIfmt\fR
270 .IP \fBprint\ \fIexpr\fR
271 Prints the value of \fIexpr\fR (possibly using its type)
272 .IP \fBprint\ /\fIfmt\ expr\fR
273 Prints the value of \fIexpr\fR (possibly using its type)
274 .IP \fBset\ \fIvar\fB\ =\ \fIexpr\fR
275 Writes the value of \fIexpr\fR in \fIvar\fR variable
276 .IP \fBwhatis\ \fIexpr\fR
277 Prints the C type of expression \fIexpr\fR
279 .IP \fIfmt\fR
280 is either \fIletter\fR or \fIcount letter\fR, where \fIletter\fR
281 can be:
282 .RS 4
283 .IP s
284 an ASCII string
285 .IP u
286 a UTF16 Unicode string
287 .IP i
288 instructions (disassemble)
289 .IP x
290 32-bit unsigned hexadecimal integer
291 .IP d
292 32-bit signed decimal integer
293 .IP w
294 16-bit unsigned hexadecimal integer
295 .IP c
296 character (only printable 0x20-0x7f are actually printed)
297 .IP b
298 8-bit unsigned hexadecimal integer
299 .IP g
300 Win32 GUID
303 \fIExpressions\fR
305 Expressions in Wine Debugger are mostly written in a C form. However,
306 there are a few discrepancies:
308 .RS 4
309 Identifiers can take a '!' in their names. This allows mainly to
310 specify a module where to look the ID from, e.g. \fIUSER32!CreateWindowExA\fR.
312 In a cast operation, when specifying a structure or a union, you must
313 use the struct or union keyword (even if your program uses a typedef).
316 When specifying an identifier, if several symbols with
317 this name exist, the debugger will prompt for the symbol you want to
318 use. Pick up the one you want from its number.
320 \fIMisc.\fR
322 .BI "minidump " file.mdmp
323 saves the debugging context of the debuggee into a minidump file called 
324 \fIfile.mdmp\fR.
326 \fIInformation on Wine internals\fR
327 .IP \fBinfo\ class\fR
328 Lists all Windows classes registered in Wine
329 .IP \fBinfo\ class\ \fIid\fR
330 Prints information on Windows class \fIid\fR
331 .IP \fBinfo\ share\fR
332 Lists all the dynamic libraries loaded in the debugged program
333 (including .so files, NE and PE DLLs)
334 .IP \fBinfo\ share\ \fIN\fR
335 Prints information on module at address \fIN\fR
336 .IP \fBinfo\ regs\fR
337 Prints the value of the CPU registers
338 .IP \fBinfo\ all-regs\fR
339 Prints the value of the CPU and Floating Point registers
340 .IP \fBinfo\ segment\fR
341 Lists all allocated segments (i386 only)
342 .IP \fBinfo\ segment\ \fIN\fR
343 Prints information on segment \fIN\fR (i386 only)
344 .IP \fBinfo\ stack\fR
345 Prints the values on top of the stack
346 .IP \fBinfo\ map\fR
347 Lists all virtual mappings used by the debugged program
348 .IP \fBinfo\ map\ \fIN\fR
349 Lists all virtual mappings used by the program of Windows pid \fIN\fR
350 .IP \fBinfo\ wnd\fR
351 Displays the window hierarchy starting from the desktop window
352 .IP \fBinfo\ wnd\ \fIN\fR
353 Prints information of Window of handle \fIN\fR
354 .IP \fBinfo\ process\fR
355 Lists all w-processes in Wine session
356 .IP \fBinfo\ thread\fR
357 Lists all w-threads in Wine session
358 .IP \fBinfo\ frame\fR
359 Lists the exception frames (starting from current stack frame). You
360 can also pass, as optional argument, a thread id (instead of current
361 thread) to examine its exception frames.
363 Debug messages can be turned on and off as you are debugging using
364 the \fBset\fR command, but only for channels initialized with the
365 \fIWINEDEBUG\fR environment variable.
366 .IP \fBset\ warn\ +\ \fIwin\fR
367 Turns on warn on \fIwin\fR channel
368 .IP \fBset\ +\ \fIwin\fR
369 Turns on warn/fixme/err/trace on \fIwin\fR channel
370 .IP \fBset\ -\ \fIwin\fR
371 Turns off warn/fixme/err/trace on \fIwin\fR channel
372 .IP \fBset\ fixme\ -\ all\fR
373 Turns off fixme class on all channels
375 .SS Gdb mode:
377 See the \fBgdb\fR documentation for all the \fBgdb\fR commands.
379 However, a few Wine extensions are available, through the
380 \fBmonitor\fR command:
381 .IP \fBmonitor\ wnd\fR
382 Lists all windows in the Wine session
383 .IP \fBmonitor\ proc\fR
384 Lists all processes in the Wine session
385 .IP \fBmonitor\ mem\fR
386 Displays memory mapping of debugged process
388 .SS Auto and minidump modes:
390 Since no user input is possible, no commands are available.
392 .SH ENVIRONMENT
393 .IP \fBWINE_GDB\fR
394 When used in \fBgdb\fR proxy mode, \fBWINE_GDB\fR specifies the name
395 (and the path) of the executable to be used for \fBgdb\fR. "gdb"
396 is used by default.
397 .SH AUTHORS
398 The first version was written by Eric Youngdale.
400 See Wine developers list for the rest of contributors.
401 .SH BUGS
402 Bugs can be reported on the
403 .UR http://bugs.winehq.org
404 .B Wine bug tracker
405 .UE .
406 .SH AVAILABILITY
407 .B winedbg
408 is part of the Wine distribution, which is available through WineHQ,
410 .UR http://www.winehq.org/
411 .B Wine development headquarters
412 .UE .
413 .SH "SEE ALSO"
414 .BR wine (1),
416 .UR http://www.winehq.org/help
417 .B Wine documentation and support
418 .UE .