[Lldb-commits] [lldb] [lldb] Include the version in the lldbassert error message (PR #133740)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 31 08:45:32 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Jonas Devlieghere (JDevlieghere)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/133740.diff
3 Files Affected:
- (modified) lldb/source/Core/CMakeLists.txt (+1)
- (modified) lldb/source/Core/Debugger.cpp (+3-2)
- (modified) lldb/source/Utility/LLDBAssert.cpp (+2-2)
``````````diff
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) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/133740
More information about the lldb-commits
mailing list