LLDB  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lldb_private::platform_gdb_server::PlatformRemoteGDBServer Class Reference

#include <PlatformRemoteGDBServer.h>

Inheritance diagram for lldb_private::platform_gdb_server::PlatformRemoteGDBServer:
Inheritance graph
Collaboration diagram for lldb_private::platform_gdb_server::PlatformRemoteGDBServer:
Collaboration graph

Public Member Functions

 PlatformRemoteGDBServer ()
 Default Constructor. More...
 ~PlatformRemoteGDBServer () override
 Destructor. More...
ConstString GetPluginName () override
uint32_t GetPluginVersion () override
Status ResolveExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) override
 Find a platform plugin for a given process. More...
bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec) override
const char * GetDescription () override
Status GetFileWithUUID (const FileSpec &platform_file, const UUID *uuid_ptr, FileSpec &local_file) override
 Locate a file for a platform. More...
bool GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info) override
uint32_t FindProcesses (const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &process_infos) override
 Attach to an existing process by process name. More...
Status LaunchProcess (ProcessLaunchInfo &launch_info) override
 Launch a new process on a platform, not necessarily for debugging, it could be just for running the process. More...
Status KillProcess (const lldb::pid_t pid) override
 Kill process on a platform. More...
lldb::ProcessSP DebugProcess (ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, Status &error) override
 Subclasses do not need to implement this function as it uses the Platform::LaunchProcess() followed by Platform::Attach (). More...
lldb::ProcessSP Attach (ProcessAttachInfo &attach_info, Debugger &debugger, Target *target, Status &error) override
 Attach to an existing process using a process ID. More...
bool GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override
 Get the platform's supported architectures in the order in which they should be searched. More...
