aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/PrettyStackTrace.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2020-06-29 13:13:12 +0100
committerJohn Brawn <john.brawn@arm.com>2020-06-29 13:13:12 +0100
commitce1fa201af77e60d31b48571ffa1f85b919f6245 (patch)
tree865dcccb3584c061a2d6cde08eca5b794a3dbb36 /llvm/lib/Support/PrettyStackTrace.cpp
parent52911428ef50556edbddd9e32220c22e8755a002 (diff)
downloadllvm-ce1fa201af77e60d31b48571ffa1f85b919f6245.zip
llvm-ce1fa201af77e60d31b48571ffa1f85b919f6245.tar.gz
llvm-ce1fa201af77e60d31b48571ffa1f85b919f6245.tar.bz2
[Driver] When forcing a crash print the bug report message
Commit a945037e8fd0c30e250a62211469eea6765a36ae moved the printing of the "PLEASE submit a bug report" message to the crash handler, but that means we don't print it when forcing a crash using FORCE_CLANG_DIAGNOSTICS_CRASH. Fix this by adding a function to get the bug report message and printing it when forcing a crash. Differential Revision: https://reviews.llvm.org/D81672
Diffstat (limited to 'llvm/lib/Support/PrettyStackTrace.cpp')
-rw-r--r--llvm/lib/Support/PrettyStackTrace.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp
index 3d310ed..9072f9d2 100644
--- a/llvm/lib/Support/PrettyStackTrace.cpp
+++ b/llvm/lib/Support/PrettyStackTrace.cpp
@@ -33,6 +33,10 @@
using namespace llvm;
+static const char *BugReportMsg =
+ "PLEASE submit a bug report to " BUG_REPORT_URL
+ " and include the crash backtrace.\n";
+
// If backtrace support is not enabled, compile out support for pretty stack
// traces. This has the secondary effect of not requiring thread local storage
// when backtrace support is disabled.
@@ -142,10 +146,6 @@ using CrashHandlerStringStorage =
static CrashHandlerStringStorage crashHandlerStringStorage;
#endif
-static const char *BugReportMsg =
- "PLEASE submit a bug report to " BUG_REPORT_URL
- " and include the crash backtrace.\n";
-
/// This callback is run if a fatal signal is delivered to the process, it
/// prints the pretty stack trace.
static void CrashHandler(void *) {
@@ -203,9 +203,11 @@ static void printForSigInfoIfNeeded() {
#endif // ENABLE_BACKTRACES
void llvm::setBugReportMsg(const char *Msg) {
-#if ENABLE_BACKTRACES
BugReportMsg = Msg;
-#endif
+}
+
+const char *llvm::getBugReportMsg() {
+ return BugReportMsg;
}
PrettyStackTraceEntry::PrettyStackTraceEntry() {