[Lldb-commits] [lldb] [lldb-dap] Do not write over the existing error if launchCommands fail during debugger launch. (PR #82051)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 16 14:15:51 PST 2024
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 <harjohn at 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();
More information about the lldb-commits
mailing list