LLDB  mainline
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
lldb_private::PlatformQemuUser Class Reference

#include <PlatformQemuUser.h>

Inheritance diagram for lldb_private::PlatformQemuUser:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::PlatformQemuUser:
Collaboration graph
[legend]

Public Member Functions

llvm::StringRef GetPluginName () override
 
llvm::StringRef GetDescription () override
 
UserIDResolverGetUserIDResolver () override
 
std::vector< ArchSpecGetSupportedArchitectures (const ArchSpec &process_host_arch) override
 Get the platform's supported architectures in the order in which they should be searched. 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 &status) override
 Attach to an existing process using a process ID. More...
 
bool IsConnected () const override
 
void CalculateTrapHandlerSymbolNames () override
 Ask the Platform subclass to fill in the list of trap handler names. More...
 
Environment GetEnvironment () override
 
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 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 ResolveExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr)
 Find a platform plugin for a given process. 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 ()
 
llvm::StringRef GetName ()
 
virtual const char * GetHostname ()
 
virtual ConstString GetFullNameForDylib (ConstString basename)
 
virtual void GetStatus (Stream &strm)
 Report the current status for this platform. More...
 
virtual bool GetRemoteOSVersion ()
 
virtual llvm::Optional< std::stringGetRemoteOSBuildString ()
 
virtual llvm::Optional< std::stringGetRemoteOSKernelDescription ()
 
virtual ArchSpec GetRemoteSystemArchitecture ()
 
virtual FileSpec GetRemoteWorkingDirectory ()
 
virtual bool SetRemoteWorkingDirectory (const FileSpec &working_dir)
 
virtual Status GetFileWithUUID (const FileSpec &platform_file, const UUID *uuid_ptr, FileSpec &local_file)
 Locate a file for a platform. 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, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr)
 
virtual bool GetModuleSpec (const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec)
 
virtual Status ConnectRemote (Args &args)
 
virtual Status DisconnectRemote ()
 
virtual size_t GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site)
 
virtual Status LaunchProcess (ProcessLaunchInfo &launch_info)
 Launch a new process on a platform, not necessarily for debugging, it could be just for running the process. More...
 
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 Status KillProcess (const lldb::pid_t pid)
 Kill process on a platform. More...
 
virtual bool IsCompatibleArchitecture (const ArchSpec &arch, const ArchSpec &process_host_arch, ArchSpec::MatchType 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::ProcessSP ConnectProcess (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Target *target, Status &error)
 
virtual lldb::ProcessSP ConnectProcessSynchronous (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Stream &stream, Target *target, Status &error)
 
virtual uint32_t FindProcesses (const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &proc_infos)
 Attach to an existing process by process name. More...
 
virtual bool GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info)
 
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 Status MakeDirectory (const FileSpec &file_spec, uint32_t permissions)
 
virtual Status GetFilePermissions (const FileSpec &file_spec, uint32_t &file_permissions)
 
virtual Status SetFilePermissions (const FileSpec &file_spec, uint32_t file_permissions)
 
virtual lldb::user_id_t OpenFile (const FileSpec &file_spec, File::OpenOptions flags, uint32_t mode, Status &error)
 
virtual bool CloseFile (lldb::user_id_t fd, Status &error)
 
virtual lldb::user_id_t GetFileSize (const FileSpec &file_spec)
 
virtual void AutoCompleteDiskFileOrDirectory (CompletionRequest &request, bool only_dir)
 
virtual uint64_t ReadFile (lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, Status &error)
 
virtual uint64_t WriteFile (lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, Status &error)
 
virtual Status GetFile (const FileSpec &source, const FileSpec &destination)
 
virtual Status PutFile (const FileSpec &source, const FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX)
 
virtual Status CreateSymlink (const FileSpec &src, const FileSpec &dst)
 
virtual Status Install (const FileSpec &src, const FileSpec &dst)
 Install a file or directory to the remote system. More...
 
virtual bool GetFileExists (const lldb_private::FileSpec &file_spec)
 
virtual Status Unlink (const FileSpec &file_spec)
 
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 lldb_private::Status RunShellCommand (llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout)
 
virtual lldb_private::Status RunShellCommand (llvm::StringRef shell, llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout)
 
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 uint32_t GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info)
 
virtual const lldb::UnixSignalsSP & GetRemoteUnixSignals ()
 
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 lldb::UnwindPlanSP GetTrapHandlerUnwindPlan (const llvm::Triple &triple, ConstString name)
 Try to get a specific unwind plan for a named trap handler. 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)
 
virtual size_t ConnectToWaitingProcesses (lldb_private::Debugger &debugger, lldb_private::Status &error)
 Connect to all processes waiting for a debugger to attach. More...
 
virtual llvm::Expected< StructuredData::DictionarySPFetchExtendedCrashInformation (lldb_private::Process &process)
 Gather all of crash informations into a structured data dictionary. More...
 
virtual bool LoadPlatformBinaryAndSetup (Process *process, lldb::addr_t addr, bool notify)
 Detect a binary in memory that will determine which Platform and DynamicLoader should be used in this target/process, and update the Platform/DynamicLoader. More...
 
