[Lldb-commits] [lldb] 9e90788 - [LLDB][NVIDIA] Add Disassembler log channel (#148290)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 11 13:49:38 PDT 2025
Author: Andrew Gontarek
Date: 2025-07-11T13:49:34-07:00
New Revision: 9e90788a3ea776f6ba8baa2de30fb8845ac1916f
URL: https://github.com/llvm/llvm-project/commit/9e90788a3ea776f6ba8baa2de30fb8845ac1916f
DIFF: https://github.com/llvm/llvm-project/commit/9e90788a3ea776f6ba8baa2de30fb8845ac1916f.diff
LOG: [LLDB][NVIDIA] Add Disassembler log channel (#148290)
This commit introduces a new log channel for the disassembler in LLDB,
allowing for better logging of disassembler related activities. The
`LLDBLOG` enum has been updated to include the `Disassembler` channel,
and the relevant logging in the `DisassemblerLLVMC` plugin has been
modified to utilize this new channel. This is in preparation for adding
additional disassembler implementations.
Key Changes:
- Added `Disassembler` to the `LLDBLog` enum.
- Updated logging in `DisassemblerLLVMC.cpp` to use the new
`Disassembler` log channel.
Added:
Modified:
lldb/include/lldb/Utility/LLDBLog.h
lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
lldb/source/Utility/LLDBLog.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Utility/LLDBLog.h b/lldb/include/lldb/Utility/LLDBLog.h
index c7de41e74e85b..18e4a3ca73507 100644
--- a/lldb/include/lldb/Utility/LLDBLog.h
+++ b/lldb/include/lldb/Utility/LLDBLog.h
@@ -49,7 +49,8 @@ enum class LLDBLog : Log::MaskType {
Watchpoints = Log::ChannelFlag<30>,
OnDemand = Log::ChannelFlag<31>,
Source = Log::ChannelFlag<32>,
- LLVM_MARK_AS_BITMASK_ENUM(OnDemand),
+ Disassembler = Log::ChannelFlag<33>,
+ LLVM_MARK_AS_BITMASK_ENUM(Disassembler),
};
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index ed6047f8f4ef3..644084ba8d57a 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -1146,7 +1146,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
}
}
- if (Log *log = GetLog(LLDBLog::Process)) {
+ if (Log *log = GetLog(LLDBLog::Process | LLDBLog::Disassembler)) {
StreamString ss;
ss.Printf("[%s] expands to %zu operands:\n", operands_string,
diff --git a/lldb/source/Utility/LLDBLog.cpp b/lldb/source/Utility/LLDBLog.cpp
index b193bd4eb07dc..613dae42064a8 100644
--- a/lldb/source/Utility/LLDBLog.cpp
+++ b/lldb/source/Utility/LLDBLog.cpp
@@ -64,6 +64,9 @@ static constexpr Log::Category g_categories[] = {
{"log symbol on-demand related activities"},
LLDBLog::OnDemand},
{{"source"}, {"log source related activities"}, LLDBLog::Source},
+ {{"disassembler"},
+ {"log disassembler related activities"},
+ LLDBLog::Disassembler},
};
static Log::Channel g_log_channel(g_categories,
More information about the lldb-commits
mailing list