summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:33 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 16:59:33 +0100
commit932fb7b958f8e7204275cb709965b30e390c76ad (patch)
tree75f695663a97693416f8a84e140fa61805cf5bd2 /tools
parentbb54b94e5f48c4f6dce72f59dc6bc83f17d2c590 (diff)
parent78f80b020fe009bc48e9e5f8b7862de51f1f8381 (diff)
Merge commit 'ooo/DEV300_m103'
Conflicts: cppcanvas/source/mtfrenderer/implrenderer.cxx dtrans/source/win32/dtobj/XTDataObject.cxx dtrans/source/win32/dtobj/XTDataObject.hxx sot/source/sdstor/stgio.cxx tools/source/debug/debug.cxx vcl/source/gdi/jobset.cxx vcl/unx/kde4/KDEData.cxx vcl/unx/kde4/KDEData.hxx vcl/unx/kde4/KDESalDisplay.cxx vcl/unx/kde4/KDESalFrame.cxx vcl/unx/kde4/KDESalFrame.hxx vcl/unx/kde4/KDESalGraphics.cxx vcl/unx/kde4/KDESalGraphics.hxx vcl/unx/kde4/KDESalInstance.cxx vcl/unx/kde4/KDESalInstance.hxx vcl/unx/kde4/KDEXLib.cxx vcl/unx/kde4/VCLKDEApplication.cxx vcl/unx/kde4/VCLKDEApplication.hxx
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/debug.hxx8
-rw-r--r--tools/inc/tools/mempool.hxx17
-rw-r--r--tools/source/debug/debug.cxx50
-rwxr-xr-xtools/source/memtools/mempool.cxx14
-rw-r--r--tools/workben/makefile.mk68
-rw-r--r--tools/workben/mempooltest.cxx18
6 files changed, 147 insertions, 28 deletions
diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx
index 6626a984abec..3d75f94437cd 100644
--- a/tools/inc/tools/debug.hxx
+++ b/tools/inc/tools/debug.hxx
@@ -79,7 +79,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
@@ -136,6 +136,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 );
@@ -179,6 +180,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/inc/tools/mempool.hxx b/tools/inc/tools/mempool.hxx
index 6bd13859c80f..0d8187882416 100644
--- a/tools/inc/tools/mempool.hxx
+++ b/tools/inc/tools/mempool.hxx
@@ -29,7 +29,7 @@
#define _SVMEMPOOL_HXX
#include "tools/toolsdllapi.h"
-#include <tools/solar.h>
+#include "tools/solar.h"
// ----------------
// - FixedMemPool -
@@ -40,9 +40,11 @@ struct FixedMemPool_Impl;
class TOOLS_DLLPUBLIC FixedMemPool
{
FixedMemPool_Impl * m_pImpl;
+ char const * m_pTypeName;
public:
- FixedMemPool( sal_uInt16 nTypeSize,
+ FixedMemPool( char const * pTypeName,
+ sal_uInt16 nTypeSize,
sal_uInt16 nInitSize = 512,
sal_uInt16 nGrowSize = 256 );
~FixedMemPool();
@@ -98,8 +100,11 @@ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
DECL_FIXEDMEMPOOL_NEW_INLINE( Class, aPool ) \
DECL_FIXEDMEMPOOL_DEL_INLINE( Class, aPool )
+#define IMPL_FIXEDMEMPOOL_STRING(x) IMPL_FIXEDMEMPOOL_MAKESTRING(x)
+#define IMPL_FIXEDMEMPOOL_MAKESTRING(x) #x
+
#define IMPL_FIXEDMEMPOOL_NEWDEL( Class, InitSize, GrowSize) \
- FixedMemPool Class::aPool( sizeof( Class ), (InitSize), (GrowSize) );
+ FixedMemPool Class::aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) );
#define DECL_FIXEDMEMPOOL_NEWDEL_DLL( Class ) \
private: \
@@ -109,14 +114,14 @@ IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
DECL_FIXEDMEMPOOL_DEL_DECL();
#define IMPL_FIXEDMEMPOOL_NEWDEL_DLL( Class, InitSize, GrowSize) \
- FixedMemPool Class::aPool( sizeof( Class ), (InitSize), (GrowSize) ); \
+ FixedMemPool Class::aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) ); \
DECL_FIXEDMEMPOOL_NEW_IMPL( Class ) \
IMPL_FIXEDMEMPOOL_NEW_BODY( Class, aPool ) \
DECL_FIXEDMEMPOOL_DEL_IMPL( Class ) \
IMPL_FIXEDMEMPOOL_DEL_BODY( Class, aPool )
-#define INIT_FIXEDMEMPOOL_NEWDEL_DLL( class, aPool, InitSize, GrowSize ) \
- aPool( sizeof( class ), InitSize, GrowSize )
+#define INIT_FIXEDMEMPOOL_NEWDEL_DLL( Class, aPool, InitSize, GrowSize ) \
+ aPool( IMPL_FIXEDMEMPOOL_STRING( Class ), sizeof( Class ), (InitSize), (GrowSize) )
#endif // _SVMEMPOOL_HXX
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index c65745e65be0..7f28c58a5390 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -154,6 +154,7 @@ struct DebugData
DbgPrintLine pDbgPrintMsgBox;
DbgPrintLine pDbgPrintWindow;
DbgPrintLine pDbgPrintTestTool;
+ DbgPrintLine pDbgAbort;
::std::vector< DbgPrintLine >
aDbgPrintUserChannels;
PointerList* pProfList;
@@ -165,9 +166,10 @@ struct DebugData
DebugData()
:bInit( sal_False )
- ,pDbgPrintMsgBox( sal_False )
+ ,pDbgPrintMsgBox( NULL )
,pDbgPrintWindow( NULL )
,pDbgPrintTestTool( NULL )
+ ,pDbgAbort( NULL )
,pProfList( NULL )
,pXtorList( NULL )
,pDbgTestSolarMutex( NULL )
@@ -426,7 +428,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 ] );
}
@@ -477,26 +479,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", "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 ) );
- if ( nValueLen )
+ for ( size_t name = 0; name < SAL_N_ELEMENTS( names ); ++name )
{
- for ( size_t name = 0; name < SAL_N_ELEMENTS( names ); ++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];
@@ -819,6 +825,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 ) );
@@ -1207,6 +1220,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 );
@@ -1714,10 +1731,11 @@ 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();
}
if ( nOut == DBG_OUT_DEBUGGER )
diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx
index 006c5de7b6e0..55856d90bc0f 100755
--- a/tools/source/memtools/mempool.cxx
+++ b/tools/source/memtools/mempool.cxx
@@ -29,7 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#include <tools/mempool.hxx>
+#include "tools/mempool.hxx"
+#include "osl/diagnose.h"
#include "rtl/alloc.h"
#include <stdio.h>
@@ -41,11 +42,13 @@
*************************************************************************/
FixedMemPool::FixedMemPool (
- sal_uInt16 _nTypeSize, sal_uInt16, sal_uInt16)
+ char const * pTypeName, sal_uInt16 nTypeSize, sal_uInt16, sal_uInt16)
+ : m_pTypeName (pTypeName)
{
char name[RTL_CACHE_NAME_LENGTH + 1];
- snprintf (name, sizeof(name), "FixedMemPool_%d", (int)_nTypeSize);
- m_pImpl = (FixedMemPool_Impl*)rtl_cache_create (name, _nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0);
+ snprintf (name, sizeof(name), "FixedMemPool_%d", (int)nTypeSize);
+ m_pImpl = (FixedMemPool_Impl*)rtl_cache_create (name, nTypeSize, 0, NULL, NULL, NULL, 0, NULL, 0);
+ OSL_TRACE("FixedMemPool::ctor(\"%s\"): %p", m_pTypeName, m_pImpl);
}
/*************************************************************************
@@ -56,7 +59,8 @@ FixedMemPool::FixedMemPool (
FixedMemPool::~FixedMemPool()
{
- rtl_cache_destroy ((rtl_cache_type*)(m_pImpl));
+ OSL_TRACE("FixedMemPool::dtor(\"%s\"): %p", m_pTypeName, m_pImpl);
+ rtl_cache_destroy ((rtl_cache_type*)(m_pImpl)), m_pImpl = 0;
}
/*************************************************************************
diff --git a/tools/workben/makefile.mk b/tools/workben/makefile.mk
new file mode 100644
index 000000000000..d97156c7f66c
--- /dev/null
+++ b/tools/workben/makefile.mk
@@ -0,0 +1,68 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..
+PRJNAME = tools
+TARGET = workben
+LIBTARGET = NO
+TARGETTYPE = CUI
+ENABLE_EXCEPTIONS=TRUE
+
+.INCLUDE: settings.mk
+
+OBJFILES = \
+ $(OBJ)$/solar.obj \
+ $(OBJ)$/urltest.obj \
+ $(OBJ)$/inetmimetest.obj \
+ $(OBJ)$/mempooltest.obj
+
+APP1TARGET = solar
+APP1OBJS = $(OBJ)$/solar.obj
+.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+APP1STDLIBS = $(TOOLSLIB)
+.ELSE
+APP1LIBS = $(LB)$/itools.lib
+.ENDIF
+
+APP2TARGET = urltest
+APP2OBJS = $(OBJ)$/urltest.obj
+.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
+APP2STDLIBS = $(TOOLSLIB) $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
+.ELSE
+APP2STDLIBS = $(LB)$/itools.lib $(VOSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
+.ENDIF
+
+APP3TARGET = inetmimetest
+APP3OBJS = $(OBJ)$/inetmimetest.obj
+APP3STDLIBS = $(SALLIB) $(TOOLSLIB)
+
+APP4TARGET = mempooltest
+APP4OBJS = $(OBJ)$/mempooltest.obj
+APP4STDLIBS = $(TOOLSLIB)
+APP4RPATH = UREBIN
+
+.INCLUDE: target.mk
diff --git a/tools/workben/mempooltest.cxx b/tools/workben/mempooltest.cxx
new file mode 100644
index 000000000000..bf00343bc9d6
--- /dev/null
+++ b/tools/workben/mempooltest.cxx
@@ -0,0 +1,18 @@
+#include "tools/mempool.hxx"
+
+struct MempoolTest
+{
+ int m_int;
+
+ DECL_FIXEDMEMPOOL_NEWDEL(MempoolTest);
+};
+
+IMPL_FIXEDMEMPOOL_NEWDEL(MempoolTest, 0, 0);
+
+int main()
+{
+ MempoolTest * p = new MempoolTest();
+ if (p != 0)
+ delete p;
+ return 1;
+}