[Lldb-commits] [lldb] [LLDB][NVIDIA] Add Disassembler log channel (PR #148290)
Andrew Gontarek via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 11 13:19:34 PDT 2025
https://github.com/agontarek created https://github.com/llvm/llvm-project/pull/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.
>From a5e8c92d9f07f6465ddf1d71ed92b0394f6e4804 Mon Sep 17 00:00:00 2001
From: Andrew Gontarek <agontarek at nvidia.com>
Date: Fri, 11 Jul 2025 13:17:56 -0700
Subject: [PATCH] [LLDB][NVIDIA] Add Disassembler log channel
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.
---
lldb/include/lldb/Utility/LLDBLog.h | 1 +
lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp | 2 +-
lldb/source/Utility/LLDBLog.cpp | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/lldb/include/lldb/Utility/LLDBLog.h b/lldb/include/lldb/Utility/LLDBLog.h
index c7de41e74e85b..03190c27986a0 100644
--- a/lldb/include/lldb/Utility/LLDBLog.h
+++ b/lldb/include/lldb/Utility/LLDBLog.h
@@ -49,6 +49,7 @@ enum class LLDBLog : Log::MaskType {
Watchpoints = Log::ChannelFlag<30>,
OnDemand = Log::ChannelFlag<31>,
Source = Log::ChannelFlag<32>,
+ Disassembler = Log::ChannelFlag<33>,
LLVM_MARK_AS_BITMASK_ENUM(OnDemand),
};
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index ed6047f8f4ef3..c48736ca0dd3b 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::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