[Lldb-commits] [PATCH] D59104: [lldb-vscode] Make server mode work on Windows

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 7 11:29:38 PST 2019


zturner created this revision.
zturner added a reviewer: clayborg.
Herald added a subscriber: mgorny.

For historical reasons, Windows unfortunately doesn't support using sockets in standard system calls like read/write, which means that they also can't be buffered with a `FILE*`.  This violates some fundamental assumptions of how lldb-vscode was written, so fixing it requires some replumbing of the guts.  I introduced an abstraction called `IOStream` which basically knows whether the descriptor is a socket or a non-socket, and then delegates to the appropriate underlying APIs accordingly.  This means calling `read/write` on `stdin/stdout` and calling `recv/send` on sockets.  Luckily this same strategy will also work on non-Windows platforms, so the abstractions needed aren't too egregious.


https://reviews.llvm.org/D59104

Files:
  lldb/tools/lldb-vscode/CMakeLists.txt
  lldb/tools/lldb-vscode/IOStream.cpp
  lldb/tools/lldb-vscode/IOStream.h
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/VSCode.h
  lldb/tools/lldb-vscode/lldb-vscode.cpp
  lldb/tools/lldb-vscode/package.json

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59104.189759.patch
Type: text/x-patch
Size: 14894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190307/272427a1/attachment-0001.bin>


More information about the lldb-commits mailing list