Skip to content

Commit 94b04b4

Browse files
authored
[lldb] Include the version in the lldbassert error message (#133740)
Include the LLDB version in the lldbassert error message, and prompt users to include it in the bug report. The majority of users that bother filing a bug report just copy past the stack trace and often forget to include this important detail. By putting it after the backtrace and before the prompt, I'm hoping it'll get copy-pasted in. rdar://146793016
1 parent 66b0b04 commit 94b04b4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lldb/source/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ add_lldb_library(lldbCore
7070
lldbTarget
7171
lldbUtility
7272
lldbValueObject
73+
lldbVersion
7374
lldbPluginCPlusPlusLanguage
7475
lldbPluginObjCLanguage
7576
${LLDB_CURSES_LIBS}

lldb/source/Core/Debugger.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,8 +1525,9 @@ bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
15251525
void Debugger::AssertCallback(llvm::StringRef message,
15261526
llvm::StringRef backtrace,
15271527
llvm::StringRef prompt) {
1528-
Debugger::ReportError(
1529-
llvm::formatv("{0}\n{1}{2}", message, backtrace, prompt).str());
1528+
Debugger::ReportError(llvm::formatv("{0}\n{1}{2}\n{3}", message, backtrace,
1529+
GetVersion(), prompt)
1530+
.str());
15301531
}
15311532

15321533
void Debugger::SetLoggingCallback(lldb::LogOutputCallback log_callback,

lldb/source/Utility/LLDBAssert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void _lldb_assert(bool expression, const char *expr_text, const char *func,
5454
expr_text, func, file, line)
5555
.str(),
5656
buffer,
57-
"Please file a bug report against lldb reporting this failure log, and "
58-
"as many details as possible");
57+
"Please file a bug report against lldb and include the backtrace, the "
58+
"version and as many details as possible.");
5959
}
6060

6161
void SetLLDBAssertCallback(LLDBAssertCallback callback) {

0 commit comments

Comments
 (0)