[Lldb-commits] [lldb] [lldb] Include the version in the lldbassert error message (PR #133740)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 31 08:44:58 PDT 2025
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/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.
>From 851c0cc789441b1967b83e8cdc7d4c2ce5aa7e0d Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Mon, 31 Mar 2025 08:39:40 -0700
Subject: [PATCH] [lldb] Include the version in the lldbassert error message
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.
---
lldb/source/Core/CMakeLists.txt | 1 +
lldb/source/Core/Debugger.cpp | 5 +++--
lldb/source/Utility/LLDBAssert.cpp | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
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