|
LLDB mainline
|
A read only Connection implementation for the Windows ConPTY. More...
#include <ConnectionConPTYWindows.h>
Public Member Functions | |
| ConnectionConPTY (std::shared_ptr< PseudoConsole > pty) | |
| ~ConnectionConPTY () | |
| 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 |
| Read from the ConPTY's pipe. | |
| 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. | |
| Public Member Functions inherited from lldb_private::ConnectionGenericFile | |
| 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::IOObjectSP | GetReadObject () |
| Returns the underlying IOObject used by the Connection. | |
Protected Attributes | |
| std::shared_ptr< PseudoConsole > | m_pty |
| bool | m_pty_vt_sequence_was_stripped = false |
| Protected Attributes inherited from lldb_private::ConnectionGenericFile | |
| OVERLAPPED | m_overlapped |
| bool | m_read_pending = false |
| HANDLE | m_file |
| HANDLE | m_event_handles [2] |
| bool | m_owns_file |
| LARGE_INTEGER | m_file_position |
Additional Inherited Members | |
| Protected Types inherited from lldb_private::ConnectionGenericFile | |
| enum | { kBytesAvailableEvent , kInterruptEvent } |
A read only Connection implementation for the Windows ConPTY.
Definition at line 22 of file ConnectionConPTYWindows.h.
| ConnectionConPTY::ConnectionConPTY | ( | std::shared_ptr< PseudoConsole > | pty | ) |
Definition at line 46 of file ConnectionConPTYWindows.cpp.
References lldb_private::ConnectionGenericFile::ConnectionGenericFile(), and m_pty.
| ConnectionConPTY::~ConnectionConPTY | ( | ) |
Definition at line 49 of file ConnectionConPTYWindows.cpp.
|
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 51 of file ConnectionConPTYWindows.cpp.
References lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, and m_pty.
|
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 58 of file ConnectionConPTYWindows.cpp.
References lldb::eConnectionStatusSuccess, and m_pty.
|
overridevirtual |
Read from the ConPTY's pipe.
Before reading, check if the ConPTY is closing and wait for it to close before reading. This prevents race conditions when closing the ConPTY during a read. After reading, remove the ConPTY VT init sequence if present.
Implements lldb_private::Connection.
Definition at line 63 of file ConnectionConPTYWindows.cpp.
References m_pty, m_pty_vt_sequence_was_stripped, lldb_private::ConnectionGenericFile::Read(), and StripConPTYInitSequences().
|
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 83 of file ConnectionConPTYWindows.cpp.
|
protected |
Definition at line 45 of file ConnectionConPTYWindows.h.
Referenced by Connect(), ConnectionConPTY(), Disconnect(), and Read().
|
protected |
Definition at line 46 of file ConnectionConPTYWindows.h.
Referenced by Read().