From 3c85eb18d7516a38a162f665b2d94afc3c9c68d1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 4 Jun 2002 21:31:10 +0000 Subject: [PATCH] Added --debugmsg option to the debugger. --- debugger/winedbg.c | 36 +++++++++++++++++++++++++----------- win32/except.c | 2 +- winedefault.reg | 3 +-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/debugger/winedbg.c b/debugger/winedbg.c index 6962dad4ee..a6198fc498 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 c10af02aa8..2f0d33d12b 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 86e98887f2..dd5572fb40 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" -