LLDB  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::platform_android::PlatformAndroid Class Reference

#include <PlatformAndroid.h>

Inheritance diagram for lldb_private::platform_android::PlatformAndroid:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::platform_android::PlatformAndroid:
Collaboration graph
[legend]

Public Member Functions

 PlatformAndroid (bool is_host)
 
llvm::StringRef GetPluginName () override
 
Status ConnectRemote (Args &args) override
 
Status GetFile (const FileSpec &source, const FileSpec &destination) override
 
Status PutFile (const FileSpec &source, const FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
 
uint32_t GetSdkVersion ()
 
bool GetRemoteOSVersion () override
 
Status DisconnectRemote () override
 
uint32_t GetDefaultMemoryCacheLineSize () override
 Allow the platform to set preferred memory cache line size. More...
 
- Public Member Functions inherited from lldb_private::platform_linux::PlatformLinux
 PlatformLinux (bool is_host)
 Default Constructor. More...
 
llvm::StringRef GetPluginName () override
 
llvm::StringRef GetDescription () override
 
void GetStatus (Stream &strm) override
 Report the current status for this platform. More...
 
std::vector< ArchSpecGetSupportedArchitectures () override
 Get the platform's supported architectures in the order in which they should be searched. More...
 
uint32_t GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info) override
 
bool CanDebugProcess () override
 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...
 
void CalculateTrapHandlerSymbolNames () override
 Ask the Platform subclass to fill in the list of trap handler names. More...
 
lldb::UnwindPlanSP GetTrapHandlerUnwindPlan (const llvm::Triple &triple, ConstString name) override
 Try to get a specific unwind plan for a named trap handler. More...
 
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) override
 
- Public Member Functions inherited from PlatformPOSIX
 PlatformPOSIX (bool is_host)
 Default Constructor. More...
 
 ~PlatformPOSIX () override
 Destructor. More...
 
lldb_private::OptionGroupOptionsGetConnectionOptions (lldb_private::CommandInterpreter &interpreter) override
 
lldb_private::Status PutFile (const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
 
lldb_private::Status GetFile (const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination) override
 
const lldb::UnixSignalsSP & GetRemoteUnixSignals () override
 
lldb::ProcessSP Attach (lldb_private::ProcessAttachInfo &attach_info, lldb_private::Debugger &debugger, lldb_private::Target *target, lldb_private::Status &error) override
 Attach to an existing process using a process ID. More...
 
lldb::ProcessSP DebugProcess (lldb_private::ProcessLaunchInfo &launch_info, lldb_private::Debugger &debugger, lldb_private::Target &target, lldb_private::Status &error) override
 Subclasses do not need to implement this function as it uses the Platform::LaunchProcess() followed by Platform::Attach (). More...
 
std::string GetPlatformSpecificConnectionInformation () override
 
void CalculateTrapHandlerSymbolNames () override
 Ask the Platform subclass to fill in the list of trap handler names. More...
 
lldb_private::Status ConnectRemote (lldb_private::Args &args) override
 
lldb_private::Status DisconnectRemote () override
 
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_image) override
 
lldb_private::Status UnloadImage (lldb_private::Process *process, uint32_t image_token) override
 
lldb_private::ConstString GetFullNameForDylib (lldb_private::ConstString basename) override
 
- Public Member Functions inherited from lldb_private::RemoteAwarePlatform
bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec) 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...
 
lldb::user_id_t OpenFile (const FileSpec &file_spec, File::OpenOptions 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 *dst, uint64_t dst_len, Status &error) override
 
uint64_t WriteFile (lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, Status &error) override
 
lldb::user_id_t GetFileSize (const FileSpec &file_spec) override
 
Status CreateSymlink (const FileSpec &src, const FileSpec &dst) override
 
bool GetFileExists (const FileSpec &file_spec) override
 
Status Unlink (const FileSpec &file_spec) override
 
FileSpec GetRemoteWorkingDirectory () override
 
bool SetRemoteWorkingDirectory (const FileSpec &working_dir) override
 
Status MakeDirectory (const FileSpec &file_spec, uint32_t mode) override
 
Status GetFilePermissions (const FileSpec &file_spec, uint32_t &file_permissions) override
 
Status SetFilePermissions (const FileSpec &file_spec, uint32_t file_permissions) override
 
bool CalculateMD5 (const FileSpec &file_spec, uint64_t &low, uint64_t &high) override
 
Status GetFileWithUUID (const FileSpec &platform_file, const UUID *uuid, FileSpec &local_file) override
 Locate a file for a platform. More...
 
llvm::Optional< std::stringGetRemoteOSBuildString () override
 
llvm::Optional< std::stringGetRemoteOSKernelDescription () override
 
ArchSpec GetRemoteSystemArchitecture () override
 
Status RunShellCommand (llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout) override
 
Status RunShellCommand (llvm::StringRef interpreter, llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout) override
 
const char * GetHostname () override
 
UserIDResolverGetUserIDResolver () override
 
lldb_private::Environment GetEnvironment () override
 
bool IsConnected () const override
 
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...
 
lldb::ProcessSP ConnectProcess (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Target *target, Status &error) override
 
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...
 
size_t ConnectToWaitingProcesses (Debugger &debugger, Status &error) override
 Connect to all processes waiting for a debugger to attach. More...
 
 Platform (bool is_host_platform)
 Default Constructor. More...
 
- Public Member Functions inherited from lldb_private::Platform
 Platform (bool is_host_platform)
 Default Constructor. More...
 
 ~Platform () override
 The destructor is virtual since this class is designed to be inherited from by the plug-in instance. 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)
 
llvm::Optional< std::stringGetOSBuildString ()
 
llvm::Optional< std::stringGetOSKernelDescription ()
 
ConstString GetName ()
 
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, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr)
 
virtual size_t GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site)
 
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 lldb::ProcessSP ConnectProcessSynchronous (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Stream &stream, Target *target, Status &error)
 
virtual lldb::BreakpointSP SetThreadCreationBreakpoint (Target &target)
 
virtual lldb_private::ConstString GetSDKDirectory (lldb_private::Target &target)
 
const std::stringGetRemoteURL () 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 void AutoCompleteDiskFileOrDirectory (CompletionRequest &request, bool only_dir)
 
virtual Status Install (const FileSpec &src, const FileSpec &dst)
 Install a file or directory to the remote system. More...
 
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 void SetLocalCacheDirectory (const char *local)
 
virtual const char * GetLocalCacheDirectory ()
 
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...
 
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 llvm::Expected< StructuredData::DictionarySPFetchExtendedCrashInformation (lldb_private::Process &process)
 Gather all of crash informations into a structured data dictionary. More...
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static lldb::PlatformSP CreateInstance (bool force, const ArchSpec *arch)
 
static llvm::StringRef GetPluginNameStatic (bool is_host)
 
static llvm::StringRef GetPluginDescriptionStatic (bool is_host)
 
- Static Public Member Functions inherited from lldb_private::platform_linux::PlatformLinux
static void Initialize ()
 
static void Terminate ()
 
static lldb::PlatformSP CreateInstance (bool force, const ArchSpec *arch)
 
static llvm::StringRef GetPluginNameStatic (bool is_host)
 
static llvm::StringRef GetPluginDescriptionStatic (bool is_host)
 
- Static Public Member Functions inherited from lldb_private::Platform
static void Initialize ()
 
static void Terminate ()
 
static PlatformPropertiesGetGlobalPlatformProperties ()
 
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

const char * GetCacheHostname () override
 
Status DownloadModuleSlice (const FileSpec &src_file_spec, const uint64_t src_offset, const uint64_t src_size, const FileSpec &dst_file_spec) override
 
Status DownloadSymbolFile (const lldb::ModuleSP &module_sp, const FileSpec &dst_file_spec) override
 
llvm::StringRef GetLibdlFunctionDeclarations (lldb_private::Process *process) override
 
- Protected Member Functions inherited from PlatformPOSIX
lldb_private::Status EvaluateLibdlExpression (lldb_private::Process *process, const char *expr_cstr, llvm::StringRef expr_prefix, lldb::ValueObjectSP &result_valobj_sp)
 
std::unique_ptr< lldb_private::UtilityFunctionMakeLoadImageUtilityFunction (lldb_private::ExecutionContext &exe_ctx, lldb_private::Status &error)
 
- Protected Member Functions inherited from lldb_private::Platform
lldb::ProcessSP DoConnectProcess (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Stream *stream, Target *target, Status &error)
 Private implementation of connecting to a process. More...
 
Status GetCachedExecutable (ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr)
 
virtual Status ResolveRemoteExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr)
 

Private Member Functions

AdbClient::SyncServiceGetSyncService (Status &error)
 

Private Attributes

std::unique_ptr< AdbClient::SyncServicem_adb_sync_svc
 
std::string m_device_id
 
uint32_t m_sdk_version
 

Additional Inherited Members

- Public Attributes inherited from lldb_private::platform_linux::PlatformLinux
std::vector< ArchSpecm_supported_architectures
 
- Protected Types inherited from lldb_private::Platform
typedef std::map< uint32_t, ConstStringIDToNameMap
 
- Static Protected Member Functions inherited from lldb_private::Platform
static std::vector< ArchSpecCreateArchList (llvm::ArrayRef< llvm::Triple::ArchType > archs, llvm::Triple::OSType os)
 Create a list of ArchSpecs with the given OS and a architectures. More...
 
- Protected Attributes inherited from PlatformPOSIX
std::unique_ptr< lldb_private::OptionGroupPlatformRSyncm_option_group_platform_rsync
 
std::unique_ptr< lldb_private::OptionGroupPlatformSSHm_option_group_platform_ssh
 
std::unique_ptr< lldb_private::OptionGroupPlatformCachingm_option_group_platform_caching
 
