LLDB mainline
GDBRemoteCommunicationServerPlatform.h
Go to the documentation of this file.
1//===-- GDBRemoteCommunicationServerPlatform.h ------------------*- C++ -*-===//
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_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONSERVERPLATFORM_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONSERVERPLATFORM_H
11
12#include <map>
13#include <mutex>
14#include <optional>
15#include <set>
16
18#include "lldb/Host/Socket.h"
19
20#include "llvm/Support/Error.h"
21
22namespace lldb_private {
23namespace process_gdb_remote {
24
27public:
29 const Socket::SocketProtocol socket_protocol, uint16_t gdbserver_port);
30
32
33 Status LaunchProcess() override;
34
36
38 std::string &socket_name, shared_fd_t fd);
39
40 void SetPendingGdbServer(const std::string &socket_name);
41
42protected:
44 std::recursive_mutex m_spawned_pids_mutex;
45 std::set<lldb::pid_t> m_spawned_pids;
46
48 std::optional<std::string> m_pending_gdb_server_socket_name;
49
51
53
55
57
59
61
63
65
67
68private:
72
74
75 static const FileSpec &GetDomainSocketDir();
76
77 static FileSpec GetDomainSocketPath(const char *prefix);
78
83};
84
85} // namespace process_gdb_remote
86} // namespace lldb_private
87
88#endif // LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONSERVERPLATFORM_H
A command line argument class.
Definition: Args.h:33
A file utility class.
Definition: FileSpec.h:56
An error handling class.
Definition: Status.h:115
GDBRemoteCommunicationServerPlatform(const GDBRemoteCommunicationServerPlatform &)=delete
const GDBRemoteCommunicationServerPlatform & operator=(const GDBRemoteCommunicationServerPlatform &)=delete
Status LaunchGDBServer(const lldb_private::Args &args, lldb::pid_t &pid, std::string &socket_name, shared_fd_t fd)
Status LaunchProcess() override
Launch a process with the current launch settings.
A class that represents a running process on the host machine.
NativeSocket shared_fd_t
Definition: Socket.h:42
uint64_t pid_t
Definition: lldb-types.h:83