diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-20 23:09:20 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-20 23:09:20 +0100 |
commit | 192c891e562da3575d94103cf839997918b1b1a5 (patch) | |
tree | 370f4797849c9dd62e353355344728f60a906201 /tools | |
parent | 9abbe475a491631d77199a511382b39b748926a0 (diff) |
debuglevels: #i116845# replace the 'CoreDump' output channel for assertions with 'Debug'
The former was implemented on Windows only, and then effectively the same as the 'Debugger' option.
So, it was removed in favour of a new 'Abort' channel which, well, aborts when an assertion fires.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/debug.hxx | 8 | ||||
-rw-r--r-- | tools/source/debug/debug.cxx | 20 |
2 files changed, 21 insertions, 7 deletions
diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx index 4d640642c69d..63a94555a8c1 100644 --- a/tools/inc/tools/debug.hxx +++ b/tools/inc/tools/debug.hxx @@ -80,7 +80,7 @@ typedef void (*DbgTestSolarMutexProc)(); #define DBG_OUT_MSGBOX 4 #define DBG_OUT_TESTTOOL 5 #define DBG_OUT_DEBUGGER 6 -#define DBG_OUT_COREDUMP 7 +#define DBG_OUT_ABORT 7 #define DBG_OUT_COUNT 8 @@ -137,6 +137,7 @@ struct DbgDataType #define DBG_FUNC_GETPRINTMSGBOX 17 #define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967 #define DBG_FUNC_UPDATEOSLHOOK 19 +#define DBG_FUNC_SET_ABORT 20 TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL ); @@ -180,6 +181,11 @@ inline void DbgSetPrintTestTool( DbgPrintLine pProc ) DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc ); } +inline void DbgSetAbort( DbgPrintLine pProc ) +{ + DbgFunc( DBG_FUNC_SET_ABORT, (void*)(long)pProc ); +} + typedef sal_uInt16 DbgChannelId; /** registers a user-defined channel for emitting the diagnostic messages diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index fd6f499b4036..acdb7a291026 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -152,6 +152,7 @@ struct DebugData DbgPrintLine pDbgPrintMsgBox; DbgPrintLine pDbgPrintWindow; DbgPrintLine pDbgPrintTestTool; + DbgPrintLine pDbgAbort; ::std::vector< DbgPrintLine > aDbgPrintUserChannels; PointerList* pProfList; @@ -163,9 +164,10 @@ struct DebugData DebugData() :bInit( sal_False ) - ,pDbgPrintMsgBox( sal_False ) + ,pDbgPrintMsgBox( NULL ) ,pDbgPrintWindow( NULL ) ,pDbgPrintTestTool( NULL ) + ,pDbgAbort( NULL ) ,pProfList( NULL ) ,pXtorList( NULL ) ,pDbgTestSolarMutex( NULL ) @@ -420,7 +422,7 @@ namespace { const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] ); } @@ -475,7 +477,7 @@ namespace { const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; sal_Char aBuf[20]; size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); @@ -1199,6 +1201,10 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) pDebugData->pDbgPrintTestTool = (DbgPrintLine)(long)pParam; break; + case DBG_FUNC_SET_ABORT: + pDebugData->pDbgAbort = (DbgPrintLine)(long)pParam; + break; + case DBG_FUNC_SAVEDATA: { const DbgData* pData = static_cast< const DbgData* >( pParam ); @@ -1706,10 +1712,12 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa nOut = DBG_OUT_DEBUGGER; } - if ( nOut == DBG_OUT_COREDUMP ) + if ( nOut == DBG_OUT_ABORT ) { - if ( !ImplCoreDump() ) - nOut = DBG_OUT_DEBUGGER; + if ( pData->pDbgAbort != NULL ) + pData->pDbgAbort( aBufOut ); + abort(); + nOut = DBG_OUT_DEBUGGER; } if ( nOut == DBG_OUT_DEBUGGER ) |