[Lldb-commits] [lldb] [lldb][Windows] Silence unused variable warning on Windows on Arm (PR #221176)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 4 02:20:56 PDT 2026


https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/221176

<...>/llvm-project/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp(507,8): warning: unused variable 'log' [-Wunused-variable]
  507 |   Log *log = GetLog(WindowsLog::Exception);
      |        ^~~

Move that line into the `#ifndef __aarch64__` block to fix this.

>From 949cafea4784f475250ec30f82e5c8823e3f09b9 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Fri, 4 Sep 2026 09:18:32 +0000
Subject: [PATCH] [lldb][Windows] Silence unused variable warning on Windows on
 Arm

<...>/llvm-project/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp(507,8): warning: unused variable 'log' [-Wunused-variable]
  507 |   Log *log = GetLog(WindowsLog::Exception);
      |        ^~~

Move that line into the `#ifndef __aarch64__` block to fix this.
---
 .../Plugins/Process/Windows/Common/NativeProcessWindows.cpp     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
index fc00e3089e750..bb1feca5eb097 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
@@ -504,9 +504,9 @@ void NativeProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) {
 
 ExceptionResult
 NativeProcessWindows::HandleSingleStepException(const ExceptionRecord &record) {
-  Log *log = GetLog(WindowsLog::Exception);
   uint32_t wp_id = LLDB_INVALID_INDEX32;
 #ifndef __aarch64__
+  Log *log = GetLog(WindowsLog::Exception);
   if (NativeThreadWindows *thread = GetThreadByID(record.GetThreadID())) {
     NativeRegisterContextWindows &reg_ctx = thread->GetRegisterContext();
     Status error =



More information about the lldb-commits mailing list