[Lldb-commits] [PATCH] D93951: [vscode] Improve runInTerminal and support linux

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 8 21:51:11 PST 2021


clayborg added a comment.

Can we still try to use just one file? Isn't this file both read and write? The flow would be:

- create 1 file using mkfifo(...) and pass it down as argument
- launcher lldb-vscode will write pid or error JSON back into the stream, and will start to wait for some data from the same fifo file
- normal lldb-vscode will write some JSON to fifo file to indicate it has attached after it has attached
- launcher lldb-vscode reads that it attached and then does the exec

It would really simplify everything if we can use just one file



================
Comment at: lldb/tools/lldb-vscode/RunInTerminal.cpp:93
+static std::string CreateToAdaptorFilePath(StringRef comm_dir) {
+  return comm_dir.str() + "/to_adaptor";
+}
----------------
Need to use the llvm file system appending stuff so this will work on windows.

```
  llvm::SmallString<64> current_path = comm_dir.str(); // this might not compile, but you get the idea...
  style = ...; // Set this correctly with #ifdef for windows
  llvm::sys::path::append(comm_dir, style, "to_adaptor");
```


================
Comment at: lldb/tools/lldb-vscode/RunInTerminal.cpp:97
+static std::string CreateDidAttachFilePath(StringRef comm_dir) {
+  return comm_dir.str() + "/did_attach";
+}
----------------
ditto


================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:459
             module_event.try_emplace("body", std::move(body));
-            g_vsc.SendJSON(llvm::json::Value(std::move(module_event)));
+            // g_vsc.SendJSON(llvm::json::Value(std::move(module_event)));
           }
----------------
Is this intentional??


================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:1482
+
+  g_vsc.debugger.SetAsync(true);
+
----------------
Do we want to set async to true prior to doing the continue?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93951/new/

https://reviews.llvm.org/D93951



More information about the lldb-commits mailing list