[Libreoffice-commits] .: 2 commits - compilerplugins/clang compilerplugins/Makefile-clang.mk sal/inc sal/osl sal/qa sal/rtl solenv/gbuild

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 13 08:41:11 PDT 2012


 compilerplugins/Makefile-clang.mk             |    3 
 compilerplugins/clang/compileplugin.cxx       |    9 +
 compilerplugins/clang/compileplugin.hxx       |    2 
 compilerplugins/clang/sallogareas.cxx         |  113 +++++++++++++++++++
 compilerplugins/clang/sallogareas.hxx         |   39 ++++++
 compilerplugins/clang/unusedvariablecheck.cxx |    7 -
 compilerplugins/clang/unusedvariablecheck.hxx |    2 
 sal/inc/osl/file.hxx                          |   18 +--
 sal/inc/sal/log-areas.dox                     |  148 ++++++++++++++++++++++++++
 sal/osl/unx/conditn.cxx                       |   38 +++---
 sal/osl/unx/process.cxx                       |    8 -
 sal/qa/osl/security/osl_Security.cxx          |    2 
 sal/rtl/source/alloc_arena.cxx                |   12 +-
 sal/rtl/source/alloc_cache.cxx                |   14 +-
 sal/rtl/source/alloc_global.cxx               |    8 -
 sal/rtl/source/logfile.cxx                    |    4 
 solenv/gbuild/platform/com_GCC_class.mk       |    2 
 solenv/gbuild/platform/com_GCC_defs.mk        |    2 
 18 files changed, 370 insertions(+), 61 deletions(-)

New commits:
commit 1e313e759b79bd55d977156483847e22273d8e65
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Oct 13 17:38:58 2012 +0200

    compiler check to compare SAL_WARN/LOG areas against sal/inc/sal/log-areas.dox
    
    Some of the areas are guesses I've added after seeing them, whoever feels reponsible
    for whichever part of the code feel free to adjust them.
    
    Change-Id: I2192de84d51cc2bc7c28fa84019d38b465985d15

diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index e9192fe..f9bec41 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -11,6 +11,7 @@
 # The list of source files.
 CLANGSRC=compileplugin.cxx \
     bodynotinblock.cxx \
+    sallogareas.cxx \
     unusedvariablecheck.cxx \
 
 
@@ -52,7 +53,7 @@ CLANGOBJS=
 define clangbuildsrc
 $(3): $(2) $(SRCDIR)/compilerplugins/Makefile-clang.mk $(CLANGOUTDIR)/clang-timestamp
 	@echo [build CXX] $(subst $(SRCDIR)/,,$(2))
-	$(CXX) $(CLANGCXXFLAGS) $(CLANGDEFS) $(CLANGINCLUDES) $(2) -fPIC -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d
+	$(CXX) $(CLANGCXXFLAGS) $(CLANGDEFS) $(CLANGINCLUDES) -DSRCDIR=$(SRCDIR) $(2) -fPIC -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d
 
 -include $(CLANGOUTDIR)/$(1).d
 
diff --git a/compilerplugins/clang/compileplugin.cxx b/compilerplugins/clang/compileplugin.cxx
index a61a3ba..c243b7a 100644
--- a/compilerplugins/clang/compileplugin.cxx
+++ b/compilerplugins/clang/compileplugin.cxx
@@ -18,6 +18,7 @@
 #include <clang/Rewrite/Rewriter.h>
 
 #include "bodynotinblock.hxx"
+#include "sallogareas.hxx"
 #include "unusedvariablecheck.hxx"
 
 using namespace clang;
@@ -40,7 +41,10 @@ DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef mess
     if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal())
         level = DiagnosticsEngine::Fatal;
 #endif
-    return diag.Report( loc, diag.getCustomDiagID( level, message ));
+    if( loc.isValid())
+        return diag.Report( loc, diag.getCustomDiagID( level, message ));
+    else
+        return diag.Report( diag.getCustomDiagID( level, message ));
     }
 
 bool Plugin::ignoreLocation( SourceLocation loc )
@@ -58,6 +62,7 @@ class PluginHandler
         explicit PluginHandler( ASTContext& context )
             : rewriter( context.getSourceManager(), context.getLangOpts())
             , bodyNotInBlock( context )
+            , salLogAreas( context )
             , unusedVariableCheck( context )
             {
             }
@@ -66,6 +71,7 @@ class PluginHandler
             if( context.getDiagnostics().hasErrorOccurred())
                 return;
             bodyNotInBlock.run();
+            salLogAreas.run();
             unusedVariableCheck.run();
             // TODO also LO header files? or a subdir?
            if( const RewriteBuffer* buf = rewriter.getRewriteBufferFor( context.getSourceManager().getMainFileID()))
