diff options
author | Zachary Turner <zturner@google.com> | 2019-03-07 21:23:21 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2019-03-07 21:23:21 +0000 |
commit | 29e8754172031ed217d25e3de0bc4047192a3453 (patch) | |
tree | a937f8971212dcbd47fc516d9b3cb4fbf1255b58 /lldb/tools/lldb-vscode/VSCode.h | |
parent | d0c2dba644e27210ed13cd638aa8b8e677ed757d (diff) | |
download | bcm5719-llvm-29e8754172031ed217d25e3de0bc4047192a3453.tar.gz bcm5719-llvm-29e8754172031ed217d25e3de0bc4047192a3453.zip |
[lldb-vscode] Support running in server mode on Windows.
Windows can't use standard i/o system calls such as read and write
to work with sockets, it instead needs to use the specific send
and recv calls. This complicates matters for the debug adapter,
since it needs to be able to work in both server mode where it
communicates over a socket, as well as non-server mode where it
communicates via stdin and stdout. To abstract this out, I've
introduced a class IOStream which hides all these details and
exposes a read/write interface that does the right on each
platform.
Differential Revision: https://reviews.llvm.org/D59104
llvm-svn: 355637
Diffstat (limited to 'lldb/tools/lldb-vscode/VSCode.h')
-rw-r--r-- | lldb/tools/lldb-vscode/VSCode.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/tools/lldb-vscode/VSCode.h b/lldb/tools/lldb-vscode/VSCode.h index 9b041e943ab..bb05e78c3a3 100644 --- a/lldb/tools/lldb-vscode/VSCode.h +++ b/lldb/tools/lldb-vscode/VSCode.h @@ -19,6 +19,7 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/raw_ostream.h" #include "lldb/API/SBAttachInfo.h" #include "lldb/API/SBBreakpoint.h" @@ -43,6 +44,7 @@ #include "ExceptionBreakpoint.h" #include "FunctionBreakpoint.h" +#include "IOStream.h" #include "SourceBreakpoint.h" #include "SourceReference.h" @@ -62,8 +64,8 @@ typedef llvm::StringMap<FunctionBreakpoint> FunctionBreakpointMap; enum class OutputType { Console, Stdout, Stderr, Telemetry }; struct VSCode { - FILE *in; - FILE *out; + InputStream input; + OutputStream output; lldb::SBDebugger debugger; lldb::SBTarget target; lldb::SBAttachInfo attach_info; @@ -94,8 +96,6 @@ struct VSCode { ~VSCode(); VSCode(const VSCode &rhs) = delete; void operator=(const VSCode &rhs) = delete; - void CloseInputStream(); - void CloseOutputStream(); int64_t GetLineForPC(int64_t sourceReference, lldb::addr_t pc) const; ExceptionBreakpoint *GetExceptionBreakpoint(const std::string &filter); ExceptionBreakpoint *GetExceptionBreakpoint(const lldb::break_id_t bp_id); |