virtual CompilerType GetSiginfoType (const llvm::Triple &triple)
 
virtual Args GetExtraStartupCommands ()
 
- 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 llvm::StringRef GetPluginNameStatic ()
 
static llvm::StringRef GetPluginDescriptionStatic ()
 
- 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 const char * GetHostPlatformName ()
 
static void SetHostPlatform (const lldb::PlatformSP &platform_sp)
 
static lldb::PlatformSP Create (llvm::StringRef name)
 
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...
 

Private Member Functions

 PlatformQemuUser ()
 

Static Private Member Functions

static lldb::PlatformSP CreateInstance (bool force, const ArchSpec *arch)
 
static void DebuggerInitialize (Debugger &debugger)
 

Additional Inherited Members

- Protected Types inherited from lldb_private::Platform
typedef std::map< uint32_t, ConstStringIDToNameMap
 
- 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 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 ()
 
virtual Status ResolveRemoteExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &exe_module_sp, const FileSpecList *module_search_paths_ptr)
 
- 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 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_hostname
 
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 15 of file PlatformQemuUser.h.

Constructor & Destructor Documentation

◆ PlatformQemuUser()

lldb_private::PlatformQemuUser::PlatformQemuUser ( )
inlineprivate

Definition at line 63 of file PlatformQemuUser.h.

Member Function Documentation

◆ Attach()

lldb::ProcessSP lldb_private::PlatformQemuUser::Attach ( ProcessAttachInfo attach_info,
Debugger debugger,
Target target,
Status error 
)
inlineoverridevirtual

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.

Returns
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 39 of file PlatformQemuUser.h.

References lldb_private::Status::SetErrorString().

◆ CalculateTrapHandlerSymbolNames()

void lldb_private::PlatformQemuUser::CalculateTrapHandlerSymbolNames ( )
inlineoverridevirtual

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 47 of file PlatformQemuUser.h.

◆ CreateInstance()

PlatformSP PlatformQemuUser::CreateInstance ( bool  force,
const ArchSpec arch 
)
staticprivate

Definition at line 103 of file PlatformQemuUser.cpp.

◆ DebuggerInitialize()

void PlatformQemuUser::DebuggerInitialize ( Debugger debugger)
staticprivate

Definition at line 93 of file PlatformQemuUser.cpp.

References GetGlobalProperties().

◆ DebugProcess()

lldb::ProcessSP PlatformQemuUser::DebugProcess ( ProcessLaunchInfo launch_info,
Debugger debugger,
Target target,
Status error 
)
overridevirtual

◆ GetDescription()

llvm::StringRef lldb_private::PlatformQemuUser::GetDescription ( )
inlineoverridevirtual

Implements lldb_private::Platform.

Definition at line 24 of file PlatformQemuUser.h.

References GetPluginDescriptionStatic().

◆ GetEnvironment()

Environment PlatformQemuUser::GetEnvironment ( )
overridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 239 of file PlatformQemuUser.cpp.

References GetGlobalProperties().

◆ GetMmapArgumentList()

MmapArgList lldb_private::PlatformQemuUser::GetMmapArgumentList ( const ArchSpec arch,
lldb::addr_t  addr,
lldb::addr_t  length,
unsigned  prot,
unsigned  flags,
lldb::addr_t  fd,
lldb::addr_t  offset 
)
inlineoverridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 51 of file PlatformQemuUser.h.

References lldb_private::Platform::GetHostPlatform().

◆ GetPluginDescriptionStatic()

llvm::StringRef PlatformQemuUser::GetPluginDescriptionStatic ( )
static

Definition at line 79 of file PlatformQemuUser.cpp.

Referenced by GetDescription().

◆ GetPluginName()

llvm::StringRef lldb_private::PlatformQemuUser::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 23 of file PlatformQemuUser.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

static llvm::StringRef lldb_private::PlatformQemuUser::GetPluginNameStatic ( )
inlinestatic

Definition at line 20 of file PlatformQemuUser.h.

Referenced by GetPluginName().

◆ GetSupportedArchitectures()

std::vector< ArchSpec > PlatformQemuUser::GetSupportedArchitectures ( const ArchSpec process_host_arch)
overridevirtual

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

Parameters
[in]process_host_archThe process host architecture if it's known. An invalid ArchSpec represents that the process host architecture is unknown.

Implements lldb_private::Platform.

Definition at line 110 of file PlatformQemuUser.cpp.

References GetGlobalProperties().

◆ GetUserIDResolver()

UserIDResolver& lldb_private::PlatformQemuUser::GetUserIDResolver ( )
inlineoverridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 28 of file PlatformQemuUser.h.

◆ Initialize()

void PlatformQemuUser::Initialize ( )
static

Definition at line 83 of file PlatformQemuUser.cpp.

◆ IsConnected()

bool lldb_private::PlatformQemuUser::IsConnected ( ) const
inlineoverridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 45 of file PlatformQemuUser.h.

◆ Terminate()

void PlatformQemuUser::Terminate ( )
static

Definition at line 89 of file PlatformQemuUser.cpp.


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