WINEDBG(1)
π WINEDBG(1) β Wine Developers Manual π
okay bestie, it's giving "let's debug Wine together" and honestly? iconic. π«Ά
β¨ NAME β¨
winedbg β the Wine debugger π
π 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 π¦
winedbg is a debugger for Wine. It allows:
- debugging native Win32 applications
- debugging Winelib applications
- being a drop-in replacement for Dr Watson
Like, yes, all of that. No cap.
π MODES π
winedbg can be used in five modes. The first argument to the program determines the mode winedbg will run in. Periodt.
defaultβ no explicit mode? boom, this is standardwinedbgoperating mode.winedbgwill act as the front end for the user.--gdbβwinedbgwill be used as a proxy forgdb.gdbwill be the front end for command handling, andwinedbgwill proxy all debugging requests fromgdbto the Win32 APIs.--autoβ this mode is used whenwinedbgis set up inAeDebugregistry entry as the default debugger.winedbgwill 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.--minidumpβ this mode is similar to the--autoone, except that instead of printing the information on the screen (as--autodoes), it's saved into a minidump file. The name of the file is either passed on the command line, or generated byWineDbgwhen none is given. This file could later on be reloaded intowinedbgfor further examination.file.mdmpβ in this modewinedbgreloads the state of a debuggee which has been saved into a minidump file. See either theminidumpcommand below, or the--minidumpmode.
π OPTIONS π
When in default mode, the following options are available:
--command stringβwinedbgwill execute the command string as if it was keyed onwinedbgcommand line, and then will exit. This can be handy for getting the pid of running processes (winedbg --command "info proc").--file filenameβwinedbgwill execute the list of commands contained in file filename as if they were keyed onwinedbgcommand line, and then will exit.
When in gdb proxy mode, the following options are available:
--no-startβgdbwill not be automatically started. Relevant information for startinggdbis printed on screen. This is somehow useful when not directly usinggdbbut some graphical front-ends, likedddorkgbd.--port portβ start thegdbserver on the given port. If this option is not specified, a randomly chosen port will be used. If--no-startis specified, the port used will be printed on startup.--with-xtermβ this will rungdbin its own xterm instead of using the current Unix console for textual display.
In all modes, the rest of the command line, when passed, is used to identify which programs, if any, has to debugged:
program_nameβ this is the name of an executable to start for a debugging session.winedbgwill actually create a process with this executable. Ifprograms_argumentsare also given, they will be used as arguments for creating the process to be debugged.wpidβwinedbgwill attach to the process which Windows pid iswpid. Use theinfo proccommand withinwinedbgto list running processes and their Windows pids.defaultβ if nothing is specified, you will enter the debugger without any run nor attached process. You'll have to do the job yourself.
π₯οΈ COMMANDS π₯οΈ
Default mode, and while reloading a minidump file β¨
Okay bestie, when you're in the default mode or reloading a minidump file, most of these commands are giving gdb energy. Please refer to the gdb documentations for some more details. And check the gdb differences section later on for the list of variations from gdb commands. π
Misc. commands
abortβ Aborts the debugger. Just ends it, no cap.quitβ Exits the debugger. Bye bestie πattach Nβ Attach to a Wine process.Nis its Windows ID, numeric or hexadecimal. You can get IDs using theinfo processcommand. Note: theinfo processcommand returns hexadecimal values. πdetachβ Detach from a Wine-process. Peace out βοΈthread Nβ Change the current thread toN(its Windows TID, numeric or hexadecimal). Thread switch, slay.
Help commands
helpβ Prints some help on the commands. We love a helpful icon.help infoβ Prints some help oninfocommands. The info-ception.
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.
Also: 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 and you're zooming. πββοΈ
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. Conditional queen π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. π‘
When setting a (break|watch)-point by id, if the symbol cannot 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 persistent, fr fr.
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 the 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.
Displaying
A display is an expression that's evaluated and printed after the execution of any winedbg command. It's like a little live feed of your expression. πΊ
displayβ (No extra description given in the original, bestie.)info 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 (seeprintcommand for more on formats).del display Nβ (No extra description given in the original.)undisplay 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 stringuβ a UTF16 Unicode stringiβ instructions (disassemble)xβ 32-bit unsigned hexadecimal integerdβ 32-bit signed decimal integerwβ 16-bit unsigned hexadecimal integercβ character (only printable0x20-0x7fare actually printed)bβ 8-bit unsigned hexadecimal integergβ 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 allows mainly 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 wisely, bestie. β¨
Misc.
minidump file.mdmpβ saves the debugging context of the debuggee into a minidump file calledfile.mdmp.
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. No cap.
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 π
See the gdb documentation for all the gdb commands.
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. It's giving silent mode, bestie. πΆ
πΏ 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. So if you want a different gdb, this is your moment. π
π AUTHORS π
The first version was written by Eric Youngdale. Legend behavior. π
See Wine developers list for the rest of contributors. We love a collab.
π BUGS π
Bugs can be reported on the Wine bug tracker. Please do, they hate to see a bug thriving. π
π¦ AVAILABILITY π¦
winedbg is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. Iconic.
π SEE ALSO π
wine(1)- Wine documentation and support.
Okay bestie, that's the whole vibe. This page was from Wine 6.0, dated October 2005, and it's WINEDBG(1). Stay slay, debug responsibly, and may your breakpoints always hit. πβ¨
π¦ where this page comes from
- ubuntu jammy: wine-development 6.0+repack-1ubuntu1 Β· 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