#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/common/TCPSocket.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/UriParser.h"
#include "PlatformAndroidRemoteGDBServer.h"
#include <optional>
#include <sstream>
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespaceplatform_android;
static const lldb::pid_t g_remote_platform_pid = …;
static Status ForwardPortWithAdb(
const uint16_t local_port, const uint16_t remote_port,
llvm::StringRef remote_socket_name,
const std::optional<AdbClient::UnixSocketNamespace> &socket_namespace,
std::string &device_id) { … }
static Status DeleteForwardPortWithAdb(uint16_t local_port,
const std::string &device_id) { … }
static Status FindUnusedPort(uint16_t &port) { … }
PlatformAndroidRemoteGDBServer::~PlatformAndroidRemoteGDBServer() { … }
bool PlatformAndroidRemoteGDBServer::LaunchGDBServer(lldb::pid_t &pid,
std::string &connect_url) { … }
bool PlatformAndroidRemoteGDBServer::KillSpawnedProcess(lldb::pid_t pid) { … }
Status PlatformAndroidRemoteGDBServer::ConnectRemote(Args &args) { … }
Status PlatformAndroidRemoteGDBServer::DisconnectRemote() { … }
void PlatformAndroidRemoteGDBServer::DeleteForwardPort(lldb::pid_t pid) { … }
Status PlatformAndroidRemoteGDBServer::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 PlatformAndroidRemoteGDBServer::ConnectProcess(
llvm::StringRef connect_url, llvm::StringRef plugin_name,
lldb_private::Debugger &debugger, lldb_private::Target *target,
lldb_private::Status &error) { … }