Skip to content

Commit bbca171

Browse files
committed
[lldb] Include the version in the lldbassert error message (llvm#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 (cherry picked from commit 94b04b4)
1 parent 2590699 commit bbca171

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
@@ -71,6 +71,7 @@ add_lldb_library(lldbCore
7171
lldbTarget
7272
lldbUtility
7373
lldbValueObject
74+
lldbVersion
7475
lldbPluginCPlusPlusLanguage
7576
lldbPluginObjCLanguage
7677
${LLDB_CURSES_LIBS}

lldb/source/Core/Debugger.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,8 +1546,9 @@ bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
15461546
void Debugger::AssertCallback(llvm::StringRef message,
15471547
llvm::StringRef backtrace,
15481548
llvm::StringRef prompt) {
1549-
Debugger::ReportError(
1550-
llvm::formatv("{0}\n{1}{2}", message, backtrace, prompt).str());
1549+
Debugger::ReportError(llvm::formatv("{0}\n{1}{2}\n{3}", message, backtrace,
1550+
GetVersion(), prompt)
1551+
.str());
15511552
}
15521553

15531554
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)