size_t GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site) override
bool GetRemoteOSVersion () override
bool GetRemoteOSBuildString (std::string &s) override
bool GetRemoteOSKernelDescription (std::string &s) override
ArchSpec GetRemoteSystemArchitecture () override
FileSpec GetRemoteWorkingDirectory () override
bool SetRemoteWorkingDirectory (const FileSpec &working_dir) override
const char * GetHostname () override
UserIDResolverGetUserIDResolver () override
bool IsConnected () const override
Status ConnectRemote (Args &args) override
Status DisconnectRemote () override
Status MakeDirectory (const FileSpec &file_spec, uint32_t file_permissions) override
Status GetFilePermissions (const FileSpec &file_spec, uint32_t &file_permissions) override
Status SetFilePermissions (const FileSpec &file_spec, uint32_t file_permissions) override
lldb::user_id_t OpenFile (const FileSpec &file_spec, uint32_t flags, uint32_t mode, Status &error) override
bool CloseFile (lldb::user_id_t fd, Status &error) override
uint64_t ReadFile (lldb::user_id_t fd, uint64_t offset, void *data_ptr, uint64_t len, Status &error) override
uint64_t WriteFile (lldb::user_id_t fd, uint64_t offset, const void *data, uint64_t len, Status &error) override
lldb::user_id_t GetFileSize (const FileSpec &file_spec) override
Status PutFile (const FileSpec &source, const FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
Status CreateSymlink (const FileSpec &src, const FileSpec &dst) override
bool GetFileExists (const FileSpec &file_spec) override
Status Unlink (const FileSpec &path) override
Status RunShellCommand (const char *command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const lldb_private::Timeout< std::micro > &timeout) override
void CalculateTrapHandlerSymbolNames () override
 Ask the Platform subclass to fill in the list of trap handler names. More...
const lldb::UnixSignalsSP & GetRemoteUnixSignals () override
lldb::ProcessSP ConnectProcess (llvm::StringRef connect_url, llvm::StringRef plugin_name, lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) override
size_t ConnectToWaitingProcesses (lldb_private::Debugger &debugger, lldb_private::Status &error) override
 Connect to all processes waiting for a debugger to attach. More...
virtual size_t GetPendingGdbServerList (std::vector< std::string > &connection_urls)
- Public Member Functions inherited from lldb_private::Platform
 Platform (bool is_host_platform)
 Default Constructor. More...
 ~Platform () override
 Destructor. More...
virtual Status ResolveSymbolFile (Target &target, const ModuleSpec &sym_spec, FileSpec &sym_file)
 Find a symbol file given a symbol file module specification. More...
virtual bool ResolveRemotePath (const FileSpec &platform_path, FileSpec &resolved_platform_path)
 Resolves the FileSpec to a (possibly) remote path. More...
virtual llvm::VersionTuple GetOSVersion (Process *process=nullptr)
 Get the OS version from a connected platform. More...
bool SetOSVersion (llvm::VersionTuple os_version)
bool GetOSBuildString (std::string &s)
bool GetOSKernelDescription (std::string &s)
ConstString GetName ()
virtual ConstString GetFullNameForDylib (ConstString basename)
virtual void GetStatus (Stream &strm)
 Report the current status for this platform. More...
virtual std::vector< std::string > GetSystemIncludeDirectories (lldb::LanguageType lang)
 Retrieve the system include directories on this platform for the given language. More...
virtual FileSpecList LocateExecutableScriptingResources (Target *target, Module &module, Stream *feedback_stream)
virtual Status GetSharedModule (const ModuleSpec &module_spec, Process *process, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr)
virtual Status ShellExpandArguments (ProcessLaunchInfo &launch_info)
 Perform expansion of the command-line for this launch info This can potentially involve wildcard expansion environment variable replacement, and whatever other argument magic the platform defines as part of its typical user experience. More...
virtual bool IsCompatibleArchitecture (const ArchSpec &arch, bool exact_arch_match, ArchSpec *compatible_arch_ptr)
 Lets a platform answer if it is compatible with a given architecture and the target triple contained within. More...
virtual bool CanDebugProcess ()
 Not all platforms will support debugging a process by spawning somehow halted for a debugger (specified using the "eLaunchFlagDebug" launch flag) and then attaching. More...
virtual lldb::BreakpointSP SetThreadCreationBreakpoint (Target &target)
virtual lldb_private::ConstString GetSDKDirectory (lldb_private::Target &target)
const std::string & GetRemoteURL () const
bool IsHost () const
bool IsRemote () const
const ArchSpecGetSystemArchitecture ()
void SetSystemArchitecture (const ArchSpec &arch)
ArchSpec GetAugmentedArchSpec (llvm::StringRef triple)
 If the triple contains not specify the vendor, os, and environment parts, we "augment" these using information from the platform and return the resulting ArchSpec object. More...
size_t GetMaxUserIDNameLength () const
size_t GetMaxGroupIDNameLength () const
ConstString GetSDKRootDirectory () const
void SetSDKRootDirectory (ConstString dir)
ConstString GetSDKBuild () const
void SetSDKBuild (ConstString sdk_build)
virtual bool SupportsModules ()
virtual void AddClangModuleCompilationOptions (Target *target, std::vector< std::string > &options)
FileSpec GetWorkingDirectory ()
bool SetWorkingDirectory (const FileSpec &working_dir)
virtual bool ModuleIsExcludedForUnconstrainedSearches (Target &target, const lldb::ModuleSP &module_sp)
virtual Status GetFile (const FileSpec &source, const FileSpec &destination)
virtual Status Install (const FileSpec &src, const FileSpec &dst)
 Install a file or directory to the remote system. More...
virtual Environment GetEnvironment ()
virtual MmapArgList GetMmapArgumentList (const ArchSpec &arch, lldb::addr_t addr, lldb::addr_t length, unsigned prot, unsigned flags, lldb::addr_t fd, lldb::addr_t offset)
virtual bool GetSupportsRSync ()
virtual void SetSupportsRSync (bool flag)
virtual const char * GetRSyncOpts ()
virtual void SetRSyncOpts (const char *opts)
virtual const char * GetRSyncPrefix ()
virtual void SetRSyncPrefix (const char *prefix)
virtual bool GetSupportsSSH ()
virtual void SetSupportsSSH (bool flag)
virtual const char * GetSSHOpts ()
virtual void SetSSHOpts (const char *opts)
virtual bool GetIgnoresRemoteHostname ()
virtual void SetIgnoresRemoteHostname (bool flag)
virtual lldb_private::OptionGroupOptionsGetConnectionOptions (CommandInterpreter &interpreter)
virtual void SetLocalCacheDirectory (const char *local)
virtual const char * GetLocalCacheDirectory ()
virtual std::string GetPlatformSpecificConnectionInformation ()
virtual bool CalculateMD5 (const FileSpec &file_spec, uint64_t &low, uint64_t &high)
virtual int32_t GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info)
lldb::UnixSignalsSP GetUnixSignals ()
virtual std::string GetQueueNameForThreadQAddress (Process *process, lldb::addr_t dispatch_qaddr)
 Locate a queue name given a thread's qaddr. More...
