[Lldb-commits] [PATCH] D59340: [lldb-vscode] Don't try to launch an invalid program.

Jorge Gorbe Moya via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 13 16:21:43 PDT 2019


jgorbe created this revision.
jgorbe added a reviewer: zturner.
Herald added a project: LLDB.

If an invalid program is specified, lldb-vscode will send back a
response with `"success": false`, but then will continue executing the
rest of `request_launch()`, try to launch the program anyway and try to
send another response (possibly using the `response` object after it was
moved).

This change adds a return statement so we stop executing the handler
after producing the first failing response.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D59340

Files:
  lldb/tools/lldb-vscode/lldb-vscode.cpp


Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1245,6 +1245,7 @@
           response, "message",
           llvm::formatv("Could not load program '{0}'.", program).str());
       g_vsc.SendJSON(llvm::json::Value(std::move(response)));
+      return;
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59340.190535.patch
Type: text/x-patch
Size: 421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190313/decbd945/attachment-0001.bin>


More information about the lldb-commits mailing list