[Lldb-commits] [PATCH] D50365: Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 16 10:36:45 PDT 2018


zturner added inline comments.


================
Comment at: tools/lldb-vscode/lldb-vscode.cpp:2646
+        g_vsc.out = fdopen(socket_fd, "w");
+        if (g_vsc.in == nullptr || g_vsc.out == nullptr) {
+          if (g_vsc.log)
----------------
clayborg wrote:
> The mutex isn't the problem, it is being able to read and write from the in and out streams. So adding a mutex to VSCode won't help. We have very simple interactions with in and out where we read lines and read a specific amount of data, and we just write data out.
So if all you've got is a a single integer fd, you can't do both a read and write on the same fd (even from the same thread)?  Isn't a `FILE*` just a wrapper around the fd anyway?

Regardless, I guess my suggestion for the llvm streams won't work after all since LLVM doesn't have a good abstraction for a true input stream (like a socket).  Maybe one of these days I should add one.


https://reviews.llvm.org/D50365





More information about the lldb-commits mailing list