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

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 27 09:07:16 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

<details>
<summary>Changes</summary>

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

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


1 Files Affected:

- (modified) lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp (+2) 


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

``````````

</details>


https://github.com/llvm/llvm-project/pull/165270


More information about the lldb-commits mailing list