[Lldb-commits] [lldb] 057de4d - [lldb] Request crash report when prompting for a bug report on Darwin (#91371)
via lldb-commits
lldb-commits at lists.llvm.org
Tue May 7 12:35:10 PDT 2024
Author: Jonas Devlieghere
Date: 2024-05-07T12:35:06-07:00
New Revision: 057de4d26425c8b9840912e40ce025626f45d8d6
URL: https://github.com/llvm/llvm-project/commit/057de4d26425c8b9840912e40ce025626f45d8d6
DIFF: https://github.com/llvm/llvm-project/commit/057de4d26425c8b9840912e40ce025626f45d8d6.diff
LOG: [lldb] Request crash report when prompting for a bug report on Darwin (#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.
Added:
Modified:
lldb/tools/driver/Driver.cpp
lldb/tools/lldb-dap/lldb-dap.cpp
Removed:
################################################################################
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index a821699c5e2ec..14371da64f2f2 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 cf52a22b18cc1..f35abd665e844 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