#if defined(__APPLE__)
#define _DARWIN_UNLIMITED_SELECT
#endif
#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
#include "lldb/Host/Config.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Socket.h"
#include "lldb/Host/SocketAddress.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/SelectHelper.h"
#include "lldb/Utility/Timeout.h"
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <sys/types.h>
#if LLDB_ENABLE_POSIX
#include <termios.h>
#include <unistd.h>
#endif
#include <memory>
#include <sstream>
#include "llvm/Support/Errno.h"
#include "llvm/Support/ErrorHandling.h"
#if defined(__APPLE__)
#include "llvm/ADT/SmallVector.h"
#endif
#include "lldb/Host/Host.h"
#include "lldb/Host/Socket.h"
#include "lldb/Host/common/TCPSocket.h"
#include "lldb/Host/common/UDPSocket.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
usingnamespacelldb;
usingnamespacelldb_private;
ConnectionFileDescriptor::ConnectionFileDescriptor(bool child_processes_inherit)
: … { … }
ConnectionFileDescriptor::ConnectionFileDescriptor(int fd, bool owns_fd)
: … { … }
ConnectionFileDescriptor::ConnectionFileDescriptor(Socket *socket)
: … { … }
ConnectionFileDescriptor::~ConnectionFileDescriptor() { … }
void ConnectionFileDescriptor::OpenCommandPipe() { … }
void ConnectionFileDescriptor::CloseCommandPipe() { … }
bool ConnectionFileDescriptor::IsConnected() const { … }
ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path,
Status *error_ptr) { … }
ConnectionStatus
ConnectionFileDescriptor::Connect(llvm::StringRef path,
socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
bool ConnectionFileDescriptor::InterruptRead() { … }
ConnectionStatus ConnectionFileDescriptor::Disconnect(Status *error_ptr) { … }
size_t ConnectionFileDescriptor::Read(void *dst, size_t dst_len,
const Timeout<std::micro> &timeout,
ConnectionStatus &status,
Status *error_ptr) { … }
size_t ConnectionFileDescriptor::Write(const void *src, size_t src_len,
ConnectionStatus &status,
Status *error_ptr) { … }
std::string ConnectionFileDescriptor::GetURI() { … }
ConnectionStatus
ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
Status *error_ptr) { … }
lldb::ConnectionStatus ConnectionFileDescriptor::AcceptSocket(
Socket::SocketProtocol socket_protocol, llvm::StringRef socket_name,
llvm::function_ref<void(Socket &)> post_listen_callback,
Status *error_ptr) { … }
lldb::ConnectionStatus
ConnectionFileDescriptor::ConnectSocket(Socket::SocketProtocol socket_protocol,
llvm::StringRef socket_name,
Status *error_ptr) { … }
ConnectionStatus ConnectionFileDescriptor::AcceptNamedSocket(
llvm::StringRef socket_name, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus ConnectionFileDescriptor::ConnectNamedSocket(
llvm::StringRef socket_name, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus ConnectionFileDescriptor::AcceptAbstractSocket(
llvm::StringRef socket_name, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
lldb::ConnectionStatus ConnectionFileDescriptor::ConnectAbstractSocket(
llvm::StringRef socket_name, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus
ConnectionFileDescriptor::AcceptTCP(llvm::StringRef socket_name,
socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus
ConnectionFileDescriptor::ConnectTCP(llvm::StringRef socket_name,
socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus
ConnectionFileDescriptor::ConnectUDP(llvm::StringRef s,
socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus
ConnectionFileDescriptor::ConnectFD(llvm::StringRef s,
socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus ConnectionFileDescriptor::ConnectFile(
llvm::StringRef s, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
ConnectionStatus ConnectionFileDescriptor::ConnectSerialPort(
llvm::StringRef s, socket_id_callback_type socket_id_callback,
Status *error_ptr) { … }
bool ConnectionFileDescriptor::GetChildProcessesInherit() const { … }
void ConnectionFileDescriptor::SetChildProcessesInherit(
bool child_processes_inherit) { … }
void ConnectionFileDescriptor::InitializeSocket(Socket *socket) { … }