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 <utility>
14 
16 
17 #include "llvm/ADT/Optional.h"
18 
19 #include "AdbClient.h"
20 
21 namespace lldb_private {
22 namespace platform_android {
23 
26 public:
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,
38  lldb_private::Target *target,
39  lldb_private::Status &error) override;
40 
41 protected:
43  std::map<lldb::pid_t, uint16_t> m_port_forwards;
44  llvm::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 remote_port,
53  llvm::StringRef remote_socket_name,
54  std::string &connect_url);
55 
56 private:
58  delete;
60  operator=(const PlatformAndroidRemoteGDBServer &) = delete;
61 };
62 
63 } // namespace platform_android
64 } // namespace lldb_private
65 
66 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROIDREMOTEGDBSERVER_H
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::m_port_forwards
std::map< lldb::pid_t, uint16_t > m_port_forwards
Definition: PlatformAndroidRemoteGDBServer.h:43
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::PlatformAndroidRemoteGDBServer
PlatformAndroidRemoteGDBServer()=default
PlatformRemoteGDBServer.h
AdbClient.h
lldb_private::Args
Definition: Args.h:33
lldb_private::Target
Definition: Target.h:467
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::~PlatformAndroidRemoteGDBServer
~PlatformAndroidRemoteGDBServer() override
Definition: PlatformAndroidRemoteGDBServer.cpp:77
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::operator=
const PlatformAndroidRemoteGDBServer & operator=(const PlatformAndroidRemoteGDBServer &)=delete
lldb_private::Debugger
Definition: Debugger.h:74
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::MakeConnectURL
Status MakeConnectURL(const lldb::pid_t pid, const uint16_t remote_port, llvm::StringRef remote_socket_name, std::string &connect_url)
Definition: PlatformAndroidRemoteGDBServer.cpp:172
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::ConnectProcess
lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url, llvm::StringRef plugin_name, lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) override
Definition: PlatformAndroidRemoteGDBServer.cpp:201
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::KillSpawnedProcess
bool KillSpawnedProcess(lldb::pid_t pid) override
Definition: PlatformAndroidRemoteGDBServer.cpp:101
lldb_private::Status
Definition: Status.h:44
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::LaunchGDBServer
bool LaunchGDBServer(lldb::pid_t &pid, std::string &connect_url) override
Definition: PlatformAndroidRemoteGDBServer.cpp:82
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::DeleteForwardPort
void DeleteForwardPort(lldb::pid_t pid)
Definition: PlatformAndroidRemoteGDBServer.cpp:154
uint16_t
lldb_private::platform_android::PlatformAndroidRemoteGDBServer
Definition: PlatformAndroidRemoteGDBServer.h:24
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::DisconnectRemote
Status DisconnectRemote() override
Definition: PlatformAndroidRemoteGDBServer.cpp:149
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::ConnectRemote
Status ConnectRemote(Args &args) override
Definition: PlatformAndroidRemoteGDBServer.cpp:107
lldb_private::platform_gdb_server::PlatformRemoteGDBServer
Definition: PlatformRemoteGDBServer.h:22
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::m_device_id
std::string m_device_id
Definition: PlatformAndroidRemoteGDBServer.h:42
lldb_private::platform_android::PlatformAndroidRemoteGDBServer::m_socket_namespace
llvm::Optional< AdbClient::UnixSocketNamespace > m_socket_namespace
Definition: PlatformAndroidRemoteGDBServer.h:44