[Lldb-commits] [lldb] [lldb] Request crash report when prompting for a bug report on Darwin (PR #91371)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue May 7 11:18:25 PDT 2024
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/91371
On Darwin platforms, the system will generate a crash report in ~/Library/Logs/DiagnosticReports/ when a process crashes.
These reports are much more useful than the "pretty backtraces" printed by LLVM and are preferred when filing bug reports on Darwin.
>From 5821138c31b91b4e1df5757db23f571292f925a0 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Tue, 7 May 2024 11:15:22 -0700
Subject: [PATCH] [lldb] Request crash report when prompting for a bug report
on Darwin
On Darwin platforms, the system will generate a crash report in
~/Library/Logs/DiagnosticReports/ when a process crashes.
These reports are much more useful than the "pretty backtraces" printed
by LLVM and are preferred when filing bug reports on Darwin.
---
lldb/tools/driver/Driver.cpp | 6 ++++++
lldb/tools/lldb-dap/lldb-dap.cpp | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index a821699c5e2ec2..14371da64f2f2f 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -733,8 +733,14 @@ int main(int argc, char const *argv[]) {
// Setup LLVM signal handlers and make sure we call llvm_shutdown() on
// destruction.
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
+#if !defined(__APPLE__)
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
" and include the crash backtrace.\n");
+#else
+ llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
+ " and include the crash report from "
+ "~/Library/Logs/DiagnosticReports/.\n");
+#endif
// Parse arguments.
LLDBOptTable T;
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index cf52a22b18cc14..f35abd665e8449 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -4192,8 +4192,14 @@ int SetupStdoutStderrRedirection() {
int main(int argc, char *argv[]) {
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
+#if !defined(__APPLE__)
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
" and include the crash backtrace.\n");
+#else
+ llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
+ " and include the crash report from "
+ "~/Library/Logs/DiagnosticReports/.\n");
+#endif
llvm::SmallString<256> program_path(argv[0]);
llvm::sys::fs::make_absolute(program_path);
More information about the lldb-commits
mailing list