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 FileSpec debugserver_path, const Socket::SocketProtocol socket_protocol,
30 uint16_t gdbserver_port);
31
33
34 Status LaunchProcess() override;
35
37
39 std::string &socket_name, shared_fd_t fd);
40
41 void SetPendingGdbServer(const std::string &socket_name);
42
43protected:
46 std::recursive_mutex m_spawned_pids_mutex;
47 std::set<lldb::pid_t> m_spawned_pids;
48
50 std::optional<std::string> m_pending_gdb_server_socket_name;
51
53
55
57
59
61
63
65
67
69
70private:
74
76
77 static const FileSpec &GetDomainSocketDir();
78
79 static FileSpec GetDomainSocketPath(const char *prefix);
80
85};
86
87} // namespace process_gdb_remote
88} // namespace lldb_private
89
90#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:57
An error handling class.
Definition Status.h:118
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.
GDBRemoteCommunicationServerPlatform(FileSpec debugserver_path, const Socket::SocketProtocol socket_protocol, uint16_t gdbserver_port)
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