WINEDBG(1)
π NAME π
winedbg(1) from the Wine Developers Manual: winedbg is the Wine debugger, bestie. π
β¨ 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 π
Okay so winedbg is a debugger for Wine. It allows:
- debugging native Win32 applications
- debugging Winelib applications
- being a drop-in replacement for Dr Watson
π MODES π
winedbg can be used in five modes. The first argument to the program determines the mode winedbg will run in. Five whole modes, bestie β the first argument is the vibe check. π
defaultβ No explicit mode? 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").--exec filenameβ Sets the executable name, without starting the executable.--file filenameβwinedbgwill execute the list of commands contained in filefilenameas if they were keyed onwinedbgcommand line, and then will exit.
When in gdb proxy mode, the following options are available:
--no-startβ Don't launchgdbdirectly; instead, print thetarget remoteGDB command to execute and listen for connection from any GDB-compatible debugger. Normally,--gdbwill start both the proxy debugging server and an instance ofgdbfor the front end. This option instructswinedbgto skip launching ofgdb, and instead prints the GDB command that can be used to manually connect to the server. This command is in the formtarget remote localhost:<port>where<port>is the TCP portwinedbg's proxy debugging server is bound to.
This option allows the user to replace gdb with some other debugger front end, such as ddd, kgdb, gdbgui, or Qt Creator. Regardless of whether --no-start is specified, winedbg will quit after the first connection is hung up (e.g. gdb detaches from the debuggee).
--port portβ Start the GDB proxy debugging server on the given port. If this option is not specified,winedbgwill let the operating system choose any available port. This option can be used in conjunction with--no-startto specify the port the server shall be bound to.--with-xtermβ This will run 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 passed, is used to identify which program, if any, is to be debugged:
program_nameβ This is the name of an executable to start for a debugging session.winedbgwill actually create a process with this executable. Ifprogram_argumentsare also given, they will be used as arguments for creating the process to be debugged.wpidβwinedbgwill attach to the process whose 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 so first thing's first: most of the commands you already know from winedbg are literally the same vibes as the ones from gdb, so if you need the deep lore, please refer to the gdb documentations π. also pls check out the gdb differences section later on to get the full list of where winedbg switches it up from gdb commands β iykyk.
β¨ Misc. commands
abortβ just straight up aborts the debugger. π no cap.quitβ exits the debugger. bye bestie π«Ά
π§ Process handling
attach Nβ attaches to a Wine process, where N is its Windows ID, and yes it can be numeric or hexadecimal. you can grab those IDs with theinfo processcommand. π note: theinfo processcommand returns hexadecimal values!attach file.mdmpβ reloads the state of a debuggee from the minidumpfile.mdmp. peek theminidumpcommand if you wanna save one of these bad boys.detachβ detaches the current Wine process. the process is no longer debugged by WineDbg, but it's still running (this is for a live target, obvi).killβ kills the current Wine process. the process is no longer debugged by WineDbg, and it's also terminated (again, for a live target). π₯minidump file.mdmpβ saves the debugging context of the debuggee into a minidump file calledfile.mdmpβ¨runβ re-runs the same process with the same arguments. β οΈ note: all breakpoints of the precedent process are no longer available. rip to those breakpoints πͺ¦run arg1 arg2...β re-runs the same process with the argumentsarg1 arg2.... same warning bestie: all breakpoints of the precedent process are no longer available.thread Nβ changes the current thread to N, which is its Windows TID, numeric or hexadecimal. π§΅
π Help commands
helpβ prints some help on the commands.help infoβ prints some help oninfocommands. so meta π¦
β Flow control commands
contβ continues execution until the next breakpoint or exception.passβ passes the exception event up to the filter chain.stepβ continues execution until the next C line of code (enters function call).nextβ continues execution until the next C line of code (doesn't enter function call).stepiβ executes the next assembly instruction (enters function call).nextiβ executes the next assembly instruction (doesn't enter function call).finishβ executes until the return of the current function is reached.
bestie listen πcont,step,next,stepi,nextican be postfixed by a number (N), meaning the command must be executed N times before control is returned to you. literally so handy.
π Breakpoints, watchpoints
enable Nβ enables (break|watch)-point N.disable Nβ disables (break|watch)-point N.delete Nβ deletes (break|watch)-point N.cond Nβ removes any existing condition to (break|watch)-point N.cond N exprβ adds the condition expr to (break|watch)-point N. expr will 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 address N.break idβ adds a breakpoint at the address of symbol id.break id Nβ adds a breakpoint at line N inside symbol id.break Nβ adds a breakpoint at line N of the current source file.breakβ adds a breakpoint at the current$PCaddress. yes, with no args at all πwatch * Nβ adds a watch command (on write) at address N (on 4 bytes).watch idβ adds a watch command (on write) at the address of symbol id. size depends on the size of id.rwatch * Nβ adds a watch command (on read) at address N (on 4 bytes).rwatch idβ adds a watch command (on read) at the address of symbol id. size depends on the size of id.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 π«Ά
and here's a lil detail that's lowkey iconic: when you set a (break|watch)-point by id and 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 literally remembers for you. main character energy fr.
π¦ Stack manipulation
btβ prints the calling stack of the current thread.bt Nβ prints the calling stack of the thread of ID N. note: this doesn't change the position of the current frame as manipulated by theup&dncommands. πupβ goes up one frame in the current thread's stack.up Nβ goes up N frames in the current thread's stack.dnβ goes down one frame in the current thread's stack.dn Nβ goes down N frames in the current thread's stack.frame Nβ sets N as the current frame for the current thread's stack.info localsβ prints information on local variables for the current function frame.
π Directory & source file manipulation
show dirβ prints the list of dirs where source files are looked for.dir pathnameβ adds pathname to the list of dirs where to look for source files.dirβ deletes the list of dirs where to look for source files. empty. gone. β¨symbolfile pathnameβ loads external symbol definition file pathname.symbolfile pathname Nβ loads external symbol definition file pathname (applying an offset of N to addresses).listβ lists 10 source lines forwards from the current position.list -β lists 10 source lines backwards from the current position.list Nβ lists 10 source lines from line N in the current file.list pathname:Nβ lists 10 source lines from line N in file pathname.list idβ lists 10 source lines of function id.list * Nβ lists 10 source lines from address N.
and here's the cute part: 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 the current file πΈlist foo.c:1,56β lists source lines from line 1 up to 56 in filefoo.c
π Displaying
quick definition bestie: a display is an expression that's evaluated and printed after the execution of any winedbg command. so it just... keeps showing up. obsessed.
displayinfo displayβ lists the active displays.display exprβ adds a display for the expression expr.display /fmt exprβ adds a display for the expression expr. printing the evaluated expr is done using the given format (see theprintcommand for more on formats).del display Nundisplay Nβ deletes display N. (both spellings, slay π )
π Disassembly
disasβ disassemble from the current position.disas exprβ disassemble from the address expr.disas expr,exprβ disassembles code between the addresses specified by the two expressions.
π§ Memory (reading, writing, typing)
x exprβ examines memory at address expr.x /fmt exprβ examines memory at address expr using format fmt.print exprβ prints the value of expr (possibly using its type).print /fmt exprβ prints the value of expr (possibly using its type).set var = exprβ writes the value of expr in the var variable.whatis exprβ prints the C type of the expression expr.
okay so fmt is either a letter or a 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. cute, right? however, there are a few discrepancies you gotta know about:
- Identifiers can take a
!in their names. this mainly lets you 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). no skipping, bestie.
also: when specifying an identifier, if several symbols with this name exist, the debugger will prompt for the symbol you want to use. just pick up the one you want from its number π«Ά
π Information on Wine internals
info classβ lists all Windows classes registered in Wine.info class idβ prints information on Windows class id.info shareβ lists all the dynamic libraries loaded in the debugged program (including.sofiles, NE and PE DLLs).info share Nβ prints information on the module at address N.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 segment N (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 pid N.info wndβ displays the window hierarchy starting from the desktop window.info wnd Nβ prints information of the Window of handle N.info processβ lists all w-processes in the Wine session.info threadβ lists all w-threads in the Wine session.info frameβ lists the exception frames (starting from the current stack frame). you can also pass, as an optional argument, a thread id (instead of the current thread) to examine its exception frames. π§΅
debug messages can be turned on and off as you're debugging using the set command β but only for channels initialized with the WINEDEBUG environment variable. that part matters, don't forget it β¨
set warn + winβ turns onwarnon thewinchannel.set + winβ turns onwarn/fixme/err/traceon thewinchannel.set - winβ turns offwarn/fixme/err/traceon thewinchannel.set fixme - allβ turns off thefixmeclass on all channels.
π Gdb mode
see the gdb documentation for all the gdb commands, bestie β that's the whole reference.
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 the debugged process.
π¦ Auto and minidump modes
since no user input is possible, no commands are available. that's it. that's the whole section π
πΈ 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 the Wine developers list for the rest of the contributors π
β BUGS
bugs can be reported on the Wine bug tracker. go off, report them π
π AVAILABILITY
winedbg is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters. π
β¨ SEE ALSO β¨
okay so when you're done vibing with winedbg and you wanna go read more, here's the reading list bestie π«Ά
wine(1)β literally the whole reason we're here, go say hi to the main character π- Wine documentation and support β the docs and the support situation, your safe space when things get messy π
and that's a wrap on WINEDBG(1), bestie!! π you made it all the way to the bottom, I'm so proud of you fr fr π go forth and debug slayfully β¨
this icon was brought to you by Wine 11.21, dated October 2005 β vintage, iconic, still serving π πΈ
π¦ where this page comes from
- arch rolling: wine 11.21-1 Β· LGPL-2.1-or-later
- arch rolling: wine-staging 11.21-1 Β· LGPL-2.1-or-later
- nixpkgs unstable: wine 11.21
- nixpkgs unstable: wine-staging 11.21
- nixpkgs unstable: wine-wow64 11.21
- nixpkgs unstable: wine-wow64-staging 11.21
- nixpkgs unstable: wine64 11.21
- nixpkgs unstable: wine64-staging 11.21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms