LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
PlatformDarwin Class Reference

#include <PlatformDarwin.h>

Inheritance diagram for PlatformDarwin:
Inheritance graph
[legend]
Collaboration diagram for PlatformDarwin:
Collaboration graph
[legend]

Classes

struct  CrashInfoAnnotations
 
struct  SDKEnumeratorInfo
 

Public Member Functions

 PlatformDarwin (bool is_host)
 Default Constructor. More...
 
 ~PlatformDarwin () override
 Destructor. More...
 
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 ResolveSymbolFile (lldb_private::Target &target, const lldb_private::ModuleSpec &sym_spec, lldb_private::FileSpec &sym_file) override
 Find a symbol file given a symbol file module specification. More...
 
lldb_private::FileSpecList LocateExecutableScriptingResources (lldb_private::Target *target, lldb_private::Module &module, lldb_private::Stream *feedback_stream) override
 
lldb_private::Status GetSharedModule (const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr) override
 
size_t GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target, lldb_private::BreakpointSite *bp_site) override
 
lldb::BreakpointSP SetThreadCreationBreakpoint (lldb_private::Target &target) override
 
bool ModuleIsExcludedForUnconstrainedSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp) override
 
bool ARMGetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch)
 The architecture selection rules for arm processors These cpu subtypes have distinct names (e.g. More...
 
bool x86GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch)
 
uint32_t GetResumeCountForLaunchInfo (lldb_private::ProcessLaunchInfo &launch_info) override
 
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...
 
void CalculateTrapHandlerSymbolNames () override
 Ask the Platform subclass to fill in the list of trap handler names. More...
 
llvm::VersionTuple GetOSVersion (lldb_private::Process *process=nullptr) override
 Get the OS version from a connected platform. More...
 
bool SupportsModules () override
 
lldb_private::ConstString GetFullNameForDylib (lldb_private::ConstString basename) override
 
lldb_private::FileSpec LocateExecutable (const char *basename) override
 Find a support executable that may not live within in the standard locations related to LLDB. More...
 
lldb_private::Status LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override
 Launch a new process on a platform, not necessarily for debugging, it could be just for running the process. More...
 
llvm::Expected< lldb_private::StructuredData::DictionarySPFetchExtendedCrashInformation (lldb_private::Process &process) override
 Gather all of crash informations into a structured data dictionary. More...
 
- 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...
 
bool GetRemoteOSVersion () override
 
bool GetRemoteOSBuildString (std::string &s) override
 
bool GetRemoteOSKernelDescription (std::string &s) 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 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
 Destructor. More...
 
virtual bool ResolveRemotePath (const FileSpec &platform_path, FileSpec &resolved_platform_path)
 Resolves the FileSpec to a (possibly) remote path. More...
 
bool SetOSVersion (llvm::VersionTuple os_version)
 
bool GetOSBuildString (std::string &s)
 
bool GetOSKernelDescription (std::string &s)
 
ConstString GetName ()
 
virtual const char * GetDescription ()=0
 
virtual void GetStatus (Stream &strm)
 Report the current status for this platform. More...
 
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 GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)=0
 Get the platform's supported architectures in the order in which they should be searched. 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 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::ProcessSP ConnectProcessSynchronous (llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Stream &stream, Target *target, Status &error)
 
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 void AddClangModuleCompilationOptions (Target *target, std::vector< std::string > &options)
 
FileSpec GetWorkingDirectory ()
 
bool SetWorkingDirectory (const FileSpec &working_dir)
 
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 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 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 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...
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual ConstString GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static std::tuple< llvm::VersionTuple, llvm::StringRef > ParseVersionBuildDir (llvm::StringRef str)
 
static lldb_private::FileSpec GetCurrentToolchainDirectory ()
 Return the toolchain directory the current LLDB instance is located in. More...
 
static lldb_private::FileSpec GetCurrentCommandLineToolsDirectory ()
 Return the command line tools directory the current LLDB instance is located in. More...
 
- 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

lldb_private::StructuredData::ArraySP ExtractCrashInfoAnnotations (lldb_private::Process &process)
 Extract the __crash_info annotations from each of of the target's modules. More...
 
void ReadLibdispatchOffsetsAddress (lldb_private::Process *process)
 
void ReadLibdispatchOffsets (lldb_private::Process *process)
 
virtual lldb_private::Status GetSharedModuleWithLocalCache (const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr)
 
void AddClangModuleCompilationOptionsForSDKType (lldb_private::Target *target, std::vector< std::string > &options, lldb_private::XcodeSDK::Type sdk_type)
 
lldb_private::Status FindBundleBinaryInExecSearchPaths (const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr)
 
- 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)
 
virtual llvm::StringRef GetLibdlFunctionDeclarations (lldb_private::Process *process)
 
- 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, 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 ()
 

Static Protected Member Functions

static lldb_private::FileSystem::EnumerateDirectoryResult DirectoryEnumerator (void *baton, llvm::sys::fs::file_type file_type, llvm::StringRef path)
 
static lldb_private::FileSpec FindSDKInXcodeForModules (lldb_private::XcodeSDK::Type sdk_type, const lldb_private::FileSpec &sdks_spec)
 
static lldb_private::FileSpec GetSDKDirectoryForModules (lldb_private::XcodeSDK::Type sdk_type)
 
static std::string FindComponentInPath (llvm::StringRef path, llvm::StringRef component)
 

Protected Attributes

std::string m_developer_directory
 
llvm::StringMap< std::stringm_sdk_path
 
std::mutex m_sdk_path_mutex
 
- 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
 

Private Member Functions

 PlatformDarwin (const PlatformDarwin &)=delete
 
const PlatformDarwinoperator= (const PlatformDarwin &)=delete
 

Additional Inherited Members

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

Detailed Description

Definition at line 25 of file PlatformDarwin.h.

Constructor & Destructor Documentation

◆ PlatformDarwin() [1/2]

PlatformDarwin::PlatformDarwin ( bool  is_host)

Default Constructor.

Definition at line 51 of file PlatformDarwin.cpp.

◆ ~PlatformDarwin()

PlatformDarwin::~PlatformDarwin ( )
overridedefault

Destructor.

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

◆ PlatformDarwin() [2/2]

PlatformDarwin::PlatformDarwin ( const PlatformDarwin )
privatedelete

Member Function Documentation

◆ AddClangModuleCompilationOptionsForSDKType()

void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType ( lldb_private::Target target,
std::vector< std::string > &  options,
lldb_private::XcodeSDK::Type  sdk_type 
)
protected

◆ ARMGetSupportedArchitectureAtIndex()

bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex ( uint32_t  idx,
lldb_private::ArchSpec arch 
)

◆ CalculateTrapHandlerSymbolNames()

void PlatformDarwin::CalculateTrapHandlerSymbolNames ( )
overridevirtual

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 1253 of file PlatformDarwin.cpp.

References lldb_private::Platform::m_trap_handlers.

◆ DebugProcess()

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

Subclasses do not need to implement this function as it uses the Platform::LaunchProcess() followed by Platform::Attach ().

Remote platforms will want to subclass this function in order to be able to intercept STDIO and possibly launch a separate process that will debug the debuggee.

Reimplemented from lldb_private::Platform.

Definition at line 1229 of file PlatformDarwin.cpp.

References error(), lldb_private::Platform::IsHost(), lldb_private::RemoteAwarePlatform::m_remote_platform_sp, and lldb_private::ProcessLaunchInfo::SetMonitorProcessCallback().

◆ DirectoryEnumerator()

FileSystem::EnumerateDirectoryResult PlatformDarwin::DirectoryEnumerator ( void *  baton,
llvm::sys::fs::file_type  file_type,
llvm::StringRef  path 
)
staticprotected

◆ ExtractCrashInfoAnnotations()

StructuredData::ArraySP PlatformDarwin::ExtractCrashInfoAnnotations ( lldb_private::Process process)
protected

Extract the __crash_info annotations from each of of the target's modules.

If the platform have a crashed processes with a __crash_info section, extract the section to gather the messages annotations and the abort cause.

Parameters
[in]processThe crashed process.
Returns
A structured data array containing at each entry in each entry, the module spec, its UUID, the crash messages and the abort cause. nullptr if process has no crash information annotations.

Definition at line 1407 of file PlatformDarwin.cpp.

References PlatformDarwin::CrashInfoAnnotations::abort_cause, error(), lldb_private::SectionList::FindSectionByName(), lldb_private::Target::GetImages(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::Process::GetTarget(), LIBLLDB_LOG_PROCESS, LLDB_INVALID_ADDRESS, LLDB_LOG, message(), PlatformDarwin::CrashInfoAnnotations::message, PlatformDarwin::CrashInfoAnnotations::message2, lldb_private::ModuleList::Modules(), lldb_private::Process::ReadCStringFromMemory(), lldb_private::Process::ReadMemoryFromInferior(), string(), and PlatformDarwin::CrashInfoAnnotations::version.

Referenced by FetchExtendedCrashInformation().

◆ FetchExtendedCrashInformation()

llvm::Expected< StructuredData::DictionarySP > PlatformDarwin::FetchExtendedCrashInformation ( lldb_private::Process process)
overridevirtual

Gather all of crash informations into a structured data dictionary.

If the platform have a crashed process with crash information entries, gather all the entries into an structured data dictionary or return a nullptr. This dictionary is generic and extensible, as it contains an array for each different type of crash information.

Parameters
[in]processThe crashed process.
Returns
A structured data dictionary containing at each entry, the crash information type as the entry key and the matching an array as the entry value. nullptr if not implemented or if the process has no crash information entry. error if an error occured.

Reimplemented from lldb_private::Platform.

Definition at line 1388 of file PlatformDarwin.cpp.

References ExtractCrashInfoAnnotations(), lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_PROCESS, and LLDB_LOG.

◆ FindBundleBinaryInExecSearchPaths()

lldb_private::Status PlatformDarwin::FindBundleBinaryInExecSearchPaths ( const lldb_private::ModuleSpec module_spec,
lldb_private::Process process,
lldb::ModuleSP &  module_sp,
const lldb_private::FileSpecList *  module_search_paths_ptr,
llvm::SmallVectorImpl< lldb::ModuleSP > *  old_modules,
bool *  did_create_ptr 
)
protected

◆ FindComponentInPath()

std::string PlatformDarwin::FindComponentInPath ( llvm::StringRef  path,
llvm::StringRef  component 
)
staticprotected

◆ FindSDKInXcodeForModules()

FileSpec PlatformDarwin::FindSDKInXcodeForModules ( lldb_private::XcodeSDK::Type  sdk_type,
const lldb_private::FileSpec sdks_spec 
)
staticprotected

◆ GetCurrentCommandLineToolsDirectory()

FileSpec PlatformDarwin::GetCurrentCommandLineToolsDirectory ( )
static

Return the command line tools directory the current LLDB instance is located in.

Definition at line 1821 of file PlatformDarwin.cpp.

References FindComponentInPath().

◆ GetCurrentToolchainDirectory()

FileSpec PlatformDarwin::GetCurrentToolchainDirectory ( )
static

Return the toolchain directory the current LLDB instance is located in.

Definition at line 1815 of file PlatformDarwin.cpp.

References FindComponentInPath().

◆ GetFullNameForDylib()

ConstString PlatformDarwin::GetFullNameForDylib ( lldb_private::ConstString  basename)
overridevirtual

◆ GetOSVersion()

llvm::VersionTuple PlatformDarwin::GetOSVersion ( lldb_private::Process process = nullptr)
overridevirtual

Get the OS version from a connected platform.

Some platforms might not be connected to a remote platform, but can figure out the OS version for a process. This is common for simulator platforms that will run native programs on the current host, but the simulator might be simulating a different OS. The process parameter might be specified to help to determine the OS version.

Reimplemented from lldb_private::Platform.

Definition at line 1621 of file PlatformDarwin.cpp.

References lldb_private::ProcessInfo::GetEnvironment(), lldb_private::Process::GetID(), lldb_private::PluginInterface::GetPluginName(), lldb_private::ApplePropertyList::GetValueAsString(), and string().

Referenced by AddClangModuleCompilationOptionsForSDKType(), and PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion().

◆ GetResumeCountForLaunchInfo()

uint32_t PlatformDarwin::GetResumeCountForLaunchInfo ( lldb_private::ProcessLaunchInfo launch_info)
overridevirtual

◆ GetSDKDirectoryForModules()

FileSpec PlatformDarwin::GetSDKDirectoryForModules ( lldb_private::XcodeSDK::Type  sdk_type)
staticprotected

◆ GetSharedModule()

Status PlatformDarwin::GetSharedModule ( const lldb_private::ModuleSpec module_spec,
lldb_private::Process process,
lldb::ModuleSP &  module_sp,
const lldb_private::FileSpecList *  module_search_paths_ptr,
llvm::SmallVectorImpl< lldb::ModuleSP > *  old_modules,
bool *  did_create_ptr 
)
override

◆ GetSharedModuleWithLocalCache()

lldb_private::Status PlatformDarwin::GetSharedModuleWithLocalCache ( const lldb_private::ModuleSpec module_spec,
lldb::ModuleSP &  module_sp,
const lldb_private::FileSpecList *  module_search_paths_ptr,
llvm::SmallVectorImpl< lldb::ModuleSP > *  old_modules,
bool *  did_create_ptr 
)
protectedvirtual

◆ GetSoftwareBreakpointTrapOpcode()

size_t PlatformDarwin::GetSoftwareBreakpointTrapOpcode ( lldb_private::Target target,
lldb_private::BreakpointSite bp_site 
)
overridevirtual

◆ LaunchProcess()

lldb_private::Status PlatformDarwin::LaunchProcess ( lldb_private::ProcessLaunchInfo launch_info)
overridevirtual

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

Reimplemented from lldb_private::RemoteAwarePlatform.

Definition at line 1705 of file PlatformDarwin.cpp.

References lldb_private::ProcessInfo::GetEnvironment(), and lldb_private::RemoteAwarePlatform::LaunchProcess().

◆ LocateExecutable()

lldb_private::FileSpec PlatformDarwin::LocateExecutable ( const char *  basename)
overridevirtual

Find a support executable that may not live within in the standard locations related to LLDB.

Executable might exist within the Platform SDK directories, or in standard tool directories within the current IDE that is running LLDB.

Parameters
[in]basenameThe basename of the executable to locate in the current platform.
Returns
A FileSpec pointing to the executable on disk, or an invalid FileSpec if the executable cannot be found.

Reimplemented from lldb_private::Platform.

Definition at line 1652 of file PlatformDarwin.cpp.

References lldb_private::FileSpec::AppendPathComponent(), GetCommandLineToolsLibraryPath(), lldb_private::FileSpec::GetDirectory(), lldb_private::FileSpec::GetFilename(), lldb_private::FileSpec::GetPath(), and lldb_private::ConstString::SetCString().

◆ LocateExecutableScriptingResources()

FileSpecList PlatformDarwin::LocateExecutableScriptingResources ( lldb_private::Target target,
lldb_private::Module module,
lldb_private::Stream feedback_stream 
)
overridevirtual

◆ ModuleIsExcludedForUnconstrainedSearches()

bool PlatformDarwin::ModuleIsExcludedForUnconstrainedSearches ( lldb_private::Target target,
const lldb::ModuleSP &  module_sp 
)
overridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 504 of file PlatformDarwin.cpp.

References lldb_private::ObjectFile::GetType().

◆ operator=()

const PlatformDarwin& PlatformDarwin::operator= ( const PlatformDarwin )
privatedelete

◆ ParseVersionBuildDir()

std::tuple< llvm::VersionTuple, llvm::StringRef > PlatformDarwin::ParseVersionBuildDir ( llvm::StringRef  str)
static

◆ PutFile()

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

◆ ReadLibdispatchOffsets()

void PlatformDarwin::ReadLibdispatchOffsets ( lldb_private::Process process)
protected

◆ ReadLibdispatchOffsetsAddress()

void PlatformDarwin::ReadLibdispatchOffsetsAddress ( lldb_private::Process process)
protected

◆ ResolveSymbolFile()

Status PlatformDarwin::ResolveSymbolFile ( lldb_private::Target target,
const lldb_private::ModuleSpec sym_spec,
lldb_private::FileSpec sym_file 
)
overridevirtual

Find a symbol file given a symbol file module specification.

Each platform might have tricks to find symbol files for an executable given information in a symbol file ModuleSpec. Some platforms might also support symbol files that are bundles and know how to extract the right symbol file given a bundle.

Parameters
[in]targetThe target in which we are trying to resolve the symbol file. The target has a list of modules that we might be able to use in order to help find the right symbol file. If the "m_file" or "m_platform_file" entries in the sym_spec are filled in, then we might be able to locate a module in the target, extract its UUID and locate a symbol file. If just the "m_uuid" is specified, then we might be able to find the module in the target that matches that UUID and pair the symbol file along with it. If just "m_symbol_file" is specified, we can use a variety of tricks to locate the symbols in an SDK, PDK, or other development kit location.
[in]sym_specA module spec that describes some information about the symbol file we are trying to resolve. The ModuleSpec might contain the following: m_file - A full or partial path to an executable from the target (might be empty). m_platform_file - Another executable hint that contains the path to the file as known on the local/remote platform. m_symbol_file - A full or partial path to a symbol file or symbol bundle that should be used when trying to resolve the symbol file. m_arch - The architecture we are looking for when resolving the symbol file. m_uuid - The UUID of the executable and symbol file. This can often be used to match up an executable with a symbol file, or resolve an symbol file in a symbol file bundle.
[out]sym_fileThe resolved symbol file spec if the returned error indicates success.
Returns
Returns an error that describes success or failure.

Reimplemented from lldb_private::Platform.

Definition at line 194 of file PlatformDarwin.cpp.

References lldb_private::ModuleSpec::GetArchitecturePtr(), lldb_private::ModuleSpec::GetSymbolFileSpec(), and lldb_private::ModuleSpec::GetUUIDPtr().

◆ SetThreadCreationBreakpoint()

BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint ( lldb_private::Target target)
overridevirtual

◆ SupportsModules()

bool PlatformDarwin::SupportsModules ( )
inlineoverridevirtual

Reimplemented from lldb_private::Platform.

Definition at line 82 of file PlatformDarwin.h.

◆ x86GetSupportedArchitectureAtIndex()

bool PlatformDarwin::x86GetSupportedArchitectureAtIndex ( uint32_t  idx,
lldb_private::ArchSpec arch 
)

Member Data Documentation

◆ m_developer_directory

std::string PlatformDarwin::m_developer_directory
protected

Definition at line 172 of file PlatformDarwin.h.

◆ m_sdk_path

llvm::StringMap<std::string> PlatformDarwin::m_sdk_path
protected

Definition at line 173 of file PlatformDarwin.h.

◆ m_sdk_path_mutex

std::mutex PlatformDarwin::m_sdk_path_mutex
protected

Definition at line 174 of file PlatformDarwin.h.


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