1WINEDBG(1) Wine Developers Manual WINEDBG(1)
2
3
4
6 winedbg - Wine debugger
7
9 winedbg [ options ] [ program_name [ program_arguments ] | wpid ]
10
11 winedbg --gdb [ options ] [ program_name [ program_arguments ] | wpid ]
12
13 winedbg --auto wpid
14
15 winedbg --minidump [ file.mdmp ] wpid
16
17 winedbg file.mdmp
18
20 winedbg is a debugger for Wine. It allows:
21 + debugging native Win32 applications
22 + debugging Winelib applications
23 + being a drop-in replacement for Dr Watson
24
26 winedbg can be used in five modes. The first argument to the program
27 determines the mode winedbg will run in.
28
29 default
30 Without any explicit mode, this is standard winedbg operating
31 mode. winedbg will act as the front end for the user.
32
33 --gdb winedbg will be used as a proxy for gdb. gdb will be the front
34 end for command handling, and winedbg will proxy all debugging
35 requests from gdb to the Win32 APIs.
36
37 --auto This mode is used when winedbg is set up in AeDebug registry
38 entry as the default debugger. winedbg will then display basic
39 information about a crash. This is useful for users who don't
40 want to debug a crash, but rather gather relevant information
41 about the crash to be sent to developers.
42
43 --minidump
44 This mode is similar to the --auto one, except that instead of
45 printing the information on the screen (as --auto does), it's
46 saved into a minidump file. The name of the file is either
47 passed on the command line, or generated by WineDbg when none is
48 given. This file could later on be reloaded into winedbg for
49 further examination.
50
51 file.mdmp
52 In this mode winedbg reloads the state of a debuggee which has
53 been saved into a minidump file. See either the minidump command
54 below, or the --minidump mode.
55
56
58 When in default mode, the following options are available:
59
60 --command string
61 winedbg will execute the command string 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
64 proc").
65
66 --file filename
67 winedbg will execute the list of commands contained in file
68 filename as if they were keyed on winedbg command line, and then
69 will exit.
70
71 When in gdb proxy mode, the following options are available:
72
73 --no-start
74 gdb will not be automatically started. Relevant information for
75 starting gdb is printed on screen. This is somehow useful when
76 not directly using gdb but some graphical front-ends, like ddd
77 or kgbd.
78
79 --port port
80 Start the gdb server on the given port. If this option is not
81 specified, a randomly chosen port will be used. If --no-start is
82 specified, the port used will be printed on startup.
83
84 --with-xterm
85 This will run gdb in its own xterm instead of using the current
86 Unix console for textual display.
87
88 In all modes, the rest of the command line, when passed, is used to
89 identify which programs, if any, has to debugged:
90
91 program_name
92 This is the name of an executable to start for a debugging ses‐
93 sion. winedbg will actually create a process with this exe‐
94 cutable. If programs_arguments are also given, they will be used
95 as arguments for creating the process to be debugged.
96
97 wpid winedbg will attach to the process which Windows pid is wpid.
98 Use the info proc command within winedbg to list running pro‐
99 cesses and their Windows pids.
100
101 default
102 If nothing is specified, you will enter the debugger without any
103 run nor attached process. You'll have to do the job yourself.
104
105
107 Default mode, and while reloading a minidump file:
108 Most of commands used in winedbg are similar to the ones from gdb.
109 Please refer to the gdb documentations for some more details. See the
110 gdb differences section later on to get a list of variations from gdb
111 commands.
112
113 Misc. commands
114
115 abort Aborts the debugger.
116
117 quit Exits the debugger.
118
119 attach N
120 Attach to a Wine process (N is its Windows ID, numeric or hexa‐
121 decimal). IDs can be obtained using the info process command.
122 Note the info process command returns hexadecimal values
123
124 detach Detach from a Wine-process.
125
126 Help commands
127
128 help Prints some help on the commands.
129
130 help info
131 Prints some help on info commands
132
133 Flow control commands
134
135 cont Continue execution until next breakpoint or exception.
136
137 pass Pass the exception event up to the filter chain.
138
139 step Continue execution until next C line of code (enters function
140 call)
141
142 next Continue execution until next C line of code (doesn't enter
143 function call)
144
145 stepi Execute next assembly instruction (enters function call)
146
147 nexti Execute next assembly instruction (doesn't enter function call)
148
149 finish Execute until return of current function is reached.
150
151 cont, step, next, stepi, nexti can be postfixed by a number (N), mean‐
152 ing that the command must be executed N times before control is
153 returned to the user.
154
155 Breakpoints, watchpoints
156
157 enable N
158 Enables (break|watch)-point N
159
160 disable N
161 Disables (break|watch)-point N
162
163 delete N
164 Deletes (break|watch)-point N
165
166 cond N Removes any existing condition to (break|watch)-point N
167
168 cond N expr
169 Adds condition expr to (break|watch)-point N. expr will be eval‐
170 uated each time the (break|watch)-point is hit. If the result is
171 a zero value, the breakpoint isn't triggered.
172
173 break * N
174 Adds a breakpoint at address N
175
176 break id
177 Adds a breakpoint at the address of symbol id
178
179 break id N
180 Adds a breakpoint at the line N inside symbol id.
181
182 break N
183 Adds a breakpoint at line N of current source file.
184
185 break Adds a breakpoint at current $PC address.
186
187 watch * N
188 Adds a watch command (on write) at address N (on 4 bytes).
189
190 watch id
191 Adds a watch command (on write) at the address of symbol id.
192 Size depends on size of id.
193
194 rwatch * N
195 Adds a watch command (on read) at address N (on 4 bytes).
196
197 rwatch id
198 Adds a watch command (on read) at the address of symbol id. Size
199 depends on size of id.
200
201 info break
202 Lists all (break|watch)-points (with their state).
203
204 You can use the symbol EntryPoint to stand for the entry point of the
205 Dll.
206
207 When setting a (break|watch)-point by id, if the symbol cannot be found
208 (for example, the symbol is contained in a not yet loaded module),
209 winedbg will recall the name of the symbol and will try to set the
210 breakpoint each time a new module is loaded (until it succeeds).
211
212 Stack manipulation
213
214 bt Print calling stack of current thread.
215
216 bt N Print calling stack of thread of ID N. Note: this doesn't change
217 the position of the current frame as manipulated by the up & dn
218 commands).
219
220 up Goes up one frame in current thread's stack
221
222 up N Goes up N frames in current thread's stack
223
224 dn Goes down one frame in current thread's stack
225
226 dn N Goes down N frames in current thread's stack
227
228 frame N
229 Sets N as the current frame for current thread's stack.
230
231 info locals
232 Prints information on local variables for current function
233 frame.
234
235 Directory & source file manipulation
236
237 show dir
238 Prints the list of dirs where source files are looked for.
239
240 dir pathname
241 Adds pathname to the list of dirs where to look for source files
242
243 dir Deletes the list of dirs where to look for source files
244
245 symbolfile pathname
246 Loads external symbol definition file pathname
247
248 symbolfile pathname N
249 Loads external symbol definition file pathname (applying an off‐
250 set of N to addresses)
251
252 list Lists 10 source lines forwards from current position.
253
254 list - Lists 10 source lines backwards from current position
255
256 list N Lists 10 source lines from line N in current file
257
258 list pathname:N
259 Lists 10 source lines from line N in file pathname
260
261 list id
262 Lists 10 source lines of function id
263
264 list * N
265 Lists 10 source lines from address N
266
267 You can specify the end target (to change the 10 lines value) using the
268 ',' separator. For example:
269
270 list 123, 234
271 lists source lines from line 123 up to line 234 in current file
272
273 list foo.c:1,56
274 lists source lines from line 1 up to 56 in file foo.c
275
276 Displaying
277
278 A display is an expression that's evaluated and printed after the exe‐
279 cution of any winedbg command.
280
281 display
282
283 info display
284 Lists the active displays
285
286 display expr
287 Adds a display for expression expr
288
289 display /fmt expr
290 Adds a display for expression expr. Printing evaluated expr is
291 done using the given format (see print command for more on for‐
292 mats)
293
294 del display N
295
296 undisplay N
297 Deletes display N
298
299 Disassembly
300
301 disas Disassemble from current position
302
303 disas expr
304 Disassemble from address expr
305
306 disas expr,expr
307 Disassembles code between addresses specified by the two expres‐
308 sions
309
310 Memory (reading, writing, typing)
311
312 x expr Examines memory at address expr
313
314 x /fmt expr
315 Examines memory at address expr using format fmt
316
317 print expr
318 Prints the value of expr (possibly using its type)
319
320 print /fmt expr
321 Prints the value of expr (possibly using its type)
322
323 set var = expr
324 Writes the value of expr in var variable
325
326 whatis expr
327 Prints the C type of expression expr
328
329 fmt is either letter or count letter, where letter can be:
330
331 s an ASCII string
332
333 u a UTF16 Unicode string
334
335 i instructions (disassemble)
336
337 x 32-bit unsigned hexadecimal integer
338
339 d 32-bit signed decimal integer
340
341 w 16-bit unsigned hexadecimal integer
342
343 c character (only printable 0x20-0x7f are actually printed)
344
345 b 8-bit unsigned hexadecimal integer
346
347 g Win32 GUID
348
349 Expressions
350
351 Expressions in Wine Debugger are mostly written in a C form. However,
352 there are a few discrepancies:
353
354 Identifiers can take a '!' in their names. This allows mainly to
355 specify a module where to look the ID from, e.g. USER32!CreateWin‐
356 dowExA.
357
358 In a cast operation, when specifying a structure or a union, you
359 must use the struct or union keyword (even if your program uses a
360 typedef).
361
362 When specifying an identifier, if several symbols with this name exist,
363 the debugger will prompt for the symbol you want to use. Pick up the
364 one you want from its number.
365
366 Misc.
367
368 minidump file.mdmp saves the debugging context of the debuggee into a
369 minidump file called file.mdmp.
370
371 Information on Wine internals
372
373 info class
374 Lists all Windows classes registered in Wine
375
376 info class id
377 Prints information on Windows class id
378
379 info share
380 Lists all the dynamic libraries loaded in the debugged program
381 (including .so files, NE and PE DLLs)
382
383 info share N
384 Prints information on module at address N
385
386 info regs
387 Prints the value of the CPU registers
388
389 info all-regs
390 Prints the value of the CPU and Floating Point registers
391
392 info segment
393 Lists all allocated segments (i386 only)
394
395 info segment N
396 Prints information on segment N (i386 only)
397
398 info stack
399 Prints the values on top of the stack
400
401 info map
402 Lists all virtual mappings used by the debugged program
403
404 info map N
405 Lists all virtual mappings used by the program of Windows pid N
406
407 info wnd
408 Displays the window hierarchy starting from the desktop window
409
410 info wnd N
411 Prints information of Window of handle N
412
413 info process
414 Lists all w-processes in Wine session
415
416 info thread
417 Lists all w-threads in Wine session
418
419 info frame
420 Lists the exception frames (starting from current stack frame).
421 You can also pass, as optional argument, a thread id (instead of
422 current thread) to examine its exception frames.
423
424 Debug messages can be turned on and off as you are debugging using the
425 set command, but only for channels initialized with the WINEDEBUG envi‐
426 ronment variable.
427
428 set warn + win
429 Turns on warn on win channel
430
431 set + win
432 Turns on warn/fixme/err/trace on win channel
433
434 set - win
435 Turns off warn/fixme/err/trace on win channel
436
437 set fixme - all
438 Turns off fixme class on all channels
439
440 Gdb mode:
441 See the gdb documentation for all the gdb commands.
442
443 However, a few Wine extensions are available, through the monitor com‐
444 mand:
445
446 monitor wnd
447 Lists all windows in the Wine session
448
449 monitor proc
450 Lists all processes in the Wine session
451
452 monitor mem
453 Displays memory mapping of debugged process
454
455 Auto and minidump modes:
456 Since no user input is possible, no commands are available.
457
458
460 WINE_GDB
461 When used in gdb proxy mode, WINE_GDB specifies the name (and
462 the path) of the executable to be used for gdb. "gdb" is used by
463 default.
464
466 The first version was written by Eric Youngdale.
467
468 See Wine developers list for the rest of contributors.
469
471 Bugs can be reported on the Wine bug tracker ⟨https://bugs.winehq.org⟩.
472
474 winedbg is part of the Wine distribution, which is available through
475 WineHQ, the Wine development headquarters ⟨https://www.winehq.org/⟩.
476
478 wine(1),
479 Wine documentation and support ⟨https://www.winehq.org/help⟩.
480
481
482
483Wine 4.9 October 2005 WINEDBG(1)