summaryrefslogtreecommitdiff
path: root/repo/libreoffice/remove-backtrace.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repo/libreoffice/remove-backtrace.patch')
-rw-r--r--repo/libreoffice/remove-backtrace.patch163
1 files changed, 163 insertions, 0 deletions
diff --git a/repo/libreoffice/remove-backtrace.patch b/repo/libreoffice/remove-backtrace.patch
new file mode 100644
index 0000000..f4eda53
--- /dev/null
+++ b/repo/libreoffice/remove-backtrace.patch
@@ -0,0 +1,163 @@
+diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
+index d783c84e3..555efd664 100644
+--- a/sal/Library_sal.mk
++++ b/sal/Library_sal.mk
+@@ -156,7 +156,6 @@ endif
+
+ ifneq ($(OS),WNT)
+ $(eval $(call gb_Library_add_exception_objects,sal,\
+- sal/osl/unx/backtraceapi \
+ sal/osl/unx/conditn \
+ sal/osl/unx/file \
+ sal/osl/unx/file_error_transl \
+diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
+index c493f4ddf..f8f4fab62 100644
+--- a/sal/osl/all/log.cxx
++++ b/sal/osl/all/log.cxx
+@@ -283,9 +283,6 @@ void sal_detail_log(
+ ? nStrLen : 0));
+ }
+ s << message;
+- if (backtraceDepth != 0) {
+- s << " at:\n" << osl::detail::backtraceAsString(backtraceDepth);
+- }
+
+ #if defined ANDROID
+ int android_log_level;
+diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
+deleted file mode 100644
+index d11128353..000000000
+--- a/sal/osl/unx/backtraceapi.cxx
++++ /dev/null
+@@ -1,72 +0,0 @@
+-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+-/*
+- * This file is part of the LibreOffice project.
+- *
+- * This Source Code Form is subject to the terms of the Mozilla Public
+- * License, v. 2.0. If a copy of the MPL was not distributed with this
+- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+- */
+-
+-#include <sal/config.h>
+-
+-#include <cassert>
+-#include <cstdlib>
+-#include <limits>
+-#include <memory>
+-
+-#include <o3tl/runtimetooustring.hxx>
+-#include <rtl/ustrbuf.hxx>
+-#include <rtl/ustring.hxx>
+-#include <sal/types.h>
+-#include <sal/backtrace.hxx>
+-
+-#include "backtrace.h"
+-#include <backtraceasstring.hxx>
+-
+-namespace {
+-
+-struct FreeGuard {
+- FreeGuard(char ** theBuffer): buffer(theBuffer) {}
+-
+- ~FreeGuard() { std::free(buffer); }
+-
+- char ** buffer;
+-};
+-
+-}
+-
+-OUString osl::detail::backtraceAsString(sal_uInt32 maxDepth) {
+- std::unique_ptr<sal::BacktraceState> backtrace = sal::backtrace_get( maxDepth );
+- return sal::backtrace_to_string( backtrace.get());
+-}
+-
+-std::unique_ptr<sal::BacktraceState> sal::backtrace_get(sal_uInt32 maxDepth)
+-{
+- assert(maxDepth != 0);
+- auto const maxInt = static_cast<unsigned int>(
+- std::numeric_limits<int>::max());
+- if (maxDepth > maxInt) {
+- maxDepth = static_cast<sal_uInt32>(maxInt);
+- }
+- auto b1 = new void *[maxDepth];
+- int n = backtrace(b1, static_cast<int>(maxDepth));
+- return std::unique_ptr<BacktraceState>(new BacktraceState{ b1, n });
+-}
+-
+-OUString sal::backtrace_to_string(BacktraceState* backtraceState)
+-{
+- FreeGuard b2(backtrace_symbols(backtraceState->buffer, backtraceState->nDepth));
+- if (b2.buffer == nullptr) {
+- return OUString();
+- }
+- OUStringBuffer b3;
+- for (int i = 0; i != backtraceState->nDepth; ++i) {
+- if (i != 0) {
+- b3.append("\n");
+- }
+- b3.append(o3tl::runtimeToOUString(b2.buffer[i]));
+- }
+- return b3.makeStringAndClear();
+-}
+-
+-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
+index 40a59960a..3efcc004c 100644
+--- a/svl/source/notify/lstner.cxx
++++ b/svl/source/notify/lstner.cxx
+@@ -80,13 +80,6 @@ void SfxListener::StartListening(SfxBroadcaster& rBroadcaster, DuplicateHandling
+ {
+ bool bListeningAlready = IsListening( rBroadcaster );
+
+-#ifdef DBG_UTIL
+- if (bListeningAlready && eDuplicateHanding == DuplicateHandling::Unexpected)
+- {
+- auto f = maCallStacks.find( &rBroadcaster );
+- SAL_WARN("svl", "previous StartListening call came from: " << sal::backtrace_to_string(f->second.get()));
+- }
+-#endif
+ assert(!(bListeningAlready && eDuplicateHanding == DuplicateHandling::Unexpected) && "duplicate listener, try building with DBG_UTIL to find the other insert site.");
+
+ if (!bListeningAlready || eDuplicateHanding != DuplicateHandling::Prevent)
+diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
+index 3f4253cd2..8af3ee184 100644
+--- a/sw/source/core/attr/calbck.cxx
++++ b/sw/source/core/attr/calbck.cxx
+@@ -170,18 +170,6 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
+ void SwModify::Add( SwClient* pDepend )
+ {
+ DBG_TESTSOLARMUTEX();
+-#ifdef DBG_UTIL
+- // You should not EVER use SwModify directly in new code:
+- // - Preexisting SwModifys should only ever be used via sw::BroadcastingModify.
+- // This includes sw::BroadcastMixin, which is the long-term target (without
+- // SwModify).
+- // - New classes should use sw::BroadcastMixin alone.
+- if(!dynamic_cast<sw::BroadcastingModify*>(this))
+- {
+- auto pBT = sal::backtrace_get(20);
+- SAL_WARN("sw.core", "Modify that is not broadcasting used!\n" << sal::backtrace_to_string(pBT.get()));
+- }
+-#endif
+
+ if(pDepend->m_pRegisteredIn == this)
+ return;
+diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
+index 4f7b18ba3..fbd2eb361 100644
+--- a/sw/source/core/docnode/node.cxx
++++ b/sw/source/core/docnode/node.cxx
+@@ -1164,13 +1164,6 @@ void SwContentNode::SwClientNotify( const SwModify&, const SfxHint& rHint)
+ // This makes the crude "WhichId" type divert from the true type, which is bad.
+ // Thus we are asserting here, but falling back to an proper
+ // hint instead. so that we at least will not spread such poison further.
+-#ifdef DBG_UTIL
+- if(pLegacyHint->m_pNew != pLegacyHint->m_pOld)
+- {
+- auto pBT = sal::backtrace_get(20);
+- SAL_WARN("sw.core", "UpdateAttr not matching! " << sal::backtrace_to_string(pBT.get()));
+- }
+-#endif
+ assert(pLegacyHint->m_pNew == pLegacyHint->m_pOld);
+ assert(dynamic_cast<const SwUpdateAttr*>(pLegacyHint->m_pNew));
+ const SwUpdateAttr aFallbackHint(0,0,0);