diff --git a/debugger/winedbg.c b/debugger/winedbg.c index 6962dad4eef..a6198fc4981 100644 --- a/debugger/winedbg.c +++ b/debugger/winedbg.c @@ -28,11 +28,11 @@ #include "ntddk.h" #include "thread.h" #include "wincon.h" +#include "winreg.h" #include "wingdi.h" #include "winuser.h" #include "msvcrt/excpt.h" - -#include "winreg.h" +#include "wine/library.h" DBG_PROCESS* DEBUG_CurrProcess = NULL; DBG_THREAD* DEBUG_CurrThread = NULL; @@ -991,16 +991,30 @@ int main(int argc, char** argv) /* Initialize internal vars (types must have been initialized before) */ if (!DEBUG_IntVarsRW(TRUE)) return -1; - if (argc > 1 && !strcmp( argv[1], "--auto" )) + /* parse options */ + while (argc > 1 && argv[1][0] == '-') { - argc--; - argv++; - automatic_mode = 1; - /* force some internal variables */ - DBG_IVAR(UseXTerm) = 0; - DBG_IVAR(BreakOnDllLoad) = 0; - DBG_IVAR(ConChannelMask) = 0; - DBG_IVAR(StdChannelMask) = DBG_CHN_MESG; + if (!strcmp( argv[1], "--auto" )) + { + automatic_mode = 1; + /* force some internal variables */ + DBG_IVAR(UseXTerm) = 0; + DBG_IVAR(BreakOnDllLoad) = 0; + DBG_IVAR(ConChannelMask) = 0; + DBG_IVAR(StdChannelMask) = DBG_CHN_MESG; + argc--; + argv++; + continue; + } + if (!strcmp( argv[1], "--debugmsg" ) && argv[2]) + { + wine_dbg_parse_options( argv[2] ); + argc -= 2; + argv += 2; + continue; + } + DEBUG_Printf(DBG_CHN_MESG, "Usage: winedbg [--debugmsg dbgoptions] [--auto] cmdline\n" ); + return 1; } DEBUG_InitConsole(); diff --git a/win32/except.c b/win32/except.c index c10af02aa8a..2f0d33d12b2 100644 --- a/win32/except.c +++ b/win32/except.c @@ -253,7 +253,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent) RegCloseKey(hDbgConf); } else { /* try a default setup... */ - strcpy( format, "winedbg --debugmsg -all -- --auto %ld %ld" ); + strcpy( format, "winedbg --debugmsg -all --auto %ld %ld" ); } if (!bAuto) diff --git a/winedefault.reg b/winedefault.reg index 86e98887f22..dd5572fb402 100644 --- a/winedefault.reg +++ b/winedefault.reg @@ -87,7 +87,7 @@ # [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug] # command line to start a debugger when an exception occurs -"Debugger"="winedbg %ld %ld" +"Debugger"="winedbg --debugmsg -all %ld %ld" # to 0 if a message box has to be presented before running the debugger "Auto"="1" @@ -401,4 +401,3 @@ "Times New Roman Greek,161"="Times New Roman,161" "Times New Roman TUR,162"="Times New Roman,162" "Tms Rmn"="Times New Roman" -