https://github.com/ashgti updated 
https://github.com/llvm/llvm-project/pull/82051

>From 300d2959e510f41607ce2487264a98814d0a1700 Mon Sep 17 00:00:00 2001
From: John Harrison <harj...@google.com>
Date: Fri, 16 Feb 2024 14:11:10 -0800
Subject: [PATCH] [lldb-dap] Do not write over the existing error if
 launchCommands fail during debugger launch.

This fixes an issue where the error is lost if a command while executing 
`launchCommands` when launching the debugger.
---
 lldb/tools/lldb-dap/lldb-dap.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 67022347e6d624..78b0b4078706aa 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -1779,8 +1779,10 @@ lldb::SBError LaunchProcess(const llvm::json::Object 
&request) {
     // Set the launch info so that run commands can access the configured
     // launch details.
     g_dap.target.SetLaunchInfo(launch_info);
-    if (llvm::Error err = g_dap.RunLaunchCommands(launchCommands))
+    if (llvm::Error err = g_dap.RunLaunchCommands(launchCommands)) {
       error.SetErrorString(llvm::toString(std::move(err)).c_str());
+      return error;
+    }
     // The custom commands might have created a new target so we should use the
     // selected target after these commands are run.
     g_dap.target = g_dap.debugger.GetSelectedTarget();

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to