@@ -75,6 +81,7 @@ class PluginHandler
     private:
         Rewriter rewriter;
         BodyNotInBlock bodyNotInBlock;
+        SalLogAreas salLogAreas;
         UnusedVariableCheck unusedVariableCheck;
     };
 
diff --git a/compilerplugins/clang/compileplugin.hxx b/compilerplugins/clang/compileplugin.hxx
index 6c854d1..c8ad296 100644
--- a/compilerplugins/clang/compileplugin.hxx
+++ b/compilerplugins/clang/compileplugin.hxx
@@ -23,7 +23,7 @@ class Plugin
     public:
         explicit Plugin( ASTContext& context );
     protected:
-        DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc );
+        DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
         bool ignoreLocation( SourceLocation loc );
         bool ignoreLocation( const Decl* decl );
         bool ignoreLocation( const Stmt* stmt );
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
new file mode 100644
index 0000000..b7c2f22
--- /dev/null
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -0,0 +1,113 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "sallogareas.hxx"
+
+#include <clang/Basic/SourceManager.h>
+
+#include <fstream>
+
+using namespace std;
+
+namespace loplugin
+{
+
+/*
+Check that areas used in SAL_LOG/SAL_WARN are listed in sal/inc/sal/log-areas.dox .
+*/
+
+SalLogAreas::SalLogAreas( ASTContext& context )
+    : Plugin( context )
+    {
+    }
+
+void SalLogAreas::run()
+    {
+    inFunction = NULL;
+    TraverseDecl( context.getTranslationUnitDecl());
+    }
+
+bool SalLogAreas::VisitFunctionDecl( FunctionDecl* function )
+    {
+    inFunction = function;
+    return true;
+    }
+
+bool SalLogAreas::VisitCallExpr( CallExpr* call )
+    {
+    if( ignoreLocation( call ))
+        return true;
+    if( FunctionDecl* func = call->getDirectCallee())
+        {
+        // Optimize, getQualifiedNameAsString() is reportedly expensive.
+        if( func->getNumParams() == 4 && func->getIdentifier() != NULL
+            && ( func->getName() == "sal_detail_log" || func->getName() == "log" ))
+            {
+            std::string qualifiedName = func->getQualifiedNameAsString();
+            if( qualifiedName == "sal_detail_log" || qualifiedName == "sal::detail::log" )
+                {
+                if( const StringLiteral* area = dyn_cast< StringLiteral >( call->getArg( 1 )->IgnoreParenImpCasts()))
+                    {
+                    if( area->getKind() == StringLiteral::Ascii )
+                        checkArea( area->getBytes(), area->getExprLoc());
+                    else
+                        report( DiagnosticsEngine::Warning, "unsupported string literal kind (plugin needs fixing?) [loplugin] sallog",
+                            area->getLocStart());
+                    return true;
+                    }
+                if( inFunction->getQualifiedNameAsString() == "sal::detail::log" )
+                    return true; // This function only forwards to sal_detail_log, so ok.
+                report( DiagnosticsEngine::Warning, "cannot analyse log area argument (plugin needs fixing?) [loplugin] sallog",
+                    call->getLocStart());
+                }
+            }
+        }
+    return true;
+    }
+
+void SalLogAreas::checkArea( StringRef area, SourceLocation location )
+    {
+    if( logAreas.empty())
+        readLogAreas();
+    if( !logAreas.count( area ))
+        {
+        report( DiagnosticsEngine::Warning, "unknown log area '%0' (check or extend sal/inc/sal/log-areas.dox) [loplugin] sallog",
+            location ) << area;
+        }
+    }
+
+void SalLogAreas::readLogAreas()
+    {
+#define STRINGIFY2( s ) #s
+#define STRINGIFY( s ) STRINGIFY2( s )
+    ifstream is( STRINGIFY( SRCDIR ) "/sal/inc/sal/log-areas.dox" );
+#undef STRINGIFY
+#undef STRINGIFY2
+    while( is.good())
+        {
+        string line;
+        getline( is, line );
+        size_t pos = line.find( "@li @c " );
+        if( pos != string::npos )
+            {
+            pos += strlen( "@li @c " );
+            size_t end = line.find( ' ', pos );
+            if( end == string::npos )
+                logAreas.insert( line.substr( pos ));
+            else if( pos != end )
+                logAreas.insert( line.substr( pos, end - pos ));
+            }
+        }
+    // If you get this error message, you possibly have too old icecream (ICECC_EXTRAFILES is needed).
+    if( logAreas.empty())
+        report( DiagnosticsEngine::Warning, "error reading log areas [loplugin] sallog" );
+    }
+
+} // namespace
diff --git a/compilerplugins/clang/sallogareas.hxx b/compilerplugins/clang/sallogareas.hxx
new file mode 100644
index 0000000..5207629
--- /dev/null
+++ b/compilerplugins/clang/sallogareas.hxx
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef SALLOGAREAS_H
+#define SALLOGAREAS_H
+
+#include <set>
+
+#include "compileplugin.hxx"
+
+namespace loplugin
+{
+
+class SalLogAreas
+    : public RecursiveASTVisitor< SalLogAreas >
+    , public Plugin
+    {
+    public:
+        explicit SalLogAreas( ASTContext& context );
+        void run();
+        bool VisitFunctionDecl( FunctionDecl* function );
+        bool VisitCallExpr( CallExpr* call );
+    private:
+        void checkArea( StringRef area, SourceLocation location );
+        void readLogAreas();
+        const FunctionDecl* inFunction;
+        std::set< std::string > logAreas;
+    };
+
+} // namespace
+
+#endif // SALLOGAREAS_H
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index 3d9ca3d..733c2be 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -38,13 +38,10 @@ void UnusedVariableCheck::run()
     TraverseDecl( context.getTranslationUnitDecl());
     }
 
