Put Wine version information in all the man pages.
[wine/wine-kai.git] / programs / winedbg / winedbg.man.in
blob916749603d92eb9ba1102a5cc5fbd10e78c9e167
1 .\" -*- nroff -*-
2 .TH WINEDBG 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
3 .SH NAME
4 winedbg \- Wine's debugger
5 .SH SYNOPSIS
6 .BR "winedbg " [ " --auto" " |"
7 .BI "--gdb"
8 .RI "[" " options " "] ] ["
9 .BI "program name"
10 .RI "["
11 .BI "program arguments"
12 .RI "] |"
13 .BI "pid"
14 .RI "]"
15 .SH DESCRIPTION
16 .B winedbg
17 is a debugger for Wine. It allows:
18 .RS 4
19 + debugging native Win32 applications
20 .nf
21 + debugging Winelib applications.
22 .nf
23 + being a drop-in replacement for Dr Watson
24 .RE
25 .PP
27 .SH MODES
28 \fBwinedbg\fR can be used in three modes.  The first argument to the
29 program determines the mode winedbg will run in.
30 .IP \fBdefault\fR
31 Without any explicit mode, this is standard \fBwinedbg\fR operating
32 mode. \fBwinedbg\fR will act as the front end for the user.
33 .IP \fB--auto\fR
34 This mode is used when \fBwinedbg\fR is setup in \fIAeDebug\fR
35 registry entry as the default debugger. \fBwinedbg\fR will then
36 display basic information about a crash. This is useful for users
37 who don't want to debug a crash, but rather gather relevant
38 information about the crash to be sent to developers.
39 .IP \fB--gdb\fR
40 \fBwinedbg\fR will be used as a proxy for \fBgdb\fR. \fBgdb\fR will be
41 the front end for command handling, and \fBwinedbg\fR will proxy all
42 debugging requests from \fBgdb\fR to the Win32 APIs.
44 .SH OPTIONS
45 Only the \fBgdb\fR proxy mode allows some options:
46 .PP
47 .IP \fI--no-start\fR \fBgdb\fR will not be automatically
48 started. Relevant information for starting \fBgdb\fR are printed on
49 screen. This is somehow useful when not directly using \fBgdb\fR but
50 some graphical front-ends, like \fBddd\fR or \fBkgbd\fR. 
51 .IP \fI--with-xterm\fR
52 This will run \fBgdb\fR in its own xterm instead of using the current
53 Unix console for textual display.
54 .PP
55 The rest of the command line, when passed, is used to identify which
56 programs, if any, has to debugged:
57 .IP \fBprogram\ name\fR
58 This is the name of an executable to start for a debugging
59 session.  \fBwinedbg\fR will actually create a process with this
60 executable. If \fBprograms arguments\fR are also given, they will be
61 used as arguments for creating the process to be debugged.
62 .IP \fBpid\fR
63 \fBgdb\fR will attach to the process which pid is \fBpid\fR (pids
64 refer to Win32 pids, not Unix pids). Use the \fIinfo proc\fR
65 \fBwinedbg\fR command to list running processes and their Win32 pids.
66 .IP \fBdefaut\fR
67 If nothing is specified, you will enter the debugger without any run
68 nor attached process. You'll have to do the job yourself.
70 .SH COMMANDS
71 .SS Default mode:
72 .PP
73 Most of commands used in \fBwinedbg\fR are similar to the ones from
74 \fBgdb\fR. Please refer to the \fBgdb\fR documentations for some more
75 details. See the \fIgdb\ differences\fR section later on to get a list
76 of variations from \fBgdb\fR commands.
77 .PP
78 \fIMisc. commands\fR
79 .IP \fBabort\fR
80 Aborts the debugger.
81 .IP \fBquit\fR
82 Exits the debugger.
83 .IP \fBattach\ N\fR
84 Attach to a Wine-process (\fBN\fR is its ID, numeric or hexadecimal).
85 IDs can be obtained using the \fBinfo\ process\fR command.  Note the
86 \fBinfo\ process\fR command returns hexadecimal values
87 .IP 
88 .IP \fBdetach\fR
89 Detach from a Wine-process.
90 .PP
91 \fIHelp commands\fR
92 .IP \fBhelp\fR
93 Prints some help on the commands.
94 .IP \fBhelp\ info\fR
95 Prints some help on info commands
96 .PP
97 \fIFlow control commands\fR
98 .IP \fBcont\fR
99 Continue execution until next breakpoint or exception.
100 .IP \fBpass\fR
101 Pass the exception event up to the filter chain.
102 .IP \fBstep\fR
103 Continue execution until next C line of code (enters function call)
104 .IP \fBnext\fR
105 Continue execution until next C line of code (doesn't enter function
106 call)
107 .IP \fBstepi\fR
108 Execute next assembly instruction (enters function call)
109 .IP \fBnexti\fR
110 Execute next assembly instruction (doesn't enter function call)
111 .IP \fBfinish\fR
112 Excute until return of current function is reached.
114 \fBcont\fR, \fBstep\fR, \fBnext\fR, \fBstepi\fR, \fBnexti\fR can be
115 postfixed by a number (N), meaning that the command must be executed N
116 times before control is returned to the user.
118 \fIBreakpoints, watchpoints
119 .IP \fBenable\ N\fR
120 Enables (break|watch)-point #\fBN\fR
121 .IP \fBdisable\fR
122 Disables (break|watch)-point \fB#N\fR
123 .IP \fBdelete\fR
124 Deletes (break|watch)-point #\fBN\fR
125 .IP \fBcond\ N\fR
126 Removes any existing condition to (break|watch)-point \fBN\fR
127 .IP \fBcond\ N\ <expr>\fR
128 Adds condition \fB<expr>\fR to (break|watch)-point
129 #\fBN\fR. \fB<expr>\fR will be evaluated each time the
130 (break|watch)-point is hit. If the result is a zero value, the
131 breakpoint isn't triggered.
132 .IP \fBbreak\ *\ N\fR
133 Adds a breakpoint at address \fBN\fR
134 .IP \fBbreak\ <id>\fR
135 Adds a breakpoint at the address of symbol \fB<id>\fR
136 .IP \fBbreak <id> N\fR
137 Adds a breakpoint at the line \fBN\fR inside symbol \fB<id>\fR.
138 .IP \fBbreak\ N\fR
139 Adds a breakpoint at line \fBN\fR of current source file.
140 .IP \fBbreak\fR
141 Adds a breakpoint at current \f$PC\fR address.
142 .IP \fBwatch\ *\ N\fR
143 Adds a watch command (on write) at address \fBN\fR (on 4 bytes).
144 .IP \fBwatch\ <id>\fR
145 Adds a watch command (on write) at the address of symbol
146 \fB<id>\fR. Size depends on size of \fB<id>\fR.
147 .IP \fBinfo\ break\fR
148 Lists all (break|watch)-points (with their state).
150 You can use the symbol \fBEntryPoint\fR to stand for the entry point of the Dll.
152 When setting a (break|watch)-point by \fB<id>\fR, if the symbol cannot
153 be found (for example, the symbol is contained in a not yet loaded
154 module), \fBwinedbg\fR will recall the name of the symbol and will try
155 to set the breakpoint each time a new module is loaded (until it succeeds). 
157 \fIStack manipulation\fR
158 .IP \fBbt\fR
159 Print calling stack of current thread.
160 .IP \fBbt\ N\fR
161 Print calling stack of thread of ID \fBN\fR. Note: this doesn't change
162 the position of the current frame as manipulated by the \fBup\fR &
163 \fBdn\fR commands).
164 .IP \fBup\fR
165 Goes up one frame in current thread's stack
166 .IP \fBup\ N\fR
167 Goes up \fBN\fR frames in current thread's stack
168 .IP \fBdn\fR
169 Goes down one frame in current thread's stack
170 .IP \fBdn\ N\fR
171 Goes down \fBN\fR frames in current thread's stack
172 .IP \fBframe N\fR
173 Sets \fBN\fR as the current frame for current thread's stack.
174 .IP \fBinfo\ locals\fR
175 Prints information on local variables for current function frame.
177 \fIDirectory & source file manipulation\fR
178 .IP \fBshow\ dir\fR
179 Prints the list of dir:s where source files are looked for.
180 .IP \fBdir\ <pathname>\fR
181 Adds \fB<pathname>\fR to the list of dir:s where to look for source
182 files
183 .IP \fBdir\fR
184 Deletes the list of dir:s where to look for source files
185 .IP \fBsymbolfile\ <pathname>\fR
186 Loads external symbol definition symbolfile \fB<pathname>\fR
187 .IP \fBsymbolfile\ <pathname>\ N\fR
188 Loads external symbol definition symbolfile \fB<pathname>\fR (applying
189 an offset of \fBN\fR to addresses)
190 .IP \fBlist\fR
191 Lists 10 source lines forwards from current position.
192 .IP \fBlist\ -\fR
193 Lists 10 source lines backwards from current position
194 .IP \fBlist\ N\fR
195 Lists 10 source lines from line #\fBN\fR in current file
196 .IP \fBlist\ <pathname>:N\fR
197 Lists 10 source lines from line #\fBN\fR in file \fB<pathname>\fR
198 .IP \fBlist\ <id>\fR
199 Lists 10 source lines of function \fB<id>\fR
200 .IP \fBlist\ *\ N\fR
201 Lists 10 source lines from address \fBN\fR
203 You can specify the end target (to change the 10 lines value) using
204 the ',' separator. For example:
206 .IP \fBlist\ 123,\ 234\fR
207 lists source lines from line 123 up to line 234 in current file
209 .IP \fBlist\ foo.c:1,56\fR
210 lists source lines from line 1 up to 56 in file foo.c 
212 \fIDisplaying\fR
214 A display is an expression that's evaluated and printed after the
215 execution of any \fBwinedbg\fR's command.
216 .IP \fBdisplay\fR
217 .IP \fBinfo\ display\fR
218 Lists the active displays
219 .IP \fBdisplay\ <expr>\fR
220 Adds a display for expression \f<expr>\fR
221 .IP \fBdisplay\ /fmt\ <expr>\fR
222 Adds a display for expression \fB<expr>\fR. Printing evaluated
223 \fB<expr>\fR is done using the given format (see \fBprint\ command\fR
224 for more on formats)
225 .IP \fBdel\ display\ N\fR
226 .IP \fBundisplay\ N\fR
227 Deletes display #\fBN\fR
229 \fIDisassembly\fR
230 .IP \fBdisas\fR
231 Disassemble from current position
232 .IP \fBdisas\ <expr>\fR
233 Disassemble from address \fB<expr>\fR
234 .IP \fBdisas\ <expr>,<expr>\fR
235 Disassembles code between addresses specified by the two \fB<expr>\fR:s
237 \fIMemory\ (reading,\ writing,\ typing)\fR
238 .IP \fBx\ <expr>\fR
239 Examines memory at \fB<expr>\fR address
240 .IP \fBx\ /fmt\ <expr>\fR
241 Examines memory at \fB<expr>\fR address using format \fI/fmt\fR
242 .IP \fBprint\ <expr>\fR
243 Prints the value of \fB<expr>\fR (possibly using its type)
244 .IP \fBprint\ /fmt\ <expr>\fR
245 Prints the value of \fB<expr>\fR (possibly using its type)
246 .IP \fBset\ <var>\ =\ <expr>\fR
247 Writes the value of \fB<expr>\fR in \fB<var>\fR variable.
248 .IP \fBwhatis\ <expr>\fR
249 Prints the C type of expression \fB<expr>\fR
251 .IP \fI/fmt\fR
252 is either \fI/<letter>\fR or \fI/<count><letter>\fR. \fI<letter>\fR
253 can be:
254 .RS 4
255 .IP s
256 an ASCII string
257 .IP u
258 an Unicode UTF16 string
259 .IP i
260 instructions (disassemble)
261 .IP x
262 32 bit unsigned hexadecimal integer
263 .IP d
264 32 bit signed decimal integer
265 .IP w
266 16 bit unsigned hexadecimal integer
267 .IP c
268 character (only printable 0x20-0x7f are actually printed)
269 .IP b
270 8 bit unsigned hexadecimal integer
271 .IP g
272 Win32 GUID
275 \fIExpressions\fR
277 Expressions in Wine Debugger are mostly written in a C form. However,
278 there are a few discrepancies:
280 .RS 4
281 Identifiers can take a '!' in their names. This allows mainly to
282 specify a module where to look the module from: \fIUSER32!CreateWindowExA\fR.
284 In cast operation, when specifying a structure or an union, you must
285 use the struct or union key word (even if your program uses a typedef). 
288 When specifying an identifier \fB<id>\fR, if several symbols with
289 this name exist, the debugger will prompt for the symbol you want to
290 use. Pick up the one you want from its number.
292 \fIInformation on Wine's internals\fR
293 .IP \fBinfo\ class\fR
294 Lists all Windows' class registered in Wine
295 .IP \fBinfo\ class\ <id>\fR
296 Prints information on Windows's class \fB<id>\fR
297 .IP \fBinfo\ share\fR
298 Lists all the dynamic libraries loaded in the debugged program
299 (including .so files, NE and PE DLLs)
300 .IP \fBinfo\ share\ N\fR
301 Prints information on module at address \fBN\fR
302 .IP \fBinfo\ regs\fR
303 Prints the value of the CPU registers
304 .IP \fBinfo\ segment\fR
305 Lists all allocated segments (i386 only)
306 .IP \fBinfo\ segment N\fR
307 Prints information on segment \fBN\fR (i386 only)
308 .IP \fBinfo\ stack\fR
309 Prints the values on top of the stack
310 .IP \fBinfo\ map\fR
311 Lists all virtual mappings used by the debugged program
312 .IP \fBinfo\ map\ N\fR
313 Lists all virtual mappings used by the program of pid \fBN\fR
314 .IP \fBinfo\ wnd\fR
315 Displays the window hierarchy starting from the desktop window
316 .IP \fBinfo\ wnd\ N\fR
317 Prints information of Window of handle \fBN\fR
318 .IP \fBinfo\ process\fR
319 Lists all w-processes in Wine session
320 .IP \fBinfo\ thread\fR
321 Lists all w-threads in Wine session
322 .IP \fBinfo\ exception\fR
323 Lists the exception frames (starting from current stack frame)
325 It is possible to turn on and off Wine's debug messages as you are
326 debugging using the \fBset\fR command. 
327 .IP \fBset\ +\ warn\ win\fR
328 Turns on warn on \fB'win'\fR channel
329 .IP \fBset\ +\ win\fR
330 Turns on warn/fixme/err/trace on \fB'win'\fR channel
331 .IP \fBset\ -\ win\fR
332 Turns off warn/fixme/err/trace on \fB'win'\fR channel
333 .IP \fBset\ -\ fixme\fR
334 Turns off the 'fixme' class on all channels
336 .SS Gdb mode:
338 See the \fBgdb\fR documentation for all the \fBgdb\fR commands.
340 However, a few Wine's extension are available, through the
341 \fBmonitor\fR command:
342 .IP \fBmonitor\ wnd\fR
343 Lists all window in the Wine session
344 .IP \fBmonitor proc\fR
345 Lists all processes in the Wine session
346 .IP \fBmonitor mem \fR
347 Displays memory mapping of debugged process
349 .SS Auto mode:
351 Since no user input is possible, no commands are available.
353 .SH ENVIRONMENT
354 .IP \fBWINE_GDB\fR
355 When used in \fBgdb\fR proxy mode, \fBWINE_GDB\fR specifies the name
356 (and the path) of the executable to be used for \fBgdb\fR. \fB"gdb"\fR
357 is used by default.
358 .SH FILES
359 No specific files are used (yet).
360 .SH BUGS
361 A lot.
362 .SH AUTHORS
363 The first version was written by Eric Youngdale.
365 See Wine developer's list for the rest of contributors.
366 .SH "SEE ALSO"
367 .BR winedbg "'s README file"
369 The Winelib User Guide
371 The Wine Developers Guide