45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
From f178b839d5137f2e8e1e728cbf877f6a3a73346e Mon Sep 17 00:00:00 2001
|
|
From: Piotr Wójcik <chocimier@tlen.pl>
|
|
Date: Sat, 21 Jan 2023 21:29:41 +0100
|
|
Subject: backtrace
|
|
|
|
|
|
diff --git a/src/libs/utils/qtcassert.cpp b/src/libs/utils/qtcassert.cpp
|
|
index d371b6f6..40b4cd9b 100644
|
|
--- a/src/libs/utils/qtcassert.cpp
|
|
+++ b/src/libs/utils/qtcassert.cpp
|
|
@@ -29,7 +29,7 @@ void dumpBacktrace(int maxdepth)
|
|
const int ArraySize = 1000;
|
|
if (maxdepth < 0 || maxdepth > ArraySize)
|
|
maxdepth = ArraySize;
|
|
-#if defined(Q_OS_UNIX)
|
|
+#if defined(Q_OS_UNIX) && defined(__GLIBC__)
|
|
void *bt[ArraySize] = {nullptr};
|
|
int size = backtrace(bt, maxdepth);
|
|
char **lines = backtrace_symbols(bt, size);
|
|
diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
|
|
index ba8afd56..2ae4041a 100644
|
|
--- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
|
|
+++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
|
|
@@ -75,7 +75,7 @@ bool Exception::warnAboutException()
|
|
return s_warnAboutException;
|
|
}
|
|
|
|
-#ifdef Q_OS_LINUX
|
|
+#if defined(Q_OS_UNIX) && defined(__GLIBC__)
|
|
static QString getBackTrace()
|
|
{
|
|
QString backTrace;
|
|
@@ -113,7 +113,7 @@ Exception::Exception(int line, const QByteArray &function,
|
|
, m_function(QString::fromUtf8(function))
|
|
, m_file(QString::fromUtf8(file))
|
|
, m_description(description)
|
|
- #ifdef Q_OS_LINUX
|
|
+ #if defined(Q_OS_UNIX) && defined(__GLIBC__)
|
|
, m_backTrace(getBackTrace())
|
|
#endif
|
|
{
|
|
--
|
|
2.39.0
|
|
|