std::map< lldb_private::CommandInterpreter *, std::unique_ptr< lldb_private::OptionGroupOptions > > m_options
 
- Protected Attributes inherited from lldb_private::RemoteAwarePlatform
lldb::PlatformSP m_remote_platform_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
 

Detailed Description

Definition at line 22 of file PlatformAndroid.h.

Constructor & Destructor Documentation

◆ PlatformAndroid()

PlatformAndroid::PlatformAndroid ( bool  is_host)

Definition at line 129 of file PlatformAndroid.cpp.

Member Function Documentation

◆ ConnectRemote()

Status PlatformAndroid::ConnectRemote ( Args args)
overridevirtual

◆ CreateInstance()

PlatformSP PlatformAndroid::CreateInstance ( bool  force,
const ArchSpec arch 
)
static

◆ DisconnectRemote()

Status PlatformAndroid::DisconnectRemote ( )
overridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 241 of file PlatformAndroid.cpp.

References error(), m_device_id, and m_sdk_version.

◆ DownloadModuleSlice()

Status PlatformAndroid::DownloadModuleSlice ( const FileSpec src_file_spec,
const uint64_t  src_offset,
const uint64_t  src_size,
const FileSpec dst_file_spec 
)
overrideprotectedvirtual

Reimplemented from lldb_private::Platform.

Definition at line 231 of file PlatformAndroid.cpp.

References GetFile().

◆ DownloadSymbolFile()

Status PlatformAndroid::DownloadSymbolFile ( const lldb::ModuleSP &  module_sp,
const FileSpec dst_file_spec 
)
overrideprotectedvirtual

◆ GetCacheHostname()

const char * PlatformAndroid::GetCacheHostname ( )
overrideprotectedvirtual

Reimplemented from lldb_private::Platform.

Definition at line 229 of file PlatformAndroid.cpp.

References m_device_id.

◆ GetDefaultMemoryCacheLineSize()

uint32_t PlatformAndroid::GetDefaultMemoryCacheLineSize ( )
overridevirtual

Allow the platform to set preferred memory cache line size.

If non-zero (and the user has not set cache line size explicitly), this value will be used as the cache line size for memory reads.

Reimplemented from lldb_private::Platform.

Definition at line 250 of file PlatformAndroid.cpp.

References g_android_default_cache_size.

◆ GetFile()

Status PlatformAndroid::GetFile ( const FileSpec source,
const FileSpec destination 
)
overridevirtual

◆ GetLibdlFunctionDeclarations()

llvm::StringRef PlatformAndroid::GetLibdlFunctionDeclarations ( lldb_private::Process process)
overrideprotectedvirtual

◆ GetPluginDescriptionStatic()

llvm::StringRef PlatformAndroid::GetPluginDescriptionStatic ( bool  is_host)
static

Definition at line 132 of file PlatformAndroid.cpp.

◆ GetPluginName()

llvm::StringRef lldb_private::platform_android::PlatformAndroid::GetPluginName ( )
inlineoverridevirtual

◆ GetPluginNameStatic()

static llvm::StringRef lldb_private::platform_android::PlatformAndroid::GetPluginNameStatic ( bool  is_host)
inlinestatic

Definition at line 33 of file PlatformAndroid.h.

References lldb_private::Platform::GetHostPlatformName().

Referenced by GetPluginName().

◆ GetRemoteOSVersion()

bool PlatformAndroid::GetRemoteOSVersion ( )
overridevirtual

Reimplemented from lldb_private::RemoteAwarePlatform.

Definition at line 337 of file PlatformAndroid.cpp.

References GetSdkVersion(), and lldb_private::Platform::m_os_version.

◆ GetSdkVersion()

uint32_t PlatformAndroid::GetSdkVersion ( )

◆ GetSyncService()

AdbClient::SyncService * PlatformAndroid::GetSyncService ( Status error)
private

◆ Initialize()

void PlatformAndroid::Initialize ( )
static

Definition at line 34 of file PlatformAndroid.cpp.

References g_initialize_count.

◆ PutFile()

Status PlatformAndroid::PutFile ( const FileSpec source,
const FileSpec destination,
uint32_t  uid = UINT32_MAX,
uint32_t  gid = UINT32_MAX 
)
overridevirtual

◆ Terminate()

void PlatformAndroid::Terminate ( )
static

Definition at line 50 of file PlatformAndroid.cpp.

References g_initialize_count.

Member Data Documentation

◆ m_adb_sync_svc

std::unique_ptr<AdbClient::SyncService> lldb_private::platform_android::PlatformAndroid::m_adb_sync_svc
private

Definition at line 76 of file PlatformAndroid.h.

Referenced by GetSyncService().

◆ m_device_id

std::string lldb_private::platform_android::PlatformAndroid::m_device_id
private

◆ m_sdk_version

uint32_t lldb_private::platform_android::PlatformAndroid::m_sdk_version
private

Definition at line 78 of file PlatformAndroid.h.

Referenced by DisconnectRemote(), and GetSdkVersion().


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