-bool UnusedVariableCheck::VisitNamedDecl( NamedDecl* declaration )
+bool UnusedVariableCheck::VisitVarDecl( VarDecl* var )
     {
-    if( ignoreLocation( declaration ))
+    if( ignoreLocation( var ))
         return true;
-    if( !isa< VarDecl >( declaration ))
-        return true;
-    const VarDecl* var = cast< VarDecl >( declaration );
     if( var->isReferenced() || var->isUsed())
         return true;
     if( var->isDefinedOutsideFunctionOrMethod())
diff --git a/compilerplugins/clang/unusedvariablecheck.hxx b/compilerplugins/clang/unusedvariablecheck.hxx
index 21e0eab..3099eec 100644
--- a/compilerplugins/clang/unusedvariablecheck.hxx
+++ b/compilerplugins/clang/unusedvariablecheck.hxx
@@ -23,7 +23,7 @@ class UnusedVariableCheck
     public:
         explicit UnusedVariableCheck( ASTContext& context );
         void run();
-        bool VisitNamedDecl( NamedDecl* declaration );
+        bool VisitVarDecl( VarDecl* var );
     };
 
 } // namespace
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 3dde06a..3040cdb 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -1,3 +1,6 @@
+// NOTE: This file is also parsed by a compiler plugin. Make sure all
+// areas are marked with '@li @c'.
+
 /**
 @page sal_log_areas SAL debug areas
 
@@ -22,21 +25,126 @@ certain functionality.
 @li @c sal.rtl - SAL RTL library
 @li @c sal.textenc - the textencoding SAL library
 
+ at section basctl
+
+ at li @c basctl.basicide
+
+ at section canvas
+
+ at li @c canvas
+ at li @c canvas.cairo
+
+ at section connectivity
+
+ at li @c connectivity.mork
+
+ at section cui
+
+ at li @c cui.customize
+ at li @c cui.dialogs
+ at li @c cui.factory
+ at li @c cui.options
+ at li @c cui.tabpages
+
 @section Calc
 
+ at li @c sc.core
 @li @c sc.ui - Calc UI
 
+ at section desktop
+
+ at li @c desktop
+ at li @c desktop.deployment
+
+ at section Draw
+
+ at li @c sd.fwk
+ at li @c sd.sls
+ at li @c sd.tools
+ at li @c sd.view
+ at li @c sdremote
+ at li @c sdremote.bluetooth
+
+ at section editeng
+
+ at li @c editeng
+ at li @c editeng.items
+
+ at section extensions
+
+ at li @c extensions.scanner
 
 @section Filter
 
 @li @c filter.ms - escher import/export
 @li @c oox.xmlstream - XmlStream class
 
+ at section formula
+
+ at li @c formula.core
+
+ at section fpicker
+
+ at li @c fpicker.office
+
+ at section i18npool
+
+ at li @c i18npool.langtag
 
 @section Math
 
+ at li @c starmath.rtf
 @li @c starmath.ooxml - OOXML import/export
+ at li @c starmath.wordbase
+
+ at section sdext
+
+ at li @c sdext.pdfimport
+ at li @c sdext.presenter
+
+ at section sfx2
+
+ at li @c sfx2.appl
+ at li @c sfx2.bastyp
+ at li @c sfx2.config
+ at li @c sfx2.dialog
+ at li @c sfx2.doc
+ at li @c sfx2.notify
+ at li @c sfx2.view
+
+ at section slideshow
+
+ at li @c slideshow.opengl
+
+ at section svtools
 
+ at li @c svtools.config
+ at li @c svtools.contnr
+ at li @c svtools.control
+ at li @c svtools.dialogs
+ at li @c svtools.filter
+ at li @c svtools.misc
+ at li @c svtools.uno
+
+ at section svx
+
+ at li @c svx.dialog
+ at li @c svx.form
+
+ at section tools
+
+ at li @c tools.debug
+ at li @c tools.stream - SvStream class
+
+ at section ucb
+
+ at li @c cmisucp
+ at li @c ucb.ucp
+
+ at section unotools
+
+ at li @c unotools.config
+ at li @c unotools.i18n
 
 @section URE
 
@@ -46,9 +154,11 @@ certain functionality.
 
 @section VCL
 
+ at li @c vcl.control
 @li @c vcl.gdi - the GDI part of VCL, devices, bitmaps, etc.
 @li @c vcl.gtk - Gtk+ 2/3 plugin
 @li @c vcl.layout - Widget layout
+ at li @c vcl.sm
 
 
 @section Writer
@@ -58,5 +168,37 @@ certain functionality.
 @li @c sw.uno - Writer UNO interfaces
 @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter)
 
+ at section xmloff
+
+ at li @c xmloff.core
+ at li @c xmloff.forms
+ at li @c xmloff.chart
+ at li @c xmloff.style
+
+ at section other
+
+ at li @c accessibility
+ at li @c avmedia
+ at li @c basebmp
+ at li @c basic
+ at li @c binaryurp
+ at li @c bridges
+ at li @c comphelper
+ at li @c configmgr
+ at li @c cppcanvas
+ at li @c cppuhelper
+ at li @c cppu
+ at li @c editeng
+ at li @c helpcompiler
+ at li @c linguistic
+ at li @c oox
+ at li @c rsc
+ at li @c shell
+ at li @c stoc
+ at li @c ucbhelper
+ at li @c writerfilter
+ at li @c xmlhelp
+ at li @c xmlreader
+
 */
 /* vim:set ft=cpp shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index aa00267..761a405 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -55,6 +55,7 @@ define gb_CObject__command
 $(call gb_Output_announce,$(2).c,$(true),C  ,3)
 $(call gb_Helper_abbreviate_dirs,\
 	mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
+	$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
 	$(gb_CC) \
 		$(DEFS) \
 		$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
@@ -78,6 +79,7 @@ define gb_CxxObject__command
 $(call gb_Output_announce,$(2).cxx,$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs,\
 	mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
+	$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
 	$(gb_CXX) \
 		$(DEFS) \
 		$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 0cc32b5..fd93af2 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -155,8 +155,10 @@ gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
 
 ifeq ($(COM_GCC_IS_CLANG),TRUE)
 gb_COMPILER_PLUGINS :=-Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/compileplugin.so -Xclang -add-plugin -Xclang loplugin
+gb_COMPILER_PLUGINS_SETUP := ICECC_EXTRAFILES=$(SRCDIR)/sal/inc/sal/log-areas.dox
 else
 gb_COMPILER_PLUGINS :=
+gb_COMPILER_PLUGINS_SETUP :=
 endif
 
 # Executable class
commit e3418e9a8544054cb7ac87e57cff54afd4ab03a1
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Oct 13 15:52:28 2012 +0200

    use consistently sal.osl and sal.rtl as log areas
    
    Change-Id: Ib5e606283d3d37c38e9729c79c4531807a1419d3

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 3d541a9..6b9522d 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -732,7 +732,7 @@ public:
     inline Type getFileType() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_Type), "sal",
+            !isValid(osl_FileStatus_Mask_Type), "sal.osl",
             "no FileStatus Type determined");
         return isValid(osl_FileStatus_Mask_Type)
             ? static_cast< Type >(_aStatus.eType) : Unknown;
@@ -789,7 +789,7 @@ public:
     inline sal_uInt64 getAttributes() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_Attributes), "sal",
+            !isValid(osl_FileStatus_Mask_Attributes), "sal.osl",
             "no FileStatus Attributes determined");
         return _aStatus.uAttributes;
     }
@@ -804,7 +804,7 @@ public:
     inline TimeValue getCreationTime() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_CreationTime), "sal",
+            !isValid(osl_FileStatus_Mask_CreationTime), "sal.osl",
             "no FileStatus CreationTime determined");
         return _aStatus.aCreationTime;
     }
@@ -819,7 +819,7 @@ public:
     inline TimeValue getAccessTime() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_AccessTime), "sal",
+            !isValid(osl_FileStatus_Mask_AccessTime), "sal.osl",
             "no FileStatus AccessTime determined");
         return _aStatus.aAccessTime;
     }
@@ -834,7 +834,7 @@ public:
     inline TimeValue getModifyTime() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_ModifyTime), "sal",
+            !isValid(osl_FileStatus_Mask_ModifyTime), "sal.osl",
             "no FileStatus ModifyTime determined");
         return _aStatus.aModifyTime;
     }
@@ -848,7 +848,7 @@ public:
     inline sal_uInt64 getFileSize() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_FileSize), "sal",
+            !isValid(osl_FileStatus_Mask_FileSize), "sal.osl",
             "no FileStatus FileSize determined");
         return _aStatus.uFileSize;
     }
@@ -862,7 +862,7 @@ public:
     inline ::rtl::OUString getFileName() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_FileName), "sal",
+            !isValid(osl_FileStatus_Mask_FileName), "sal.osl",
             "no FileStatus FileName determined");
         return isValid(osl_FileStatus_Mask_FileName)
             ? rtl::OUString(_aStatus.ustrFileName) : rtl::OUString();
@@ -879,7 +879,7 @@ public:
     inline ::rtl::OUString getFileURL() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_FileURL), "sal",
+            !isValid(osl_FileStatus_Mask_FileURL), "sal.osl",
             "no FileStatus FileURL determined");
         return isValid(osl_FileStatus_Mask_FileURL)
             ? rtl::OUString(_aStatus.ustrFileURL) : rtl::OUString();
@@ -895,7 +895,7 @@ public:
     inline ::rtl::OUString getLinkTargetURL() const
     {
         SAL_INFO_IF(
-            !isValid(osl_FileStatus_Mask_LinkTargetURL), "sal",
+            !isValid(osl_FileStatus_Mask_LinkTargetURL), "sal.osl",
             "no FileStatus LinkTargetURL determined");
         return isValid(osl_FileStatus_Mask_LinkTargetURL)
             ? rtl::OUString(_aStatus.ustrLinkTargetURL) : rtl::OUString();
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 6896148..3dde06a 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -15,6 +15,12 @@ Please keep all entries sorted.
 This list should give you an overview of which areas to enable when debugging
 certain functionality.
 
+ at section SAL
+
+ at li @c sal.debug - SAL debugging functionality
+ at li @c sal.osl - SAL OSL library
+ at li @c sal.rtl - SAL RTL library
+ at li @c sal.textenc - the textencoding SAL library
 
 @section Calc
 
diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx
index c6417bf..c3fe130 100644
--- a/sal/osl/unx/conditn.cxx
+++ b/sal/osl/unx/conditn.cxx
@@ -58,7 +58,7 @@ oslCondition SAL_CALL osl_createCondition()
 
     if ( pCond == 0 )
     {
-        SAL_WARN("sal", "std::bad_alloc in C");
+        SAL_WARN("sal.osl", "std::bad_alloc in C");
         return 0;
     }
 
@@ -69,7 +69,7 @@ oslCondition SAL_CALL osl_createCondition()
     if ( nRet != 0 )
     {
         SAL_WARN(
-            "sal",
+            "sal.osl",
             "pthread_cond_init failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
 
@@ -81,13 +81,13 @@ oslCondition SAL_CALL osl_createCondition()
     if ( nRet != 0 )
     {
         SAL_WARN(
-            "sal",
+            "sal.osl",
             "pthread_mutex_init failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
 
         nRet = pthread_cond_destroy(&pCond->m_Condition);
         SAL_WARN_IF(
-            nRet != 0, "sal",
+            nRet != 0, "sal.osl",
             "pthread_cond_destroy failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
 
@@ -112,12 +112,12 @@ void SAL_CALL osl_destroyCondition(oslCondition Condition)
 
         nRet = pthread_cond_destroy(&pCond->m_Condition);
         SAL_WARN_IF(
-            nRet != 0, "sal",
+            nRet != 0, "sal.osl",
             "pthread_cond_destroy failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
         nRet = pthread_mutex_destroy(&pCond->m_Lock);
         SAL_WARN_IF(
-            nRet != 0, "sal",
+            nRet != 0, "sal.osl",
             "pthread_mutex_destroy failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
 
@@ -147,7 +147,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
    if ( nRet != 0 )
    {
        SAL_WARN(
-           "sal",
+           "sal.osl",
            "pthread_mutex_lock failed, errno " << nRet << ", \""
                << strerror(nRet) << '"');
        return sal_False;
@@ -158,7 +158,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
    if ( nRet != 0 )
    {
        SAL_WARN(
-           "sal",
+           "sal.osl",
            "pthread_cond_broadcast failed, errno " << nRet << ", \""
                << strerror(nRet) << '"');
        return sal_False;
@@ -168,7 +168,7 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
    if ( nRet != 0 )
    {
        SAL_WARN(
-           "sal",
+           "sal.osl",
            "pthread_mutex_unlock failed, errno " << nRet << ", \""
                << strerror(nRet) << '"');
        return sal_False;
@@ -199,7 +199,7 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
     if ( nRet != 0 )
     {
         SAL_WARN(
-            "sal",
+            "sal.osl",
             "pthread_mutex_lock failed, errno " << nRet << ", \""
                 << strerror(nRet) << '"');
         return sal_False;
@@ -211,7 +211,7 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
     if ( nRet != 0 )
     {
        SAL_WARN(
-           "sal", "pthread_mutex_unlock failed, errno " << nRet <<", \""
+           "sal.osl", "pthread_mutex_unlock failed, errno " << nRet <<", \""
                << strerror(nRet) << '"');
         return sal_False;
     }
@@ -240,7 +240,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
     if ( nRet != 0 )
     {
         SAL_WARN(
-            "sal", "pthread_mutex_lock failed, errno " << nRet <<", \""
+            "sal.osl", "pthread_mutex_lock failed, errno " << nRet <<", \""
                 << strerror(nRet) << '"');
         return osl_cond_result_error;
     }
@@ -269,7 +269,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
                         Result = osl_cond_result_timeout;
                         nRet = pthread_mutex_unlock(&pCond->m_Lock);
                         SAL_WARN_IF(
-                            nRet != 0, "sal",
+                            nRet != 0, "sal.osl",
                             "pthread_mutex_unlock failed, errno " << nRet
                                 << ", \"" << strerror(nRet) << '"');
 
@@ -280,7 +280,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
                         Result = osl_cond_result_error;
                         nRet = pthread_mutex_unlock(&pCond->m_Lock);
                         SAL_WARN_IF(
-                            nRet != 0, "sal",
+                            nRet != 0, "sal.osl",
                             "pthread_mutex_unlock failed, errno " << nRet
                                 << ", \"" << strerror(nRet) << '"');
                         return Result;
@@ -298,13 +298,13 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
             if ( nRet != 0 )
             {
                 SAL_WARN(
-                    "sal",
+                    "sal.osl",
                     "pthread_cond_wait failed, errno " << nRet << ", \""
                         << strerror(nRet) << '"');
                 Result = osl_cond_result_error;
                 nRet = pthread_mutex_unlock(&pCond->m_Lock);
                 SAL_WARN_IF(
-                    nRet != 0, "sal",
+                    nRet != 0, "sal.osl",
                     "pthread_mutex_unlock failed, errno " << nRet << ", \""
                         << strerror(nRet) << '"');
 
@@ -315,7 +315,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
 
     nRet = pthread_mutex_unlock(&pCond->m_Lock);
     SAL_WARN_IF(
-        nRet != 0, "sal",
+        nRet != 0, "sal.osl",
         "pthread_mutex_unlock failed, errno " << nRet << ", \""
             << strerror(nRet) << '"');
 
@@ -341,7 +341,7 @@ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
 
     nRet = pthread_mutex_lock(&pCond->m_Lock);
     SAL_WARN_IF(
-        nRet != 0, "sal",
+        nRet != 0, "sal.osl",
         "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet)
             << '"');
 
@@ -349,7 +349,7 @@ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
 
     nRet = pthread_mutex_unlock(&pCond->m_Lock);
     SAL_WARN_IF(
-        nRet != 0, "sal",
+        nRet != 0, "sal.osl",
         "pthread_mutex_unlock failed, errno " << nRet << ", \""
             << strerror(nRet) << '"');
 
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index eb1fdf4..c36e71f 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -243,7 +243,7 @@ static void ChildStatusProc(void *pData)
     if (socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == -1)
     {
         status = errno;
-        SAL_WARN("sal", "executeProcess socketpair() errno " << status);
+        SAL_WARN("sal.osl", "executeProcess socketpair() errno " << status);
     }
 
     fcntl(channel[0], F_SETFD, FD_CLOEXEC);
@@ -254,21 +254,21 @@ static void ChildStatusProc(void *pData)
     {
         status = errno;
         assert(status != 0);
-        SAL_WARN("sal", "executeProcess pipe(stdInput) errno " << status);
+        SAL_WARN("sal.osl", "executeProcess pipe(stdInput) errno " << status);
     }
 
     if ( status == 0 && data.m_pOutputRead && pipe( stdOutput ) == -1 )
     {
         status = errno;
         assert(status != 0);
-        SAL_WARN("sal", "executeProcess pipe(stdOutput) errno " << status);
+        SAL_WARN("sal.osl", "executeProcess pipe(stdOutput) errno " << status);
     }
 
     if ( status == 0 && data.m_pErrorRead && pipe( stdError ) == -1 )
     {
         status = errno;
         assert(status != 0);
-        SAL_WARN("sal", "executeProcess pipe(stdError) errno " << status);
+        SAL_WARN("sal.osl", "executeProcess pipe(stdError) errno " << status);
     }
 
     if ( (status == 0) && ((pid = fork()) == 0) )
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index 2368de3..7c20638 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -642,7 +642,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
             continue;
         if( argsCount >= 3 )
         {
-            SAL_WARN( "sal", "Too many test arguments" );
+            SAL_WARN( "sal.osl", "Too many test arguments" );
             continue;
         }
         args[ argsCount++ ] = arg;
diff --git a/sal/rtl/source/alloc_arena.cxx b/sal/rtl/source/alloc_arena.cxx
index fe066df..ce3c156 100644
--- a/sal/rtl/source/alloc_arena.cxx
+++ b/sal/rtl/source/alloc_arena.cxx
@@ -322,7 +322,7 @@ rtl_arena_hash_rescale (
         old_size  = arena->m_hash_size;
 
         // SAL_INFO(
-        //  "sal",
+        //  "sal.rtl",
         //  "rtl_arena_hash_rescale(" << arena->m_name << "): nseg: "
         //      << (arena->m_stats.m_alloc - arena->m_stats.m_free) << " (ave: "
         //      << ((arena->m_stats.m_alloc - arena->m_stats.m_free)
@@ -804,7 +804,7 @@ rtl_arena_deactivate (
 
     /* check for leaked segments */
     // SAL_INFO(
