[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
This commit is contained in:
Jonas Devlieghere
2025-03-31 09:40:33 -07:00
committed by GitHub
parent 66b0b0466b
commit 94b04b4119
3 changed files with 6 additions and 4 deletions

View File

@@ -70,6 +70,7 @@ add_lldb_library(lldbCore
lldbTarget
lldbUtility
lldbValueObject
lldbVersion
lldbPluginCPlusPlusLanguage
lldbPluginObjCLanguage
${LLDB_CURSES_LIBS}

View File

@@ -1525,8 +1525,9 @@ bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
void Debugger::AssertCallback(llvm::StringRef message,
llvm::StringRef backtrace,
llvm::StringRef prompt) {
Debugger::ReportError(
llvm::formatv("{0}\n{1}{2}", message, backtrace, prompt).str());
Debugger::ReportError(llvm::formatv("{0}\n{1}{2}\n{3}", message, backtrace,
GetVersion(), prompt)
.str());
}
void Debugger::SetLoggingCallback(lldb::LogOutputCallback log_callback,

View File

@@ -54,8 +54,8 @@ void _lldb_assert(bool expression, const char *expr_text, const char *func,
expr_text, func, file, line)
.str(),
buffer,
"Please file a bug report against lldb reporting this failure log, and "
"as many details as possible");
"Please file a bug report against lldb and include the backtrace, the "
"version and as many details as possible.");
}
void SetLLDBAssertCallback(LLDBAssertCallback callback) {