Skip to content

Commit 057de4d

Browse files
authored
[lldb] Request crash report when prompting for a bug report on Darwin (llvm#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.
1 parent c9ab1d8 commit 057de4d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lldb/tools/driver/Driver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,14 @@ int main(int argc, char const *argv[]) {
733733
// Setup LLVM signal handlers and make sure we call llvm_shutdown() on
734734
// destruction.
735735
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
736+
#if !defined(__APPLE__)
736737
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
737738
" and include the crash backtrace.\n");
739+
#else
740+
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
741+
" and include the crash report from "
742+
"~/Library/Logs/DiagnosticReports/.\n");
743+
#endif
738744

739745
// Parse arguments.
740746
LLDBOptTable T;

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,8 +4192,14 @@ int SetupStdoutStderrRedirection() {
41924192

41934193
int main(int argc, char *argv[]) {
41944194
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
4195+
#if !defined(__APPLE__)
41954196
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
41964197
" and include the crash backtrace.\n");
4198+
#else
4199+
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
4200+
" and include the crash report from "
4201+
"~/Library/Logs/DiagnosticReports/.\n");
4202+
#endif
41974203

41984204
llvm::SmallString<256> program_path(argv[0]);
41994205
llvm::sys::fs::make_absolute(program_path);

0 commit comments

Comments
 (0)