WINEDBG(1)
WINEDBG(1) π Wine Developers Manual
okay bestie, buckle UP because this is the page for winedbg, and she's kind of a big deal π
β¨ NAME β¨
winedbg β the Wine debugger, no cap ππ
πΈ SYNOPSIS πΈ
winedbg [ options ] [ program_name [ program_arguments ] | wpid ]
winedbg --gdb [ options ] [ program_name [ program_arguments ] | wpid ]
winedbg --auto wpid
winedbg --minidump [ file.mdmp ] wpid
winedbg file.mdmp
π¦ DESCRIPTION π¦
so winedbg is literally the debugger for Wine. she's here to help you with:
- debugging native Win32 applications π₯οΈ
- debugging Winelib applications π·
- being a drop-in replacement for Dr Watson π
π MODES π
winedbg can run in five modes, and the way she picks is: the first argument to the program decides which mode she's in. periodt.
- default β with no explicit mode at all, this is just standard
winedbgoperating mode.winedbgacts as the front end for you, the user. main character energy tbh. --gdbβ herewinedbgbecomes a proxy forgdb.gdbis the front end handling commands, andwinedbgproxies all the debugging requests fromgdbover to the Win32 APIs. it's giving middle management πΌ--autoβ this mode kicks in whenwinedbgis set up in theAeDebugregistry entry as the default debugger.winedbgwill then show basic info about a crash. super useful for users who don't actually want to debug a crash, they just want to gather the relevant deets about it to send off to developers π¨--minidumpβ basically the--automode's sibling, except instead of printing the info on screen (like--autodoes), it saves it into a minidump file. the filename is either passed on the command line, or generated byWineDbgwhen you don't give one. later on you can reload that file back intowinedbgfor further examination πfile.mdmpβ in this modewinedbgreloads the state of a debuggee that got saved into a minidump file. see either theminidumpcommand below, or the--minidumpmode above πΎ
π OPTIONS π
π when you're in default mode π
these are your options:
--command stringβwinedbgruns thestringexactly like you'd typed it on thewinedbgcommand line, then exits. handy for grabbing the pid of running processes, likewinedbg --command "info proc"π΅οΈ--exec filenameβ sets the executable name, without starting the executable. so it's just vibes and a name, no launch π«π--file filenameβwinedbgruns the list of commands contained in filefilenameexactly like you'd typed them on thewinedbgcommand line, then exits π
π when you're in gdb proxy mode π
these are your options:
--no-startβ don't launchgdbdirectly. instead, print thetarget remoteGDB command to execute and listen for a connection from any GDB-compatible debugger. normally--gdbstarts both the proxy debugging server and an instance ofgdbfor the front end. this option tellswinedbgto skip launchinggdb, and instead prints the GDB command you can use to manually connect to the server. that command looks like:
target remote localhost:<port>
where <port> is the TCP port winedbg's proxy debugging server is bound to.
this lets you swap gdb out for some other debugger front end β like ddd, kgdb, gdbgui, or Qt Creator. and heads up: whether or not you pass --no-start, winedbg will quit after the first connection hangs up (e.g. when gdb detaches from the debuggee) π
--port portβ start the GDB proxy debugging server on the givenport. if you don't specify this option,winedbglets the operating system choose any available port. you can pair this with--no-startto say exactly which port the server shall be bound to π--with-xtermβ this runs thegdbfront end in a newxterm(1)window instead of using the current Unix terminal for its interface πͺβ¨. this option is ignored if--no-startis specified π
π in all modes π
the rest of the command line, when it's passed, is used to figure out which program (if any) is gonna be debugged:
program_nameβ the name of an executable to start for a debugging session.winedbgwill actually create a process with this executable. ifprogram_argumentsare also given, they get used as arguments for creating the process to be debugged πβοΈwpidβwinedbgattaches to the process whose Windows pid iswpid. use theinfo proccommand insidewinedbgto list running processes and their Windows pids π- default β if you specify nothing at all, you enter the debugger with no run and no attached process. you'll have to do the job yourself, bestie π«‘
lowkey important: that's just part 1 of 3! more incoming, don't go anywhere π
π COMMANDS π
πΈ Default mode, and while reloading a minidump file:
okay bestie, so most of the commands in winedbg are literally the same vibe as gdb's. if you want the deep lore, go read the gdb docs. but check the gdb differences section further down so you know where this debugger does its own little thing π
β¨ Misc. commands
abortβ aborts the debugger. just. yeets it. πquitβ exits the debugger.
β¨ Process handling
attach Nβ attach to a Wine process, whereNis its Windows ID, numeric or hexadecimal. you can get these IDs with theinfo processcommand. heads up though:info processhands back hexadecimal values πattach file.mdmpβ reload the state of a debuggee from the minidumpfile.mdmp. (peep theminidumpcommand if you wanna save one of these bad boys.)detachβ detach the current Wine process. it's no longer being debugged by WineDbg, but it's still running (for a live target).killβ kills the current Wine process. it's no longer debugged by WineDbg and it's terminated (for a live target).minidump file.mdmpβ saves the debugging context of the debuggee into a minidump file calledfile.mdmp.runβ re-run the same process with the same arguments. note: all breakpoints of precedent process are no longer available. rip πrun arg1 arg2...β re-run the same process with argumentsarg1 arg2.... note: all breakpoints of precedent process are no longer available.thread Nβ change the current thread toN(its Windows TID, numeric or hexadecimal).
β¨ Help commands
helpβ prints some help on the commands.help infoβ prints some help oninfocommands.
β¨ Flow control commands
contβ continue execution until next breakpoint or exception.passβ pass the exception event up to the filter chain.stepβ continue execution until next C line of code (enters function call).nextβ continue execution until next C line of code (doesn't enter function call).stepiβ execute next assembly instruction (enters function call).nextiβ execute next assembly instruction (doesn't enter function call).finishβ execute until return of current function is reached.
cont, step, next, stepi, nexti can be postfixed by a number (N), meaning that the command must be executed N times before control is returned to the user. so like, step 5 = five steps, bestie, no taps needed π«Ά
β¨ Breakpoints, watchpoints
enable Nβ enables (break|watch)-pointN.disable Nβ disables (break|watch)-pointN.delete Nβ deletes (break|watch)-pointN.cond Nβ removes any existing condition to (break|watch)-pointN.cond N exprβ adds conditionexprto (break|watch)-pointN.exprwill be evaluated each time the (break|watch)-point is hit. if the result is a zero value, the breakpoint isn't triggered.break * Nβ adds a breakpoint at addressN.break idβ adds a breakpoint at the address of symbolid.break id Nβ adds a breakpoint at the lineNinside symbolid.break Nβ adds a breakpoint at lineNof current source file.breakβ adds a breakpoint at current$PCaddress.watch * Nβ adds a watch command (on write) at addressN(on 4 bytes).watch idβ adds a watch command (on write) at the address of symbolid. size depends on size ofid.rwatch * Nβ adds a watch command (on read) at addressN(on 4 bytes).rwatch idβ adds a watch command (on read) at the address of symbolid. size depends on size ofid.info breakβ lists all (break|watch)-points (with their state).
you can use the symbol EntryPoint to stand for the entry point of the Dll. iconique.
when setting a (break|watch)-point by id, if the symbol can't be found (for example, the symbol is contained in a not yet loaded module), winedbg will recall the name of the symbol and will try to set the breakpoint each time a new module is loaded β until it succeeds. it's giving main character energy, honestly, it does NOT give up π
β¨ Stack manipulation
btβ print calling stack of current thread.bt Nβ print calling stack of thread of IDN. note: this doesn't change the position of the current frame as manipulated by theup&dncommands.upβ goes up one frame in current thread's stack.up Nβ goes upNframes in current thread's stack.dnβ goes down one frame in current thread's stack.dn Nβ goes downNframes in current thread's stack.frame Nβ setsNas the current frame for current thread's stack.info localsβ prints information on local variables for current function frame.
β¨ Directory & source file manipulation
show dirβ prints the list of dirs where source files are looked for.dir pathnameβ addspathnameto the list of dirs where to look for source files.dirβ deletes the list of dirs where to look for source files.symbolfile pathnameβ loads external symbol definition filepathname.symbolfile pathname Nβ loads external symbol definition filepathname(applying an offset ofNto addresses).listβ lists 10 source lines forwards from current position.list -β lists 10 source lines backwards from current position.list Nβ lists 10 source lines from lineNin current file.list pathname:Nβ lists 10 source lines from lineNin filepathname.list idβ lists 10 source lines of functionid.list * Nβ lists 10 source lines from addressN.
you can specify the end target (to change that 10 lines value) using the , separator. for example:
list 123, 234
lists source lines from line 123 up to line 234 in current file.
list foo.c:1,56
lists source lines from line 1 up to 56 in file foo.c. ate. π₯
β¨ Displaying
a display is an expression that's evaluated and printed after the execution of any winedbg command. it's like a little post-command gossip update, she keeps you posted π
displayinfo displayβ lists the active displays.display exprβ adds a display for expressionexpr.display /fmt exprβ adds a display for expressionexpr. printing evaluatedexpris done using the given format (see theprintcommand for more on formats).del display Nundisplay Nβ deletes displayN.
β¨ Disassembly
disasβ disassemble from current position.disas exprβ disassemble from addressexpr.disas expr,exprβ disassembles code between addresses specified by the two expressions.
β¨ Memory (reading, writing, typing)
x exprβ examines memory at addressexpr.x /fmt exprβ examines memory at addressexprusing formatfmt.print exprβ prints the value ofexpr(possibly using its type).print /fmt exprβ prints the value ofexpr(possibly using its type).set var = exprβ writes the value ofexprinvarvariable.whatis exprβ prints the C type of expressionexpr.
fmt is either letter or count letter, where letter can be:
sβ an ASCII string.uβ a UTF16 Unicode string.iβ instructions (disassemble).xβ 32-bit unsigned hexadecimal integer.dβ 32-bit signed decimal integer.wβ 16-bit unsigned hexadecimal integer.cβ character (only printable0x20-0x7fare actually printed).bβ 8-bit unsigned hexadecimal integer.gβ Win32 GUID.
β¨ Expressions
expressions in Wine Debugger are mostly written in a C form. however, there are a few discrepancies:
- identifiers can take a
!in their names. this mainly allows you to specify a module where to look the ID from, e.g.USER32!CreateWindowExA. - in a cast operation, when specifying a structure or a union, you must use the
structorunionkeyword (even if your program uses a typedef).
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. choose your fighter bestie π
β¨ Information on Wine internals
info classβ lists all Windows classes registered in Wine.info class idβ prints information on Windows classid.info shareβ lists all the dynamic libraries loaded in the debugged program (including.sofiles, NE and PE DLLs).info share Nβ prints information on module at addressN.info regsβ prints the value of the CPU registers.info all-regsβ prints the value of the CPU and Floating Point registers.info segmentβ lists all allocated segments (i386 only).info segment Nβ prints information on segmentN(i386 only).info stackβ prints the values on top of the stack.info mapβ lists all virtual mappings used by the debugged program.info map Nβ lists all virtual mappings used by the program of Windows pidN.info wndβ displays the window hierarchy starting from the desktop window.info wnd Nβ prints information of Window of handleN.info processβ lists all w-processes in Wine session.info threadβ lists all w-threads in Wine session.info frameβ lists the exception frames (starting from current stack frame). you can also pass, as optional argument, a thread id (instead of current thread) to examine its exception frames.
debug messages can be turned on and off as you are debugging using the set command β but only for channels initialized with the WINEDEBUG environment variable. iykyk.
set warn + winβ turns onwarnonwinchannel.set + winβ turns onwarn/fixme/err/traceonwinchannel.set - winβ turns offwarn/fixme/err/traceonwinchannel.set fixme - allβ turns offfixmeclass on all channels.
π Gdb mode:
for all the gdb commands, go see the gdb documentation. periodt.
however, a few Wine extensions are available, through the monitor command:
monitor wndβ lists all windows in the Wine session.monitor procβ lists all processes in the Wine session.monitor memβ displays memory mapping of debugged process.
πΈ Auto and minidump modes:
since no user input is possible, no commands are available. yeah. that's it. no notes. π
π¦ ENVIRONMENT π¦
WINE_GDBβ when used in gdb proxy mode,WINE_GDBspecifies the name (and the path) of the executable to be used for gdb."gdb"is used by default.
π AUTHORS π
the first version was written by Eric Youngdale.
see Wine developers list for the rest of contributors. love that for them π
π BUGS π
bugs can be reported on the Wine bug tracker.
β AVAILABILITY β
winedbg is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters.
π SEE ALSO π
okay bestie, you're at the end and that's lowkey iconic of you π but before you go, here's where to wander next:
wine(1)β the whole main character. run your Windows apps with it, it's giving core functionality π·- Wine documentation and support β the docs and the support vibes, for when you need more than a manpage can give you π«Ά
and that's a wrap fr fr β¨ you made it all the way through a whole WINEDBG(1) page, which is honestly main character energy π
this lil' page came from Wine 10.0, dated October 2005 πΈ so yeah, it's been around a minute, but it still ate. now go forth and debug responsibly, bestie ππ¦π
π¦ where this page comes from
- debian trixie: wine 10.0~repack-6 Β· LGPL-2.1-or-later
- ubuntu questing: wine 10.0~repack-6ubuntu1
- ubuntu resolute: wine 10.0~repack-12ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: wine 10.0~repack-12ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms