Kaydet (Commit) 86088dda authored tarafından Stephan Bergmann's avatar Stephan Bergmann

osl_setDetailedDebugMessageFunc is effectively doing nothing

...since the osl/diagnose.h macros got rebased onto sal/log.hxx, so remove the
corresponding tools/debug.h functionality.

Change-Id: Ife4b5b1a2608230d0dbfc3fa8852243c89ed292f
üst 7bb5f9e1
......@@ -112,11 +112,6 @@ RTLFUNC(CaptureAssertions)
// set the new channel
DBG_INSTOUTERROR( nAssertionChannelId );
// ensure OSL assertions are captured, too
DbgData aData( *DbgGetData() );
aData.bHookOSLAssert = true;
DbgUpdateOslHook( &aData );
}
xAssertionChannelBasic = pBasic;
......
......@@ -79,7 +79,6 @@ struct DbgData
bool bOverwrite;
sal_uIntPtr nTraceOut;
sal_uIntPtr nErrorOut;
bool bHookOSLAssert;
sal_Char aDebugName[260];
sal_Char aInclFilter[512];
sal_Char aExclFilter[512];
......@@ -108,16 +107,10 @@ struct DbgDataType
#define DBG_FUNC_SETTESTSOLARMUTEX 14
#define DBG_FUNC_TESTSOLARMUTEX 15
#define DBG_FUNC_PRINTFILE 16
#define DBG_FUNC_UPDATEOSLHOOK 19
#define DBG_FUNC_SET_ABORT 20
TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL );
inline void DbgUpdateOslHook( DbgData* pData )
{
DbgFunc( DBG_FUNC_UPDATEOSLHOOK, pData );
}
inline void DbgDebugStart()
{
DbgFunc( DBG_FUNC_DEBUGSTART );
......
......@@ -117,9 +117,6 @@ struct DebugData
PointerList* pProfList;
PointerList* pXtorList;
DbgTestSolarMutexProc pDbgTestSolarMutex;
pfunc_osl_printDetailedDebugMessage
pOldDebugMessageFunc;
bool bOslIsHooked;
DebugData()
:bInit( false )
......@@ -129,8 +126,6 @@ struct DebugData
,pProfList( NULL )
,pXtorList( NULL )
,pDbgTestSolarMutex( NULL )
,pOldDebugMessageFunc( NULL )
,bOslIsHooked( false )
{
aDbgData.nTestFlags = DBG_TEST_RESOURCE;
aDbgData.bOverwrite = true;
......@@ -140,7 +135,6 @@ struct DebugData
#else
aDbgData.nErrorOut = DBG_OUT_MSGBOX;
#endif
aDbgData.bHookOSLAssert = true;
aDbgData.aDebugName[0] = 0;
aDbgData.aInclFilter[0] = 0;
aDbgData.aExclFilter[0] = 0;
......@@ -631,7 +625,6 @@ static DebugData* GetDebugData()
lcl_tryReadConfigString( pLine, nLineLength, "exclude_class", aDebugData.aDbgData.aExclClassFilter, sizeof( aDebugData.aDbgData.aExclClassFilter ) );
lcl_tryReadOutputChannel( pLine, nLineLength, "trace", &aDebugData.aDbgData.nTraceOut );
lcl_tryReadOutputChannel( pLine, nLineLength, "error", &aDebugData.aDbgData.nErrorOut );
lcl_tryReadConfigBoolean( pLine, nLineLength, "oslhook", &aDebugData.aDbgData.bHookOSLAssert );
}
// elements of the [gui] section
......@@ -809,23 +802,10 @@ static bool ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
return false;
}
extern "C"
void SAL_CALL dbg_printOslDebugMessage( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char * pszMessage )
{
DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (sal_uInt16)nLine );
}
static void DebugInit()
{
bDbgImplInMain = true;
ImplDbgInitLock();
DebugData* pData = GetDebugData();
if( pData->aDbgData.bHookOSLAssert && ! pData->bOslIsHooked )
{
pData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
pData->bOslIsHooked = true;
}
}
static void DebugDeInit()
......@@ -835,12 +815,6 @@ static void DebugDeInit()
sal_uIntPtr nCount;
sal_uIntPtr nOldOut;
if( pData->bOslIsHooked )
{
osl_setDetailedDebugMessageFunc( pData->pOldDebugMessageFunc );
pData->bOslIsHooked = false;
}
// Output statistics trace data to file
nOldOut = pData->aDbgData.nTraceOut;
pData->aDbgData.nTraceOut = DBG_OUT_FILE;
......@@ -895,7 +869,6 @@ static void DebugDeInit()
pData->aDbgData.nTestFlags &= DBG_TEST_PROFILING;
pData->aDbgPrintUserChannels.clear();
pData->pDbgPrintWindow = NULL;
pData->pOldDebugMessageFunc = NULL;
ImplDbgDeInitLock();
}
......@@ -1056,7 +1029,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
lcl_writeConfigString( pIniFile, "exclude_class", pData->aExclClassFilter );
lcl_writeConfigOutChannel( pIniFile, "trace", pData->nTraceOut );
lcl_writeConfigOutChannel( pIniFile, "error", pData->nErrorOut );
lcl_writeConfigBoolean( pIniFile, "oslhook", pData->bHookOSLAssert );
lcl_lineFeed( pIniFile );
lcl_startSection( pIniFile, eGUI );
......@@ -1107,22 +1079,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
case DBG_FUNC_PRINTFILE:
ImplDbgPrintFile( (const sal_Char*)pParam );
break;
case DBG_FUNC_UPDATEOSLHOOK:
{
const DbgData* pData = static_cast< const DbgData* >( pParam );
pDebugData->aDbgData.bHookOSLAssert = pData->bHookOSLAssert;
if( pDebugData->bOslIsHooked && ! pData->bHookOSLAssert )
{
osl_setDetailedDebugMessageFunc( pDebugData->pOldDebugMessageFunc );
pDebugData->bOslIsHooked = false;
}
else if( ! pDebugData->bOslIsHooked && pData->bHookOSLAssert )
{
pDebugData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
pDebugData->bOslIsHooked = true;
}
}
break;
}
return NULL;
......
......@@ -390,7 +390,6 @@ private:
ListBox maTraceBox;
FixedText maErrorText;
ListBox maErrorBox;
CheckBox maHookOSLBox;
GroupBox maBox4;
OKButton maOKButton;
......@@ -574,7 +573,6 @@ DbgDialog::DbgDialog() :
maTraceBox( this, WB_DROPDOWN ),
maErrorText( this ),
maErrorBox( this, WB_DROPDOWN ),
maHookOSLBox( this ),
maBox4( this ),
maOKButton( this, WB_DEFBUTTON ),
maCancelButton( this ),
......@@ -698,15 +696,6 @@ DbgDialog::DbgDialog() :
aButtonSize );
}
{
maHookOSLBox.Show();
maHookOSLBox.SetText("Reroute osl debug ~messages");
if ( pData->bHookOSLAssert )
maHookOSLBox.Check( true );
maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
LogicToPixel( Size( 100, 12 ), aAppMap ) );
}
{
maInclClassText.Show();
maInclClassText.SetText("~Include-ObjectTest-Filter");
......@@ -880,7 +869,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aData.aExclFilter[sizeof( aData.aExclFilter )-1] = '\0';
aData.bOverwrite = maOverwrite.IsChecked() ? true : false;
aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? true : false;
if ( maXtorThis.IsChecked() )
aData.nTestFlags |= DBG_TEST_XTOR_THIS;
......@@ -915,7 +903,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
// Umschalten der Laufzeitwerte
DBG_INSTOUTTRACE( aData.nTraceOut );
DBG_INSTOUTERROR( aData.nErrorOut );
DbgUpdateOslHook( &aData );
DbgData* pData = DbgGetData();
#define IMMEDIATE_FLAGS (DBG_TEST_RESOURCE | DBG_TEST_DIALOG | DBG_TEST_BOLDAPPFONT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment