LLDB  mainline
ConnectionGenericFileWindows.h
Go to the documentation of this file.
1 //===-- ConnectionGenericFileWindows.h --------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_Host_windows_ConnectionGenericFileWindows_h_
10 #define liblldb_Host_windows_ConnectionGenericFileWindows_h_
11 
14 #include "lldb/lldb-types.h"
15 
16 namespace lldb_private {
17 
18 class Status;
19 
21 public:
23 
24  ConnectionGenericFile(lldb::file_t file, bool owns_file);
25 
26  ~ConnectionGenericFile() override;
27 
28  bool IsConnected() const override;
29 
30  lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override;
31 
32  lldb::ConnectionStatus Disconnect(Status *error_ptr) override;
33 
34  size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout,
35  lldb::ConnectionStatus &status, Status *error_ptr) override;
36 
37  size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status,
38  Status *error_ptr) override;
39 
40  std::string GetURI() override;
41 
42  bool InterruptRead() override;
43 
44 protected:
45  OVERLAPPED m_overlapped;
46  HANDLE m_file;
47  HANDLE m_event_handles[2];
49  LARGE_INTEGER m_file_position;
50 
52 
53 private:
55  void IncrementFilePointer(DWORD amount);
56 
58 
60  const ConnectionGenericFile &
61  operator=(const ConnectionGenericFile &) = delete;
62 };
63 }
64 
65 #endif
lldb_private::Connection
Definition: Connection.h:41
lldb_private::ConnectionGenericFile::kInterruptEvent
@ kInterruptEvent
Definition: ConnectionGenericFileWindows.h:51
lldb_private::ConnectionGenericFile::Disconnect
lldb::ConnectionStatus Disconnect(Status *error_ptr) override
Disconnect the communications connection if one is currently connected.
Definition: ConnectionGenericFileWindows.cpp:134
lldb_private::ConnectionGenericFile::m_event_handles
HANDLE m_event_handles[2]
Definition: ConnectionGenericFileWindows.h:47
lldb_private::ConnectionGenericFile::GetURI
std::string GetURI() override
Returns a URI that describes this connection object.
Definition: ConnectionGenericFileWindows.cpp:305
lldb_private::ConnectionGenericFile::m_file_position
LARGE_INTEGER m_file_position
Definition: ConnectionGenericFileWindows.h:49
lldb_private::ConnectionGenericFile::m_file
HANDLE m_file
Definition: ConnectionGenericFileWindows.h:46
lldb::file_t
int file_t
Definition: lldb-types.h:59
lldb_private::ConnectionGenericFile::ConnectionGenericFile
ConnectionGenericFile()
Definition: ConnectionGenericFileWindows.cpp:52
lldb_private::ConnectionGenericFile::operator=
const ConnectionGenericFile & operator=(const ConnectionGenericFile &)=delete
lldb_private::ConnectionGenericFile::IsConnected
bool IsConnected() const override
Check if the connection is valid.
Definition: ConnectionGenericFileWindows.cpp:87
lldb_private::ConnectionGenericFile::IncrementFilePointer
void IncrementFilePointer(DWORD amount)
Definition: ConnectionGenericFileWindows.cpp:311
lldb_private::ConnectionGenericFile::Read
size_t Read(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr) override
The read function that attempts to read from the connection.
Definition: ConnectionGenericFileWindows.cpp:162
lldb::ConnectionStatus
ConnectionStatus
Connection Status Types.
Definition: lldb-enumerations.h:295
lldb_private::ConnectionGenericFile::kBytesAvailableEvent
@ kBytesAvailableEvent
Definition: ConnectionGenericFileWindows.h:51
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ConnectionGenericFile::m_owns_file
bool m_owns_file
Definition: ConnectionGenericFileWindows.h:48
lldb_private::ConnectionGenericFile::m_uri
std::string m_uri
Definition: ConnectionGenericFileWindows.h:57
lldb_private::ConnectionGenericFile::Connect
lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override
Connect using the connect string url.
Definition: ConnectionGenericFileWindows.cpp:91
Connection.h
lldb_private::ConnectionGenericFile::InterruptRead
bool InterruptRead() override
Interrupts an ongoing Read() operation.
Definition: ConnectionGenericFileWindows.cpp:307
lldb-types.h
lldb_private::Status
Definition: Status.h:44
lldb_private::Timeout< std::micro >
lldb_private::ConnectionGenericFile::Write
size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr) override
The actual write function that attempts to write to the communications protocol.
Definition: ConnectionGenericFileWindows.cpp:257
windows.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ConnectionGenericFile::m_overlapped
OVERLAPPED m_overlapped
Definition: ConnectionGenericFileWindows.h:45
lldb_private::ConnectionGenericFile::InitializeEventHandles
void InitializeEventHandles()
Definition: ConnectionGenericFileWindows.cpp:74
lldb_private::LineStatus::Status
@ Status
lldb_private::ConnectionGenericFile::~ConnectionGenericFile
~ConnectionGenericFile() override
Definition: ConnectionGenericFileWindows.cpp:66
lldb_private::ConnectionGenericFile
Definition: ConnectionGenericFileWindows.h:20