This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Make server mode work on Windows
ClosedPublic

Authored by zturner on Mar 7 2019, 11:27 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.Mar 7 2019, 11:27 AM
clayborg accepted this revision.Mar 7 2019, 11:37 AM
This revision is now accepted and ready to land.Mar 7 2019, 11:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2019, 1:22 PM