1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

Tools emit the bug report URL on crash

When Clang crashes a useful message is output:

"PLEASE submit a bug report to https://bugs.llvm.org/ and include the
crash backtrace, preprocessed source, and associated run script."

A similar message is now output for all tools.

Differential Revision: https://reviews.llvm.org/D74324
This commit is contained in:
gbreynoo 2020-03-26 10:26:59 +00:00
parent 4130033848
commit b1f1108ed2
2 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,10 @@ namespace llvm {
/// \see PrettyStackTraceEntry /// \see PrettyStackTraceEntry
void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true); void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
/// Replaces the generic bug report message that is output upon
/// a crash.
void setBugReportMsg(const char *Msg);
/// PrettyStackTraceEntry - This class is used to represent a frame of the /// PrettyStackTraceEntry - This class is used to represent a frame of the
/// "pretty" stack trace that is dumped when a program crashes. You can define /// "pretty" stack trace that is dumped when a program crashes. You can define
/// subclasses of this and declare them on the program stack: when they are /// subclasses of this and declare them on the program stack: when they are

View File

@ -142,9 +142,17 @@ using CrashHandlerStringStorage =
static CrashHandlerStringStorage crashHandlerStringStorage; static CrashHandlerStringStorage crashHandlerStringStorage;
#endif #endif
static const char *BugReportMsg =
"PLEASE submit a bug report to " BUG_REPORT_URL
" and include the crash backtrace.\n";
void llvm::setBugReportMsg(const char *Msg) { BugReportMsg = Msg; }
/// This callback is run if a fatal signal is delivered to the process, it /// This callback is run if a fatal signal is delivered to the process, it
/// prints the pretty stack trace. /// prints the pretty stack trace.
static void CrashHandler(void *) { static void CrashHandler(void *) {
errs() << BugReportMsg ;
#ifndef __APPLE__ #ifndef __APPLE__
// On non-apple systems, just emit the crash stack trace to stderr. // On non-apple systems, just emit the crash stack trace to stderr.
PrintCurStackTrace(errs()); PrintCurStackTrace(errs());