summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2020-02-21 11:49:25 +0100
committerDominik Holland <dominik.holland@qt.io>2020-02-22 09:46:26 +0000
commit5b083027ff9e27190622d03139bb234284e5e31e (patch)
treef88495d63ee62bc70585262b0855cdac1dedf2d4
parent3059fc20afaefea7f7b265e35bf96ea0037929d8 (diff)
Add a hint when a stacktrace is shown while running in release mode
When the binary is build in release mode, the debug information are stripped and might not be very accurate. Add a note to the stacktrace and add a note what can be done instead e.g. using DYLD_IMAGE_SUFFIX on macos. Change-Id: Iee1f05a52099ca691848a7d2d106eeceef896769 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--src/common-lib/crashhandler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common-lib/crashhandler.cpp b/src/common-lib/crashhandler.cpp
index dd4ad89f..27b227a0 100644
--- a/src/common-lib/crashhandler.cpp
+++ b/src/common-lib/crashhandler.cpp
@@ -47,6 +47,8 @@
# include <QtQml/private/qv4engine_p.h>
#endif
+#include <QLibraryInfo>
+
#include "crashhandler.h"
#include "global.h"
#include "utilities.h"
@@ -403,6 +405,13 @@ static void logCrashInfo(LogToDestination logTo, const char *why, int stackFrame
threadName, tid, pthreadId);
if (printBacktrace) {
+ if (!QLibraryInfo::isDebugBuild()) {
+ logMsgF(logTo, "\n > Your binary is build in release mode. The provided stacktrace might not very accurate.");
+ logMsgF(logTo, " > Please consider using a debug build for a more accurate stacktrace.");
+# if defined(Q_OS_MACOS)
+ logMsgF(logTo, " > E.g. By running the binary using DYLD_IMAGE_SUFFIX=_debug");
+# endif
+ }
# if defined(AM_USE_LIBBACKTRACE) && defined(BACKTRACE_SUPPORTED)
struct btData
{