virtual lldb::queue_id_t GetQueueIDForThreadQAddress (Process *process, lldb::addr_t dispatch_qaddr)
 Locate a queue ID given a thread's qaddr. More...
virtual const std::vector< ConstString > & GetTrapHandlerSymbolNames ()
 Provide a list of trap handler function names for this platform. More...
virtual FileSpec LocateExecutable (const char *basename)
 Find a support executable that may not live within in the standard locations related to LLDB. More...
virtual uint32_t GetDefaultMemoryCacheLineSize ()
 Allow the platform to set preferred memory cache line size. More...
uint32_t LoadImage (lldb_private::Process *process, const lldb_private::FileSpec &local_file, const lldb_private::FileSpec &remote_file, lldb_private::Status &error)
 Load a shared library into this process. More...
uint32_t LoadImageUsingPaths (lldb_private::Process *process, const lldb_private::FileSpec &library_name, const std::vector< std::string > &paths, lldb_private::Status &error, lldb_private::FileSpec *loaded_path)
 Load a shared library specified by base name into this process, looking by hand along a set of paths. More...
virtual uint32_t DoLoadImage (lldb_private::Process *process, const lldb_private::FileSpec &remote_file, const std::vector< std::string > *paths, lldb_private::Status &error, lldb_private::FileSpec *loaded_path=nullptr)
virtual Status UnloadImage (lldb_private::Process *process, uint32_t image_token)
- Public Member Functions inherited from lldb_private::PluginInterface
virtual ~PluginInterface ()

Static Public Member Functions

static void Initialize ()
static void Terminate ()
static lldb::PlatformSP CreateInstance (bool force, const ArchSpec *arch)
static ConstString GetPluginNameStatic ()
static const char * GetDescriptionStatic ()
- Static Public Member Functions inherited from lldb_private::Platform
static void Initialize ()
static void Terminate ()
static const PlatformPropertiesSPGetGlobalPlatformProperties ()
static lldb::PlatformSP GetHostPlatform ()
 Get the native host platform plug-in. More...
static lldb::PlatformSP GetPlatformForArchitecture (const ArchSpec &arch, ArchSpec *platform_arch_ptr)
static const char * GetHostPlatformName ()
static void SetHostPlatform (const lldb::PlatformSP &platform_sp)
static lldb::PlatformSP Find (ConstString name)
static lldb::PlatformSP Create (ConstString name, Status &error)
static lldb::PlatformSP Create (const ArchSpec &arch, ArchSpec *platform_arch_ptr, Status &error)
static ArchSpec GetAugmentedArchSpec (Platform *platform, llvm::StringRef triple)
 Augments the triple either with information from platform or the host system (if platform is null). More...

Protected Member Functions

virtual bool LaunchGDBServer (lldb::pid_t &pid, std::string &connect_url)
virtual bool KillSpawnedProcess (lldb::pid_t pid)
virtual std::string MakeUrl (const char *scheme, const char *hostname, uint16_t port, const char *path)
- Protected Member Functions inherited from lldb_private::Platform
Status GetCachedExecutable (ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, Platform &remote_platform)
virtual Status DownloadModuleSlice (const FileSpec &src_file_spec, const uint64_t src_offset, const uint64_t src_size, const FileSpec &dst_file_spec)
virtual Status DownloadSymbolFile (const lldb::ModuleSP &module_sp, const FileSpec &dst_file_spec)
virtual const char * GetCacheHostname ()

Protected Attributes

process_gdb_remote::GDBRemoteCommunicationClient m_gdb_client
std::string m_platform_description
std::string m_platform_scheme
std::string m_platform_hostname
lldb::UnixSignalsSP m_remote_signals_sp
- Protected Attributes inherited from lldb_private::Platform
bool m_is_host
bool m_os_version_set_while_connected
bool m_system_arch_set_while_connected
ConstString m_sdk_sysroot
ConstString m_sdk_build
FileSpec m_working_dir
std::string m_remote_url
std::string m_name
llvm::VersionTuple m_os_version
ArchSpec m_system_arch
std::mutex m_mutex
size_t m_max_uid_name_len
size_t m_max_gid_name_len
bool m_supports_rsync
std::string m_rsync_opts
std::string m_rsync_prefix
bool m_supports_ssh
std::string m_ssh_opts
bool m_ignores_remote_hostname
std::string m_local_cache_directory
std::vector< ConstStringm_trap_handlers
bool m_calculated_trap_handlers
const std::unique_ptr< ModuleCachem_module_cache

