Skip to content

Commit 300d295

Browse files
committed
[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.
1 parent 2de269a commit 300d295

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,8 +1779,10 @@ lldb::SBError LaunchProcess(const llvm::json::Object &request) {
17791779
// Set the launch info so that run commands can access the configured
17801780
// launch details.
17811781
g_dap.target.SetLaunchInfo(launch_info);
1782-
if (llvm::Error err = g_dap.RunLaunchCommands(launchCommands))
1782+
if (llvm::Error err = g_dap.RunLaunchCommands(launchCommands)) {
17831783
error.SetErrorString(llvm::toString(std::move(err)).c_str());
1784+
return error;
1785+
}
17841786
// The custom commands might have created a new target so we should use the
17851787
// selected target after these commands are run.
17861788
g_dap.target = g_dap.debugger.GetSelectedTarget();

0 commit comments

Comments
 (0)