llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Andrew Gontarek (agontarek)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/148290.diff


3 Files Affected:

- (modified) lldb/include/lldb/Utility/LLDBLog.h (+1) 
- (modified) lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp 
(+1-1) 
- (modified) lldb/source/Utility/LLDBLog.cpp (+3) 


``````````diff
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,

``````````

</details>


https://github.com/llvm/llvm-project/pull/148290
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to