-    //  "sal",
+    //  "sal.rtl",
     //  "rtl_arena_deactivate(" << arena->m_name << "): allocs: "
     //      << arena->m_stats.m_alloc << ", frees: " << arena->m_stats.m_free
     //      << "; total: " << arena->m_stats.m_mem_total << ", used: "
@@ -814,7 +814,7 @@ rtl_arena_deactivate (
         sal_Size i, n;
 
         // SAL_INFO(
-        //  "sal",
+        //  "sal.rtl",
         //  "rtl_arena_deactivate(" << arena->m_name << "): cleaning up "
         //      << (arena->m_stats.m_alloc - arena->m_stats.m_free)
         //      << " leaked segment(s) [" << arena->m_stats.m_mem_alloc
@@ -1308,7 +1308,7 @@ rtl_arena_init()
         );
         assert(gp_arena_arena != 0);
     }
-    // SAL_INFO("sal", "rtl_arena_init completed");
+    // SAL_INFO("sal.rtl", "rtl_arena_init completed");
 }
 
 /* ================================================================= */
@@ -1326,7 +1326,7 @@ rtl_arena_fini()
         for (arena = head->m_arena_next; arena != head; arena = arena->m_arena_next)
         {
             // SAL_INFO(
-            //  "sal",
+            //  "sal.rtl",
             //  "rtl_arena_fini(" << arena->m_name << "): allocs: "
             //      << arena->m_stats.m_alloc << ", frees: "
             //      << arena->m_stats.m_free << "; total: "
@@ -1335,7 +1335,7 @@ rtl_arena_fini()
         }
         RTL_MEMORY_LOCK_RELEASE(&(g_arena_list.m_lock));
     }
-    // SAL_INFO("sal", "rtl_arena_fini completed");
+    // SAL_INFO("sal.rtl", "rtl_arena_fini completed");
 }
 
 /* ================================================================= */
diff --git a/sal/rtl/source/alloc_cache.cxx b/sal/rtl/source/alloc_cache.cxx
index a29b078..4d8000b 100644
--- a/sal/rtl/source/alloc_cache.cxx
+++ b/sal/rtl/source/alloc_cache.cxx
@@ -130,7 +130,7 @@ rtl_cache_hash_rescale (
         old_size  = cache->m_hash_size;
 
         // SAL_INFO(
-        //  "sal",
+        //  "sal.rtl",
         //  "rtl_cache_hash_rescale(" << cache->m_name << "): nbuf: "
         //      << (cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free)
         //      << " (ave: "
@@ -994,7 +994,7 @@ rtl_cache_deactivate (
     }
 
     // SAL_INFO(
-    //  "sal",
+    //  "sal.rtl",
     //  "rtl_cache_deactivate(" << cache->m_name << "): [slab]: allocs: "
     //      << cache->m_slab_stats.m_alloc << ", frees: "
     //      << cache->m_slab_stats.m_free << "; total: "
@@ -1010,7 +1010,7 @@ rtl_cache_deactivate (
     if (cache->m_slab_stats.m_alloc > cache->m_slab_stats.m_free)
     {
         // SAL_INFO(
-        //  "sal",
+        //  "sal.rtl",
         //  "rtl_cache_deactivate(" << cache->m_name << "): cleaning up "
         //      << (cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free)
         //      << " leaked buffer(s) [" << cache->m_slab_stats.m_mem_alloc
@@ -1501,7 +1501,7 @@ rtl_cache_wsupdate (
         RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
 
         // SAL_INFO(
-        //  "sal",
+        //  "sal.rtl",
         //  "rtl_cache_wsupdate(" << cache->m_name
         //      << ") [depot: count, curr_min, prev_min] full: "
         //      << cache->m_depot_full.m_mag_count << ", "
@@ -1653,7 +1653,7 @@ rtl_cache_init()
     }
 
     rtl_cache_wsupdate_init();
-    // SAL_INFO("sal", "rtl_cache_init completed");
+    // SAL_INFO("sal.rtl", "rtl_cache_init completed");
 }
 
 /* ================================================================= */
@@ -1696,7 +1696,7 @@ rtl_cache_fini()
         for (cache = head->m_cache_next; cache != head; cache = cache->m_cache_next)
         {
             // SAL_INFO(
-            //  "sal",
+            //  "sal.rtl",
             //  "rtl_cache_fini(" << cache->m_name << ") [slab]: allocs: "
             //      << cache->m_slab_stats.m_alloc << ", frees: "
             //      << cache->m_slab_stats.m_free << "; total: "
@@ -1712,7 +1712,7 @@ rtl_cache_fini()
         }
         RTL_MEMORY_LOCK_RELEASE(&(g_cache_list.m_lock));
     }
-    // SAL_INFO("sal", "rtl_cache_fini completed");
+    // SAL_INFO("sal.rtl", "rtl_cache_fini completed");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/source/alloc_global.cxx b/sal/rtl/source/alloc_global.cxx
index 7ac963c..4e9a45b 100644
--- a/sal/rtl/source/alloc_global.cxx
+++ b/sal/rtl/source/alloc_global.cxx
@@ -234,7 +234,7 @@ void rtl_memory_init()
         }
     }
 #endif
