LLDB mainline
SBProtocolServer.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 LLDB_API_SBPROTOCOLSERVER_H
10#define LLDB_API_SBPROTOCOLSERVER_H
11
12#include "lldb/API/SBDefines.h"
13
14namespace lldb_private {
16}
17
18namespace lldb {
19
20/// A server that speaks a debugging protocol.
21///
22/// Protocol servers are shared across debuggers. Creating a server for a
23/// protocol that already has one hands back the existing server.
25public:
30
31 /// Returns the protocol server for \p protocol, creating it if this process
32 /// does not already have one. On failure \p error is set.
33 static SBProtocolServer Create(const char *protocol, lldb::SBError &error);
34
35 explicit operator bool() const;
36 bool IsValid() const;
37
38 /// Starts listening for clients on \p connection_uri, which must be an
39 /// accepting URI such as "listen://[host]:port" or "accept:///path".
40 lldb::SBError Start(const char *connection_uri);
41
43
44 /// Returns the URI clients can connect to, valid after a successful Start,
45 /// or nullptr if the server is not listening.
46 const char *GetConnectionURI();
47
48private:
49 std::unique_ptr<lldb_private::SBProtocolServerImpl> m_opaque_up;
50};
51
52} // namespace lldb
53
54#endif
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_API
Definition SBDefines.h:28
const char * GetConnectionURI()
Returns the URI clients can connect to, valid after a successful Start, or nullptr if the server is n...
SBProtocolServer & operator=(const SBProtocolServer &rhs)
std::unique_ptr< lldb_private::SBProtocolServerImpl > m_opaque_up
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.
lldb::SBError Start(const char *connection_uri)
Starts listening for clients on connection_uri, which must be an accepting URI such as "listen://[hos...
PIMPL backing SBProtocolServer.
A class that represents a running process on the host machine.