LLDB mainline
PlatformAndroidRemoteGDBServer.h
Go to the documentation of this file.
1//===-- PlatformAndroidRemoteGDBServer.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_PLATFORM_ANDROID_PLATFORMANDROIDREMOTEGDBSERVER_H
10#define LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROIDREMOTEGDBSERVER_H
11
12#include <map>
13#include <optional>
14#include <utility>
15
17
18
19#include "AdbClient.h"
20
21namespace lldb_private {
22namespace platform_android {
23
26public:
28
30
31 Status ConnectRemote(Args &args) override;
32
33 Status DisconnectRemote() override;
34
35 lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url,
36 llvm::StringRef plugin_name,
37 lldb_private::Debugger &debugger,
39 lldb_private::Status &error) override;
40
41protected:
42 std::string m_device_id;
43 std::map<lldb::pid_t, uint16_t> m_port_forwards;
44 std::optional<AdbClient::UnixSocketNamespace> m_socket_namespace;
45
46 bool LaunchGDBServer(lldb::pid_t &pid, std::string &connect_url) override;
47
48 bool KillSpawnedProcess(lldb::pid_t pid) override;
49
51
52 Status MakeConnectURL(const lldb::pid_t pid, const uint16_t local_port,
53 const uint16_t remote_port,
54 llvm::StringRef remote_socket_name,
55 std::string &connect_url);
56
57private:
59 delete;
62};
63
64} // namespace platform_android
65} // namespace lldb_private
66
67#endif // LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROIDREMOTEGDBSERVER_H
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
Definition: Args.h:33
A class to manage flag bits.
Definition: Debugger.h:79
An error handling class.
Definition: Status.h:44
PlatformAndroidRemoteGDBServer(const PlatformAndroidRemoteGDBServer &)=delete
bool LaunchGDBServer(lldb::pid_t &pid, std::string &connect_url) override
Status MakeConnectURL(const lldb::pid_t pid, const uint16_t local_port, const uint16_t remote_port, llvm::StringRef remote_socket_name, std::string &connect_url)
lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url, llvm::StringRef plugin_name, lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) override
std::optional< AdbClient::UnixSocketNamespace > m_socket_namespace
const PlatformAndroidRemoteGDBServer & operator=(const PlatformAndroidRemoteGDBServer &)=delete
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:381
uint64_t pid_t
Definition: lldb-types.h:81