-    // SAL_INFO("sal", "rtl_memory_init completed");
+    // SAL_INFO("sal.rtl", "rtl_memory_init completed");
 }
 
 /* ================================================================= */
@@ -264,7 +264,7 @@ void rtl_memory_fini()
         gp_alloc_arena = 0;
     }
 #endif
-    // SAL_INFO("sal", "rtl_memory_fini completed");
+    // SAL_INFO("sal.rtl", "rtl_memory_fini completed");
 }
 
 /* ================================================================= *
@@ -297,7 +297,7 @@ void * SAL_CALL rtl_reallocateMemory_SYSTEM (void * p, sal_Size n)
 void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
 {
     SAL_WARN_IF(
-        n >= SAL_MAX_INT32, "sal",
+        n >= SAL_MAX_INT32, "sal.rtl",
         "suspicious massive alloc " << n);
 #if !defined(FORCE_SYSALLOC)
     while (1)
@@ -320,7 +320,7 @@ void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
 void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
 {
     SAL_WARN_IF(
-        n >= SAL_MAX_INT32, "sal",
+        n >= SAL_MAX_INT32, "sal.rtl",
         "suspicious massive alloc " << n);
 #if !defined(FORCE_SYSALLOC)
     while (1)
diff --git a/sal/rtl/source/logfile.cxx b/sal/rtl/source/logfile.cxx
index 73215e0..eca7fa6 100644
--- a/sal/rtl/source/logfile.cxx
+++ b/sal/rtl/source/logfile.cxx
@@ -106,7 +106,7 @@ OUString getFileUrl( const OUString &name )
          != osl_File_E_None )
     {
         SAL_WARN(
-            "sal", "osl_getFileURLFromSystemPath failed for \"" << name << '"');
+            "sal.rtl", "osl_getFileURLFromSystemPath failed for \"" << name << '"');
     }
 
     OUString aWorkingDirectory;
@@ -182,7 +182,7 @@ void init() {
                 else
                 {
                     SAL_WARN(
-                        "sal",
+                        "sal.rtl",
                         "Couldn't open logfile " << o << '(' << +e << ')');
                 }
             }


More information about the Libreoffice-commits mailing list