summaryrefslogtreecommitdiff
path: root/repo/libreoffice/remove-backtrace.patch
blob: f4eda53eb1c4d2f53ee5656553127d26849f6fb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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);