Additional Inherited Members

- Protected Types inherited from lldb_private::Platform
typedef std::map< uint32_t, ConstStringIDToNameMap

Detailed Description

Definition at line 22 of file PlatformRemoteGDBServer.h.

Constructor & Destructor Documentation

◆ PlatformRemoteGDBServer()

PlatformRemoteGDBServer::PlatformRemoteGDBServer ( )

Default Constructor.

Definition at line 199 of file PlatformRemoteGDBServer.cpp.

◆ ~PlatformRemoteGDBServer()

PlatformRemoteGDBServer::~PlatformRemoteGDBServer ( )


The destructor is virtual since this class is designed to be inherited from by the plug-in instance.

Definition at line 207 of file PlatformRemoteGDBServer.cpp.

Member Function Documentation

◆ Attach()

lldb::ProcessSP PlatformRemoteGDBServer::Attach ( ProcessAttachInfo attach_info,
Debugger debugger,
Target target,
Status error 

Attach to an existing process using a process ID.

Each platform subclass needs to implement this function and attempt to attach to the process with the process ID of pid. The platform subclass should return an appropriate ProcessSP subclass that is attached to the process, or an empty shared pointer with an appropriate error.

[in]pidThe process ID that we should attempt to attach to.
An appropriate ProcessSP containing a valid shared pointer to the default Process subclass for the platform that is attached to the process, or an empty shared pointer with an appropriate error fill into the error object.

Implements lldb_private::Platform.

Definition at line 544 of file PlatformRemoteGDBServer.cpp.

References lldb_private::Status::Clear(), lldb_private::Target::CreateProcess(), lldb_private::TargetList::CreateTarget(), lldb_private::eLoadDependentsNo, lldb_private::Status::Fail(), lldb_private::ProcessAttachInfo::GetHijackListener(), GetHostname(), lldb_private::ProcessAttachInfo::GetListenerForProcess(), lldb_private::Debugger::GetTargetList(), IsConnected(), lldb_private::Platform::IsRemote(), KillSpawnedProcess(), LaunchGDBServer(), LLDB_INVALID_PROCESS_ID, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::TargetList::SetSelectedTarget(), and lldb_private::Status::Success().

Referenced by GetPluginVersion().

◆ CalculateTrapHandlerSymbolNames()

void PlatformRemoteGDBServer::CalculateTrapHandlerSymbolNames ( )

Ask the Platform subclass to fill in the list of trap handler names.

For most Unix user process environments, this will be a single function name, _sigtramp. More specialized environments may have additional handler names. The unwinder code needs to know when a trap handler is on the stack because the unwind rules for the frame that caused the trap are different.

The base class Platform ivar m_trap_handlers should be updated by the Platform subclass when this method is called. If there are no predefined trap handlers, this method may be a no-op.

Implements lldb_private::Platform.

Definition at line 706 of file PlatformRemoteGDBServer.cpp.

References lldb_private::Platform::m_trap_handlers.

Referenced by GetUserIDResolver().

◆ CloseFile()

bool PlatformRemoteGDBServer::CloseFile ( lldb::user_id_t  fd,
Status error 

◆ ConnectProcess()

lldb::ProcessSP PlatformRemoteGDBServer::ConnectProcess ( llvm::StringRef  connect_url,
llvm::StringRef  plugin_name,
lldb_private::Debugger debugger,
lldb_private::Target target,
lldb_private::Status error 

◆ ConnectRemote()

Status PlatformRemoteGDBServer::ConnectRemote ( Args args)

◆ ConnectToWaitingProcesses()

size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses ( lldb_private::Debugger debugger,
lldb_private::Status error 

Connect to all processes waiting for a debugger to attach.

If the platform have a list of processes waiting for a debugger to connect to them then connect to all of these pending processes.

[in]debuggerThe debugger used for the connect.
[out]errorIf an error occurred during the connect then this object will contain the error message.
The number of processes we are successfully connected to.

Reimplemented from lldb_private::Platform.

Definition at line 830 of file PlatformRemoteGDBServer.cpp.

References ConnectProcess(), lldb_private::Status::Fail(), and GetPendingGdbServerList().

Referenced by GetUserIDResolver().

◆ CreateInstance()

PlatformSP PlatformRemoteGDBServer::CreateInstance ( bool  force,
const ArchSpec arch 

◆ CreateSymlink()

Status PlatformRemoteGDBServer::CreateSymlink ( const FileSpec src,
const FileSpec dst 

◆ DebugProcess()

lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess ( ProcessLaunchInfo launch_info,
Debugger debugger,
Target target,
Status error 

◆ DisconnectRemote()

Status PlatformRemoteGDBServer::DisconnectRemote ( )

◆ FindProcesses()

uint32_t PlatformRemoteGDBServer::FindProcesses ( const ProcessInstanceInfoMatch match_info,
ProcessInstanceInfoList proc_infos 

Attach to an existing process by process name.

This function is not meant to be overridden by Process subclasses. It will first call Process::WillAttach (const char *) and if that returns true, Process::DoAttach (const char *) will be called to actually do the attach. If DoAttach returns true, then Process::DidAttach() will be called.

[in]process_nameA process name to match against the current process list.
Returns pid if attaching was successful, or LLDB_INVALID_PROCESS_ID if attaching fails.

Reimplemented from lldb_private::Platform.

Definition at line 356 of file PlatformRemoteGDBServer.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::FindProcesses(), and m_gdb_client.

Referenced by GetPluginVersion().

◆ GetDescription()

const char * PlatformRemoteGDBServer::GetDescription ( )

Implements lldb_private::Platform.

Definition at line 82 of file PlatformRemoteGDBServer.cpp.

Referenced by GetPluginVersion().

◆ GetDescriptionStatic()

const char * PlatformRemoteGDBServer::GetDescriptionStatic ( )

Definition at line 77 of file PlatformRemoteGDBServer.cpp.

◆ GetFileExists()

bool PlatformRemoteGDBServer::GetFileExists ( const FileSpec file_spec)

◆ GetFilePermissions()

Status PlatformRemoteGDBServer::GetFilePermissions ( const FileSpec file_spec,
uint32_t file_permissions 

◆ GetFileSize()

lldb::user_id_t PlatformRemoteGDBServer::GetFileSize ( const FileSpec file_spec)

◆ GetFileWithUUID()

Status PlatformRemoteGDBServer::GetFileWithUUID ( const FileSpec platform_file,
const UUID uuid_ptr,
FileSpec local_file 

Locate a file for a platform.

The default implementation of this function will return the same file patch in local_file as was in platform_file.

[in]platform_fileThe platform file path to locate and cache locally.
[in]uuid_ptrIf we know the exact UUID of the file we are looking for, it can be specified. If it is not specified, we might now know the exact file. The UUID is usually some sort of MD5 checksum for the file and is sometimes known by dynamic linkers/loaders. If the UUID is known, it is best to supply it to platform file queries to ensure we are finding the correct file, not just a file at the correct path.
[out]local_fileA locally cached version of the platform file. For platforms that describe the current host computer, this will just be the same file. For remote platforms, this file might come from and SDK directory, or might need to be sync'ed over to the current machine for efficient debugging access.
An error object.

Reimplemented from lldb_private::Platform.

Definition at line 190 of file PlatformRemoteGDBServer.cpp.

Referenced by GetPluginVersion().

◆ GetHostname()

const char * PlatformRemoteGDBServer::GetHostname ( )

◆ GetModuleSpec()

bool PlatformRemoteGDBServer::GetModuleSpec ( const FileSpec module_file_spec,
const ArchSpec arch,
ModuleSpec module_spec 

◆ GetPendingGdbServerList()

size_t PlatformRemoteGDBServer::GetPendingGdbServerList ( std::vector< std::string > &  connection_urls)

◆ GetPluginName()

ConstString lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetPluginName ( )

Implements lldb_private::PluginInterface.

Definition at line 39 of file PlatformRemoteGDBServer.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

ConstString PlatformRemoteGDBServer::GetPluginNameStatic ( )

Definition at line 72 of file PlatformRemoteGDBServer.cpp.

Referenced by GetPluginName().

◆ GetPluginVersion()

uint32_t lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetPluginVersion ( )

◆ GetProcessInfo()

bool PlatformRemoteGDBServer::GetProcessInfo ( lldb::pid_t  pid,
ProcessInstanceInfo proc_info 

◆ GetRemoteOSBuildString()

bool PlatformRemoteGDBServer::GetRemoteOSBuildString ( std::string &  s)

◆ GetRemoteOSKernelDescription()

bool PlatformRemoteGDBServer::GetRemoteOSKernelDescription ( std::string &  s)

◆ GetRemoteOSVersion()

bool PlatformRemoteGDBServer::GetRemoteOSVersion ( )

◆ GetRemoteSystemArchitecture()

ArchSpec PlatformRemoteGDBServer::GetRemoteSystemArchitecture ( )

◆ GetRemoteUnixSignals()

const UnixSignalsSP & PlatformRemoteGDBServer::GetRemoteUnixSignals ( )

◆ GetRemoteWorkingDirectory()

FileSpec PlatformRemoteGDBServer::GetRemoteWorkingDirectory ( )

◆ GetSoftwareBreakpointTrapOpcode()

size_t PlatformRemoteGDBServer::GetSoftwareBreakpointTrapOpcode ( Target target,
BreakpointSite bp_site 

Reimplemented from lldb_private::Platform.

Definition at line 224 of file PlatformRemoteGDBServer.cpp.

Referenced by GetPluginVersion().

◆ GetSupportedArchitectureAtIndex()

bool PlatformRemoteGDBServer::GetSupportedArchitectureAtIndex ( uint32_t  idx,
ArchSpec arch 

Get the platform's supported architectures in the order in which they should be searched.

[in]idxA zero based architecture index
[out]archA copy of the architecture at index if the return value is true.
true if arch was filled in and is valid, false otherwise.

Implements lldb_private::Platform.

Definition at line 209 of file PlatformRemoteGDBServer.cpp.

References lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetSystemArchitecture(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArchSpec::IsValid(), m_gdb_client, and lldb_private::ArchSpec::SetTriple().

Referenced by GetPluginVersion().

◆ GetUserIDResolver()

UserIDResolver& lldb_private::platform_gdb_server::PlatformRemoteGDBServer::GetUserIDResolver ( )

◆ Initialize()

void PlatformRemoteGDBServer::Initialize ( )

◆ IsConnected()

bool PlatformRemoteGDBServer::IsConnected ( ) const

◆ KillProcess()

Status PlatformRemoteGDBServer::KillProcess ( const lldb::pid_t  pid)

Kill process on a platform.

Reimplemented from lldb_private::Platform.

Definition at line 452 of file PlatformRemoteGDBServer.cpp.

References KillSpawnedProcess().

Referenced by GetPluginVersion().

◆ KillSpawnedProcess()

bool PlatformRemoteGDBServer::KillSpawnedProcess ( lldb::pid_t  pid)

◆ LaunchGDBServer()

bool PlatformRemoteGDBServer::LaunchGDBServer ( lldb::pid_t pid,
std::string &  connect_url 

◆ LaunchProcess()

Status PlatformRemoteGDBServer::LaunchProcess ( ProcessLaunchInfo launch_info)

Launch a new process on a platform, not necessarily for debugging, it could be just for running the process.

Reimplemented from lldb_private::Platform.

Definition at line 367 of file PlatformRemoteGDBServer.cpp.

References lldb_private::Status::AsCString(), lldb_private::FileAction::eFileActionOpen, lldb_private::ProcessInfo::GetArchitecture(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetCurrentProcessID(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessLaunchInfo::GetFileActionAtIndex(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetLaunchSuccess(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ProcessLaunchInfo::GetNumFileActions(), lldb_private::ArchSpec::GetTriple(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), LIBLLDB_LOG_PLATFORM, LLDB_INVALID_PROCESS_ID, m_gdb_client, lldb_private::Log::Printf(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendArgumentsPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendEnvironment(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendLaunchArchPacket(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetDisableASLR(), lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::ProcessInfo::SetProcessID(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetSTDOUT(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SetWorkingDir(), and lldb_private::Flags::Test().

Referenced by GetPluginVersion().

◆ MakeDirectory()

Status PlatformRemoteGDBServer::MakeDirectory ( const FileSpec file_spec,
uint32_t  file_permissions 

◆ MakeUrl()

std::string PlatformRemoteGDBServer::MakeUrl ( const char *  scheme,
const char *  hostname,
uint16_t  port,
const char *  path 

◆ OpenFile()

lldb::user_id_t PlatformRemoteGDBServer::OpenFile ( const FileSpec file_spec,
uint32_t  flags,
uint32_t  mode,
Status error 

◆ PutFile()

Status PlatformRemoteGDBServer::PutFile ( const FileSpec source,
const FileSpec destination,
uint32_t  uid = UINT32_MAX,
uint32_t  gid = UINT32_MAX 

Reimplemented from lldb_private::Platform.

Definition at line 659 of file PlatformRemoteGDBServer.cpp.

References lldb_private::Platform::PutFile().

Referenced by GetUserIDResolver().

◆ ReadFile()

uint64_t PlatformRemoteGDBServer::ReadFile ( lldb::user_id_t  fd,
uint64_t  offset,
void *  data_ptr,
uint64_t  len,
Status error 

◆ ResolveExecutable()

Status PlatformRemoteGDBServer::ResolveExecutable ( const ModuleSpec module_spec,
lldb::ModuleSP &  module_sp,
const FileSpecList *  module_search_paths_ptr 

Find a platform plugin for a given process.

Scans the installed Platform plug-ins and tries to find an instance that can be used for process

[in]processThe process for which to try and locate a platform plug-in instance.
[in]plugin_nameAn optional name of a specific platform plug-in that should be used. If nullptr, pick the best plug-in. Set the target's executable based off of the existing architecture information in target given a path to an executable exe_file.

Each platform knows the architectures that it supports and can select the correct architecture slice within exe_file by inspecting the architecture in target. If the target had an architecture specified, then in can try and obey that request and optionally fail if the architecture doesn't match up. If no architecture is specified, the platform should select the default architecture from exe_file. Any application bundles or executable wrappers can also be inspected for the actual application binary within the bundle that should be used.

Returns true if this Platform plug-in was able to find a suitable executable, false otherwise.

Reimplemented from lldb_private::Platform.

Definition at line 94 of file PlatformRemoteGDBServer.cpp.

References lldb_private::Status::Fail(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::StreamString::GetData(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::FileSpec::GetPath(), lldb_private::ModuleSpec::GetUUID(), lldb_private::UUID::IsValid(), lldb_private::ArchSpec::IsValid(), lldb_private::Stream::PutCString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::Status::SetErrorToGenericError(), and lldb_private::Status::Success().

Referenced by GetPluginVersion().

◆ RunShellCommand()

Status PlatformRemoteGDBServer::RunShellCommand ( const char *  command,
const FileSpec working_dir,
int *  status_ptr,
int *  signo_ptr,
std::string *  command_output,
const lldb_private::Timeout< std::micro > &  timeout 

◆ SetFilePermissions()

Status PlatformRemoteGDBServer::SetFilePermissions ( const FileSpec file_spec,
uint32_t  file_permissions 

◆ SetRemoteWorkingDirectory()

bool PlatformRemoteGDBServer::SetRemoteWorkingDirectory ( const FileSpec working_dir)

◆ Terminate()

void PlatformRemoteGDBServer::Terminate ( )

Definition at line 52 of file PlatformRemoteGDBServer.cpp.

References g_initialized.

Referenced by lldb_private::SystemInitializerFull::Terminate().

◆ Unlink()

Status PlatformRemoteGDBServer::Unlink ( const FileSpec path)

◆ WriteFile()

uint64_t PlatformRemoteGDBServer::WriteFile ( lldb::user_id_t  fd,
uint64_t  offset,
const void *  data,
uint64_t  len,
Status error 

Member Data Documentation

◆ m_gdb_client

process_gdb_remote::GDBRemoteCommunicationClient lldb_private::platform_gdb_server::PlatformRemoteGDBServer::m_gdb_client

◆ m_platform_description

std::string lldb_private::platform_gdb_server::PlatformRemoteGDBServer::m_platform_description

Definition at line 167 of file PlatformRemoteGDBServer.h.

◆ m_platform_hostname

std::string lldb_private::platform_gdb_server::PlatformRemoteGDBServer::m_platform_hostname

◆ m_platform_scheme

std::string lldb_private::platform_gdb_server::PlatformRemoteGDBServer::m_platform_scheme

◆ m_remote_signals_sp

lldb::UnixSignalsSP lldb_private::platform_gdb_server::PlatformRemoteGDBServer::m_remote_signals_sp

Definition at line 173 of file PlatformRemoteGDBServer.h.

Referenced by DisconnectRemote(), and GetRemoteUnixSignals().

The documentation for this class was generated from the following files: