LLDB mainline
lldb::SBProtocolServer Class Reference

A server that speaks a debugging protocol. More...

#include <SBProtocolServer.h>

Public Member Functions

 SBProtocolServer ()
 SBProtocolServer (const SBProtocolServer &rhs)
SBProtocolServeroperator= (const SBProtocolServer &rhs)
 ~SBProtocolServer ()
 operator bool () const
bool IsValid () const
lldb::SBError Start (const char *connection_uri)
 Starts listening for clients on connection_uri, which must be an accepting URI such as "listen://[host]:port" or "accept:///path".
lldb::SBError Stop ()
const char * GetConnectionURI ()
 Returns the URI clients can connect to, valid after a successful Start, or nullptr if the server is not listening.

Static Public Member Functions

static SBProtocolServer Create (const char *protocol, lldb::SBError &error)
 Returns the protocol server for protocol, creating it if this process does not already have one.

Private Attributes

std::unique_ptr< lldb_private::SBProtocolServerImplm_opaque_up

Detailed Description

A server that speaks a debugging protocol.

Protocol servers are shared across debuggers. Creating a server for a protocol that already has one hands back the existing server.

Definition at line 24 of file SBProtocolServer.h.

Constructor & Destructor Documentation

◆ SBProtocolServer() [1/2]

SBProtocolServer::SBProtocolServer ( )

Definition at line 30 of file SBProtocolServer.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by Create(), operator=(), SBProtocolServer(), and ~SBProtocolServer().

◆ SBProtocolServer() [2/2]

SBProtocolServer::SBProtocolServer ( const SBProtocolServer & rhs)

Definition at line 35 of file SBProtocolServer.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBProtocolServer().

◆ ~SBProtocolServer()

SBProtocolServer::~SBProtocolServer ( )
default

Member Function Documentation

◆ Create()

SBProtocolServer SBProtocolServer::Create ( const char * protocol,
lldb::SBError & error )
static

Returns the protocol server for protocol, creating it if this process does not already have one.

On failure error is set.

Definition at line 50 of file SBProtocolServer.cpp.

References error(), lldb_private::ProtocolServer::GetOrCreate(), lldb_private::ProtocolServer::GetSupportedProtocols(), LLDB_INSTRUMENT_VA, m_opaque_up, and SBProtocolServer().

Referenced by ~SBProtocolServer().

◆ GetConnectionURI()

const char * SBProtocolServer::GetConnectionURI ( )

Returns the URI clients can connect to, valid after a successful Start, or nullptr if the server is not listening.

Definition at line 143 of file SBProtocolServer.cpp.

References lldb_private::ConstString::GetCString(), lldb_private::Socket::GetListeningConnectionURI(), LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBProtocolServer().

◆ IsValid()

bool SBProtocolServer::IsValid ( ) const

Definition at line 80 of file SBProtocolServer.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBProtocolServer().

◆ operator bool()

SBProtocolServer::operator bool ( ) const
explicit

Definition at line 74 of file SBProtocolServer.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

◆ operator=()

SBProtocolServer & SBProtocolServer::operator= ( const SBProtocolServer & rhs)

Definition at line 40 of file SBProtocolServer.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBProtocolServer().

◆ Start()

SBError SBProtocolServer::Start ( const char * connection_uri)

Starts listening for clients on connection_uri, which must be an accepting URI such as "listen://[host]:port" or "accept:///path".

Definition at line 86 of file SBProtocolServer.cpp.

References error(), lldb_private::Socket::GetProtocolAndMode(), LLDB_INSTRUMENT_VA, m_opaque_up, lldb_private::Socket::ModeAccept, lldb_private::ProtocolServer::Connection::name, lldb_private::URI::Parse(), lldb_private::ProtocolServer::Connection::protocol, and lldb_private::Socket::ProtocolUnixDomain.

Referenced by ~SBProtocolServer().

◆ Stop()

SBError SBProtocolServer::Stop ( )

Definition at line 128 of file SBProtocolServer.cpp.

References error(), LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBProtocolServer().

Member Data Documentation

◆ m_opaque_up

std::unique_ptr<lldb_private::SBProtocolServerImpl> lldb::SBProtocolServer::m_opaque_up
private

The documentation for this class was generated from the following files: