[Libreoffice-commits] core.git: include/sal sal/osl sal/util svl/source

Stephan Bergmann sbergman at redhat.com
Wed Sep 6 07:17:48 UTC 2017


 include/sal/backtrace.hxx    |   11 ++++++++---
 sal/osl/unx/backtraceapi.cxx |    4 ++--
 sal/osl/w32/backtrace.cxx    |    4 ++--
 sal/util/sal.map             |    4 ++--
 svl/source/notify/lstner.cxx |    7 ++++---
 5 files changed, 18 insertions(+), 12 deletions(-)

New commits:
commit 796c494d78a851aae7d58e0720f64984cb5716de
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 5 11:04:42 2017 +0200

    Clean up sal/backtrace.hxx
    
    Change-Id: Id78e9c0ca29ff2e52591f3d446431ac23c20ab7a
    Reviewed-on: https://gerrit.libreoffice.org/41926
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/sal/backtrace.hxx b/include/sal/backtrace.hxx
index f437a3b73620..f471549b7f7a 100644
--- a/include/sal/backtrace.hxx
+++ b/include/sal/backtrace.hxx
@@ -23,20 +23,25 @@
   a small handful of recorded stack traces.
 
   @param backtraceDepth value indicating the maximum backtrace depth; must be > 0
+
+  @since LibreOffice 6.0
 */
 #if defined LIBO_INTERNAL_ONLY
 
+namespace sal {
+
 struct BacktraceState {
     void** buffer;
     int nDepth;
     ~BacktraceState() {delete[] buffer;}
 };
 
-SAL_DLLPUBLIC std::unique_ptr<BacktraceState> SAL_CALL sal_backtrace_get(
+SAL_DLLPUBLIC std::unique_ptr<BacktraceState> backtrace_get(
     sal_uInt32 backtraceDepth);
 
-SAL_DLLPUBLIC OUString SAL_CALL sal_backtrace_to_string(
-    BacktraceState* backtraceState);
+SAL_DLLPUBLIC OUString backtrace_to_string(BacktraceState* backtraceState);
+
+}
 
 #endif
 
diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index 4838474be36c..4216bf2cd07d 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -59,7 +59,7 @@ OUString osl::detail::backtraceAsString(sal_uInt32 maxDepth) {
     return b3.makeStringAndClear();
 }
 
-std::unique_ptr<BacktraceState> sal_backtrace_get(sal_uInt32 maxDepth)
+std::unique_ptr<sal::BacktraceState> sal::backtrace_get(sal_uInt32 maxDepth)
 {
     assert(maxDepth != 0);
     auto const maxInt = static_cast<unsigned int>(
@@ -72,7 +72,7 @@ std::unique_ptr<BacktraceState> sal_backtrace_get(sal_uInt32 maxDepth)
     return std::unique_ptr<BacktraceState>(new BacktraceState{ b1, n });
 }
 
-OUString sal_backtrace_to_string(BacktraceState* backtraceState)
+OUString sal::backtrace_to_string(BacktraceState* backtraceState)
 {
     FreeGuard b2(backtrace_symbols(backtraceState->buffer, backtraceState->nDepth));
     if (b2.buffer == nullptr) {
diff --git a/sal/osl/w32/backtrace.cxx b/sal/osl/w32/backtrace.cxx
index 230adca4a2f8..574e4a450f48 100644
--- a/sal/osl/w32/backtrace.cxx
+++ b/sal/osl/w32/backtrace.cxx
@@ -65,7 +65,7 @@ OUString osl::detail::backtraceAsString(sal_uInt32 maxDepth)
     return aBuf.makeStringAndClear();
 }
 
-std::unique_ptr<BacktraceState> sal_backtrace_get(sal_uInt32 maxDepth)
+std::unique_ptr<sal::BacktraceState> sal::backtrace_get(sal_uInt32 maxDepth)
 {
     assert(maxDepth != 0);
     auto const maxUlong = std::numeric_limits<ULONG>::max();
@@ -87,7 +87,7 @@ std::unique_ptr<BacktraceState> sal_backtrace_get(sal_uInt32 maxDepth)
     return std::unique_ptr<BacktraceState>(new BacktraceState{ pStack, nFrames });
 }
 
-OUString sal_backtrace_to_string(BacktraceState* backtraceState)
+OUString sal::backtrace_to_string(BacktraceState* backtraceState)
 {
     OUStringBuffer aBuf;
 
diff --git a/sal/util/sal.map b/sal/util/sal.map
index e9195a1434f8..4bfe548d22f0 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -735,8 +735,8 @@ PRIVATE_1.3 { # LibreOffice 5.4
 
 PRIVATE_1.4 { # LibreOffice 6.0
     global:
-        _Z17sal_backtrace_getj;
-        _Z23sal_backtrace_to_stringP14BacktraceState;
+        _ZN3sal13backtrace_getEj;
+        _ZN3sal19backtrace_to_stringEPNS_14BacktraceStateE;
 } PRIVATE_1.3;
 
 PRIVATE_textenc.1 { # LibreOffice 3.6
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index 75928021351a..9c79da9e5185 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -35,7 +35,8 @@ struct SfxListener::Impl
 {
     SfxBroadcasterArr_Impl maBCs;
 #ifdef DBG_UTIL
-    std::map<SfxBroadcaster*, std::unique_ptr<BacktraceState>> maCallStacks;
+    std::map<SfxBroadcaster*, std::unique_ptr<sal::BacktraceState>>
+        maCallStacks;
 #endif
 };
 
@@ -95,7 +96,7 @@ void SfxListener::StartListening( SfxBroadcaster& rBroadcaster, bool bPreventDup
     if (bListeningAlready && !bPreventDuplicates)
     {
         auto f = mpImpl->maCallStacks.find( &rBroadcaster );
-        SAL_WARN("svl", "previous StartListening call came from: " << sal_backtrace_to_string(f->second.get()));
+        SAL_WARN("svl", "previous StartListening call came from: " << sal::backtrace_to_string(f->second.get()));
     }
 #endif
     assert(!(bListeningAlready && !bPreventDuplicates) && "duplicate listener, try building with DBG_UTIL to find the other insert site.");
@@ -105,7 +106,7 @@ void SfxListener::StartListening( SfxBroadcaster& rBroadcaster, bool bPreventDup
         rBroadcaster.AddListener(*this);
         mpImpl->maBCs.push_back( &rBroadcaster );
 #ifdef DBG_UTIL
-        mpImpl->maCallStacks.emplace( &rBroadcaster, sal_backtrace_get(10) );
+        mpImpl->maCallStacks.emplace( &rBroadcaster, sal::backtrace_get(10) );
 #endif
         assert(IsListening(rBroadcaster) && "StartListening failed");
     }


More information about the Libreoffice-commits mailing list