[Lldb-commits] [lldb] [lldb-dap] Report any errors during attach request (PR #165270)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 27 09:06:41 PDT 2025


https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/165270

Attaching using `core`, `gdbremote` or `attachInfo` may have an error. fail early if it does. 

>From d31dae6d626dd2c17dcfd5c00e3d909fa925cbf1 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Sun, 26 Oct 2025 21:13:13 +0000
Subject: [PATCH] [lldb-dap] Report any errors during attach request

---
 lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
index 371349a26866e..490513fe8a0b8 100644
--- a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
@@ -124,6 +124,8 @@ Error AttachRequestHandler::Run(const AttachRequestArguments &args) const {
       attach_info.SetWaitForLaunch(args.waitFor, /*async=*/false);
       dap.target.Attach(attach_info, error);
     }
+    if (error.Fail())
+      return ToError(error);
   }
 
   // Make sure the process is attached and stopped.



More information about the lldb-commits mailing list