LLDB mainline
|
#include <ConnectionGenericFileWindows.h>
Public Member Functions | |
ConnectionGenericFile () | |
ConnectionGenericFile (lldb::file_t file, bool owns_file) | |
~ConnectionGenericFile () override | |
bool | IsConnected () const override |
Check if the connection is valid. | |
lldb::ConnectionStatus | Connect (llvm::StringRef s, Status *error_ptr) override |
Connect using the connect string url. | |
lldb::ConnectionStatus | Disconnect (Status *error_ptr) override |
Disconnect the communications connection if one is currently connected. | |
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. | |
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. | |
std::string | GetURI () override |
Returns a URI that describes this connection object. | |
bool | InterruptRead () override |
Interrupts an ongoing Read() operation. | |
Public Member Functions inherited from lldb_private::Connection | |
Connection ()=default | |
Default constructor. | |
virtual | ~Connection () |
Virtual destructor since this class gets subclassed and handed to a Communication object. | |
virtual lldb::ConnectionStatus | Connect (llvm::StringRef url, Status *error_ptr)=0 |
Connect using the connect string url. | |
virtual lldb::ConnectionStatus | Disconnect (Status *error_ptr)=0 |
Disconnect the communications connection if one is currently connected. | |
virtual bool | IsConnected () const =0 |
Check if the connection is valid. | |
virtual size_t | Read (void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)=0 |
The read function that attempts to read from the connection. | |
virtual size_t | Write (const void *dst, size_t dst_len, lldb::ConnectionStatus &status, Status *error_ptr)=0 |
The actual write function that attempts to write to the communications protocol. | |
virtual std::string | GetURI ()=0 |
Returns a URI that describes this connection object. | |
virtual bool | InterruptRead ()=0 |
Interrupts an ongoing Read() operation. | |
virtual lldb::IOObjectSP | GetReadObject () |
Returns the underlying IOObject used by the Connection. | |
Protected Types | |
enum | { kBytesAvailableEvent , kInterruptEvent } |
Protected Attributes | |
OVERLAPPED | m_overlapped |
HANDLE | m_file |
HANDLE | m_event_handles [2] |
bool | m_owns_file |
LARGE_INTEGER | m_file_position |
Private Member Functions | |
void | InitializeEventHandles () |
void | IncrementFilePointer (DWORD amount) |
ConnectionGenericFile (const ConnectionGenericFile &)=delete | |
const ConnectionGenericFile & | operator= (const ConnectionGenericFile &)=delete |
Private Attributes | |
std::string | m_uri |
Definition at line 20 of file ConnectionGenericFileWindows.h.
|
protected |
Enumerator | |
---|---|
kBytesAvailableEvent | |
kInterruptEvent |
Definition at line 51 of file ConnectionGenericFileWindows.h.
ConnectionGenericFile::ConnectionGenericFile | ( | ) |
Definition at line 53 of file ConnectionGenericFileWindows.cpp.
References InitializeEventHandles(), m_file_position, and m_overlapped.
ConnectionGenericFile::ConnectionGenericFile | ( | lldb::file_t | file, |
bool | owns_file | ||
) |
Definition at line 60 of file ConnectionGenericFileWindows.cpp.
References InitializeEventHandles(), m_file_position, and m_overlapped.
|
override |
Definition at line 67 of file ConnectionGenericFileWindows.cpp.
References IsConnected(), kBytesAvailableEvent, kInterruptEvent, m_event_handles, m_file, and m_owns_file.
|
privatedelete |
|
overridevirtual |
Connect using the connect string url.
[in] | url | A string that contains all information needed by the subclass to connect to another client. |
[out] | error_ptr | A pointer to an error object that should be given an appropriate error value if this method returns false. This value can be NULL if the error value should be ignored. |
Implements lldb_private::Connection.
Definition at line 92 of file ConnectionGenericFileWindows.cpp.
References lldb_private::Connection, Disconnect(), lldb::eConnectionStatusError, lldb::eConnectionStatusSuccess, lldb::eErrorTypeGeneric, lldb::eErrorTypeWin32, lldb_private::GetLog(), IsConnected(), LLDB_LOGF, m_file, m_owns_file, m_uri, lldb_private::Status::SetError(), and lldb_private::Status::SetErrorStringWithFormat().
|
overridevirtual |
Disconnect the communications connection if one is currently connected.
[out] | error_ptr | A pointer to an error object that should be given an appropriate error value if this method returns false. This value can be NULL if the error value should be ignored. |
Implements lldb_private::Connection.
Definition at line 135 of file ConnectionGenericFileWindows.cpp.
References lldb_private::Connection, lldb::eConnectionStatusSuccess, lldb_private::GetLog(), IsConnected(), LLDB_LOGF, m_file, m_file_position, m_overlapped, m_owns_file, and m_uri.
Referenced by Connect().
|
overridevirtual |
Returns a URI that describes this connection object.
Subclasses may override this function.
Implements lldb_private::Connection.
Definition at line 305 of file ConnectionGenericFileWindows.cpp.
References m_uri.
|
private |
Definition at line 311 of file ConnectionGenericFileWindows.cpp.
References m_overlapped.
|
private |
Definition at line 75 of file ConnectionGenericFileWindows.cpp.
References kBytesAvailableEvent, kInterruptEvent, and m_event_handles.
Referenced by ConnectionGenericFile().
|
overridevirtual |
Interrupts an ongoing Read() operation.
If there is an ongoing read operation in another thread, this operation return with status == eConnectionStatusInterrupted. Note that if there data waiting to be read and an interrupt request is issued, the Read() function will return the data immediately without processing the interrupt request (which will remain queued for the next Read() operation).
Implements lldb_private::Connection.
Definition at line 307 of file ConnectionGenericFileWindows.cpp.
References kInterruptEvent, and m_event_handles.
|
overridevirtual |
Check if the connection is valid.
Implements lldb_private::Connection.
Definition at line 88 of file ConnectionGenericFileWindows.cpp.
References m_file.
Referenced by Connect(), Disconnect(), Read(), Write(), and ~ConnectionGenericFile().
|
privatedelete |
|
overridevirtual |
The read function that attempts to read from the connection.
[in] | dst | A destination buffer that must be at least dst_len bytes long. |
[in] | dst_len | The number of bytes to attempt to read, and also the max number of bytes that can be placed into dst. |
[in] | timeout | The number of microseconds to wait for the data. |
[out] | status | On return, indicates whether the call was successful or terminated due to some error condition. |
[out] | error_ptr | A pointer to an error object that should be given an appropriate error value if this method returns zero. This value can be NULL if the error value should be ignored. |
Implements lldb_private::Connection.
Definition at line 163 of file ConnectionGenericFileWindows.cpp.
References lldb_private::Status::Clear(), lldb_private::Connection, lldb::eConnectionStatusEndOfFile, lldb::eConnectionStatusError, lldb::eConnectionStatusInterrupted, lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, lldb::eConnectionStatusTimedOut, lldb_private::GetLog(), IncrementFilePointer(), IsConnected(), kBytesAvailableEvent, kInterruptEvent, LLDB_LOGF, m_event_handles, m_file, and m_overlapped.
|
overridevirtual |
The actual write function that attempts to write to the communications protocol.
Subclasses must override this function.
[in] | dst | A destination buffer that must be at least dst_len bytes long. |
[in] | dst_len | The number of bytes to attempt to write, and also the number of bytes are currently available in dst. |
[out] | error_ptr | A pointer to an error object that should be given an appropriate error value if this method returns zero. This value can be NULL if the error value should be ignored. |
Implements lldb_private::Connection.
Definition at line 257 of file ConnectionGenericFileWindows.cpp.
References lldb_private::Status::Clear(), lldb_private::Connection, lldb::eConnectionStatusError, lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, lldb_private::Status::GetError(), lldb_private::GetLog(), IncrementFilePointer(), IsConnected(), LLDB_LOGF, m_file, and m_overlapped.
|
protected |
Definition at line 47 of file ConnectionGenericFileWindows.h.
Referenced by InitializeEventHandles(), InterruptRead(), Read(), and ~ConnectionGenericFile().
|
protected |
Definition at line 46 of file ConnectionGenericFileWindows.h.
Referenced by Connect(), Disconnect(), IsConnected(), Read(), Write(), and ~ConnectionGenericFile().
|
protected |
Definition at line 49 of file ConnectionGenericFileWindows.h.
Referenced by ConnectionGenericFile(), and Disconnect().
|
protected |
Definition at line 45 of file ConnectionGenericFileWindows.h.
Referenced by ConnectionGenericFile(), Disconnect(), IncrementFilePointer(), Read(), and Write().
|
protected |
Definition at line 48 of file ConnectionGenericFileWindows.h.
Referenced by Connect(), Disconnect(), and ~ConnectionGenericFile().
|
private |
Definition at line 57 of file ConnectionGenericFileWindows.h.
Referenced by Connect(), Disconnect(), and GetURI().