-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb-dap] Do not write over the existing error if launchCommands fail during debugger launch. #82051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-lldb Author: John Harrison (ashgti) ChangesThis fixes an issue where the error is lost if a command while executing This should fix #82048 Full diff: https://github.com/llvm/llvm-project/pull/82051.diff 1 Files Affected:
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 67022347e6d624..cc555d33b48b53 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -22,7 +22,7 @@
// We also need to #undef GetObject (which is defined to GetObjectW) because
// the JSON code we use also has methods named `GetObject()` and we conflict
// against these.
-#define NOMINMAX
+#define NOMINMAXf
#include <windows.h>
#undef GetObject
#include <io.h>
@@ -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();
|
5e3787a
to
300d295
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a test and this will be good to go.
300d295
to
f76dbe1
Compare
✅ With the latest revision this PR passed the Python code formatter. |
f76dbe1
to
465abea
Compare
…l during debugger launch. This fixes an issue where the error is lost if a command while executing `launchCommands` when launching the debugger.
465abea
to
61224ee
Compare
Done, added tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Always good to have a test.
…l during debugger launch. (llvm#82051) This fixes an issue where the error is lost if a command while executing `launchCommands` when launching the debugger. This should fix llvm#82048
This fixes an issue where the error is lost if a command while executing
launchCommands
when launching the debugger.This should fix #82048