load miscemu/wine in gdb, it'll get what you're looking forSo I was wondering how to debug this ? I tried to attach 'gdb' to it (and it works) but how do I know which symbols to load (winedbg being a script, wine having no code except linking to DLLs, ....) ?
if it doesn't work better you can also try the attached patch (if the bug is triggered inside the debugger, otherwise - in some builtin DLLs, or in wineconsole - it won't help at all)
A+
--
Eric Pouech
Name: wd_extexcpt ChangeLog: added internal variables to: - trigger the external debugger when an exception occurs inside winedbg -turn on/off the emacs controls on line edition License: X11 GenDate: 2002/12/21 16:46:51 UTC ModifiedFiles: programs/winedbg/dbg.y programs/winedbg/intvar.h programs/winedbg/winedbg.c AddedFiles: =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/programs/winedbg/dbg.y,v retrieving revision 1.3 diff -u -u -r1.3 dbg.y --- programs/winedbg/dbg.y 12 Dec 2002 23:34:01 -0000 1.3 +++ programs/winedbg/dbg.y 21 Dec 2002 16:21:28 -0000 @@ -388,32 +392,36 @@ static WINE_EXCEPTION_FILTER(wine_dbg_cmd) { - DEBUG_Printf(DBG_CHN_MESG, "\nwine_dbg_cmd: "); - switch (GetExceptionCode()) { - case DEBUG_STATUS_INTERNAL_ERROR: - DEBUG_Printf(DBG_CHN_MESG, "WineDbg internal error\n"); - break; - case DEBUG_STATUS_NO_SYMBOL: - DEBUG_Printf(DBG_CHN_MESG, "Undefined symbol\n"); - break; - case DEBUG_STATUS_DIV_BY_ZERO: - DEBUG_Printf(DBG_CHN_MESG, "Division by zero\n"); - break; - case DEBUG_STATUS_BAD_TYPE: - DEBUG_Printf(DBG_CHN_MESG, "No type or type mismatch\n"); - break; - case DEBUG_STATUS_NO_FIELD: - DEBUG_Printf(DBG_CHN_MESG, "No such field in structure or union\n"); - break; - case DEBUG_STATUS_ABORT: - break; - default: - DEBUG_Printf(DBG_CHN_MESG, "Exception %lx\n", GetExceptionCode()); - DEBUG_ExternalDebugger(); - break; - } + if (DBG_IVAR(ExtDbgOnInternalException)) + DEBUG_ExternalDebugger(); + DEBUG_Printf(DBG_CHN_MESG, "\nwine_dbg_cmd: "); + switch (GetExceptionCode()) { + case DEBUG_STATUS_INTERNAL_ERROR: + DEBUG_Printf(DBG_CHN_MESG, "WineDbg internal error\n"); + if (DBG_IVAR(ExtDbgOnInternalException)) + DEBUG_ExternalDebugger(); + break; + case DEBUG_STATUS_NO_SYMBOL: + DEBUG_Printf(DBG_CHN_MESG, "Undefined symbol\n"); + break; + case DEBUG_STATUS_DIV_BY_ZERO: + DEBUG_Printf(DBG_CHN_MESG, "Division by zero\n"); + break; + case DEBUG_STATUS_BAD_TYPE: + DEBUG_Printf(DBG_CHN_MESG, "No type or type mismatch\n"); + break; + case DEBUG_STATUS_NO_FIELD: + DEBUG_Printf(DBG_CHN_MESG, "No such field in structure or union\n"); + break; + case DEBUG_STATUS_ABORT: + break; + default: + DEBUG_Printf(DBG_CHN_MESG, "Exception %lx\n", GetExceptionCode()); + DEBUG_ExternalDebugger(); + break; + } - return EXCEPTION_EXECUTE_HANDLER; + return EXCEPTION_EXECUTE_HANDLER; } static void set_default_channels(void) Index: programs/winedbg/intvar.h =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/programs/winedbg/intvar.h,v retrieving revision 1.1 diff -u -u -r1.1 intvar.h --- programs/winedbg/intvar.h 13 Sep 2002 17:54:28 -0000 1.1 +++ programs/winedbg/intvar.h 6 Dec 2002 20:16:10 -0000 @@ -20,20 +20,22 @@ */ /* break handling */ -INTERNAL_VAR(BreakAllThreadsStartup, FALSE, NULL, DT_BASIC_CONST_INT) +INTERNAL_VAR(BreakAllThreadsStartup, FALSE, NULL, +DT_BASIC_CONST_INT) INTERNAL_VAR(BreakOnCritSectTimeOut, FALSE, NULL, DT_BASIC_CONST_INT) INTERNAL_VAR(BreakOnAttach, FALSE, NULL, DT_BASIC_CONST_INT) INTERNAL_VAR(BreakOnFirstChance, TRUE, NULL, DT_BASIC_CONST_INT) INTERNAL_VAR(BreakOnDllLoad, FALSE, NULL, DT_BASIC_CONST_INT) INTERNAL_VAR(CanDeferOnBPByAddr, FALSE, NULL, DT_BASIC_CONST_INT) - /* output handling */ + /* console handling */ INTERNAL_VAR(ConChannelMask, DBG_CHN_MESG, NULL, DT_BASIC_CONST_INT) INTERNAL_VAR(StdChannelMask, 0, NULL, DT_BASIC_CONST_INT) +INTERNAL_VAR(UseEmacsBindings, TRUE, NULL, +DT_BASIC_CONST_INT) INTERNAL_VAR(UseXTerm, TRUE, NULL, DT_BASIC_CONST_INT) /* debugging debugger */ INTERNAL_VAR(ExtDbgOnInvalidAddress, FALSE, NULL, DT_BASIC_CONST_INT) +INTERNAL_VAR(ExtDbgOnInternalException, FALSE, NULL, +DT_BASIC_CONST_INT) /* current process/thread */ INTERNAL_VAR(ThreadId, FALSE, &DEBUG_CurrTid, DT_BASIC_CONST_INT)