[Lldb-commits] [lldb] 94b04b4 - [lldb] Include the version in the lldbassert error message (#133740)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 31 09:40:36 PDT 2025
Author: Jonas Devlieghere
Date: 2025-03-31T09:40:33-07:00
New Revision: 94b04b411903e97bd228c6bdbdb845c29f6de6a1
URL: https://github.com/llvm/llvm-project/commit/94b04b411903e97bd228c6bdbdb845c29f6de6a1
DIFF: https://github.com/llvm/llvm-project/commit/94b04b411903e97bd228c6bdbdb845c29f6de6a1.diff
LOG: [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
Added:
Modified:
lldb/source/Core/CMakeLists.txt
lldb/source/Core/Debugger.cpp
lldb/source/Utility/LLDBAssert.cpp
Removed:
################################################################################
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index e8bdb0613b3ff..0a08da0fec230 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -70,6 +70,7 @@ add_lldb_library(lldbCore
lldbTarget
lldbUtility
lldbValueObject
+ lldbVersion
lldbPluginCPlusPlusLanguage
lldbPluginObjCLanguage
${LLDB_CURSES_LIBS}
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index ec7f841320217..51029f91eb12d 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -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,
diff --git a/lldb/source/Utility/LLDBAssert.cpp b/lldb/source/Utility/LLDBAssert.cpp
index d7adb52f95fa4..b84c581ccf822 100644
--- a/lldb/source/Utility/LLDBAssert.cpp
+++ b/lldb/source/Utility/LLDBAssert.cpp
@@ -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) {
More information about the lldb-commits
mailing list