diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-24 17:39:47 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-24 17:39:47 +0100 |
commit | 5342a87464932ce062004e3587bd4339a10035db (patch) | |
tree | e83d4811a35395bee15fdb8e7654e16f0e70504e /tools | |
parent | debuglevels: pulled and merged latest changes from same CWS / other repo (diff) | |
download | core-5342a87464932ce062004e3587bd4339a10035db.tar.gz core-5342a87464932ce062004e3587bd4339a10035db.zip |
debuglevels: simplify the build system, by complicating the OOo code ;)
Introduce DBGSV_(TRACE/WARNING/ERROR)_OUT, which controls the output channel for tools-level
traces/warnings/assertions, when no dbgsv.ini file is found (this is the increased OOo complexity).
Use this in installationtest.mk, instead of creating a dedicated dbgsv.ini file.
Yet to come: add support for DBGSV_ERROR_OUT to the GNU make build system. Which is the reason why
DBGSV_ERROR_OUT was introduced: Currently, running a GNU make based test pops up assertions as message
boxes. Before the change here, we would have needed to add dbgsv.ini support to the GNU make build system,
which sounds not like a funny a reasonable thing to do. So, instead, we will simply set DBGSV_ERROR_OUT,
which is much simpler and less error prone.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/debug/debug.cxx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index b15c3fe3604f..bbde4efe6d9e 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -473,26 +473,30 @@ namespace if ( nValueLen ) *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False; } - void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + void lcl_matchOutputChannel( sal_Char const * i_buffer, sal_uIntPtr* o_value ) { + if ( i_buffer == NULL ) + return; const sal_Char* names[ DBG_OUT_COUNT ] = { "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; - sal_Char aBuf[20]; - size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); - if ( nValueLen ) + for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) { - for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) + if ( strcmp( i_buffer, names[ name ] ) == 0 ) { - if ( strcmp( aBuf, names[ name ] ) == 0 ) - { - *_out_pnValue = name; - return; - } + *o_value = name; + return; } } } + void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + { + sal_Char aBuf[20]; + size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); + if ( nValueLen ) + lcl_matchOutputChannel( aBuf, _out_pnValue ); + } void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag ) { sal_Char aBuf[2]; @@ -813,6 +817,13 @@ static DebugData* GetDebugData() FileClose( pIniFile ); } + else + { + lcl_matchOutputChannel( getenv( "DBGSV_TRACE_OUT" ), &aDebugData.aDbgData.nTraceOut ); + lcl_matchOutputChannel( getenv( "DBGSV_WARNING_OUT" ), &aDebugData.aDbgData.nWarningOut ); + lcl_matchOutputChannel( getenv( "DBGSV_ERROR_OUT" ), &aDebugData.aDbgData.nErrorOut ); + + } getcwd( aCurPath, sizeof( aCurPath ) ); |