LLDB mainline
|
#include <Platform.h>
Public Member Functions | |
PlatformList ()=default | |
~PlatformList ()=default | |
void | Append (const lldb::PlatformSP &platform_sp, bool set_selected) |
size_t | GetSize () |
lldb::PlatformSP | GetAtIndex (uint32_t idx) |
lldb::PlatformSP | GetSelectedPlatform () |
Select the active platform. | |
void | SetSelectedPlatform (const lldb::PlatformSP &platform_sp) |
lldb::PlatformSP | GetOrCreate (llvm::StringRef name) |
lldb::PlatformSP | GetOrCreate (const ArchSpec &arch, const ArchSpec &process_host_arch, ArchSpec *platform_arch_ptr, Status &error) |
lldb::PlatformSP | GetOrCreate (const ArchSpec &arch, const ArchSpec &process_host_arch, ArchSpec *platform_arch_ptr) |
lldb::PlatformSP | GetOrCreate (llvm::ArrayRef< ArchSpec > archs, const ArchSpec &process_host_arch, std::vector< lldb::PlatformSP > &candidates) |
Get the platform for the given list of architectures. | |
lldb::PlatformSP | Create (llvm::StringRef name) |
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. | |
Protected Types | |
typedef std::vector< lldb::PlatformSP > | collection |
Protected Attributes | |
std::recursive_mutex | m_mutex |
collection | m_platforms |
lldb::PlatformSP | m_selected_platform_sp |
Private Member Functions | |
PlatformList (const PlatformList &)=delete | |
const PlatformList & | operator= (const PlatformList &)=delete |
Definition at line 1066 of file Platform.h.
|
protected |
Definition at line 1176 of file Platform.h.
|
default |
|
default |
|
privatedelete |
|
inline |
Definition at line 1072 of file Platform.h.
References m_mutex, m_platforms, and m_selected_platform_sp.
Referenced by lldb_private::Debugger::Debugger().
PlatformSP PlatformList::Create | ( | llvm::StringRef | name | ) |
Definition at line 2228 of file Platform.cpp.
References lldb_private::Platform::Create(), m_mutex, and m_platforms.
Referenced by lldb_private::OptionGroupPlatform::CreatePlatformWithOptions(), DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(), and GetOrCreate().
|
inline |
Definition at line 1084 of file Platform.h.
References m_mutex, and m_platforms.
PlatformSP PlatformList::GetOrCreate | ( | const ArchSpec & | arch, |
const ArchSpec & | process_host_arch, | ||
ArchSpec * | platform_arch_ptr | ||
) |
Definition at line 2167 of file Platform.cpp.
References error(), GetOrCreate(), and lldb_private::ArchSpec::IsValid().
PlatformSP PlatformList::GetOrCreate | ( | const ArchSpec & | arch, |
const ArchSpec & | process_host_arch, | ||
ArchSpec * | platform_arch_ptr, | ||
Status & | error | ||
) |
Definition at line 2116 of file Platform.cpp.
References lldb_private::ArchSpec::Clear(), lldb_private::ArchSpec::CompatibleMatch, lldb_private::ArchSpec::ExactMatch, lldb_private::PluginManager::GetPlatformCreateCallbackAtIndex(), m_mutex, and m_platforms.
PlatformSP PlatformList::GetOrCreate | ( | llvm::ArrayRef< ArchSpec > | archs, |
const ArchSpec & | process_host_arch, | ||
std::vector< lldb::PlatformSP > & | candidates | ||
) |
Get the platform for the given list of architectures.
The algorithm works a follows:
If none of the above apply, this function returns a default platform. The candidates output argument differentiates between either no platforms supporting the given architecture or multiple platforms supporting the given architecture.
Definition at line 2176 of file Platform.cpp.
References lldb_private::ArchSpec::CompatibleMatch, lldb_private::Platform::GetHostPlatform(), GetOrCreate(), and m_selected_platform_sp.
PlatformSP PlatformList::GetOrCreate | ( | llvm::StringRef | name | ) |
Definition at line 2107 of file Platform.cpp.
References Create(), m_mutex, and m_platforms.
Referenced by lldb_private::Process::CompleteAttach(), lldb_private::OptionGroupPlatform::CreatePlatformWithOptions(), lldb_private::TargetList::CreateTargetInternal(), GetOrCreate(), and lldb::SBDebugger::SetCurrentPlatform().
|
inline |
Select the active platform.
In order to debug remotely, other platform's can be remotely connected to and set as the selected platform for any subsequent debugging. This allows connection to remote targets and allows the ability to discover process info, launch and attach to remote processes.
Definition at line 1100 of file Platform.h.
References m_mutex, m_platforms, and m_selected_platform_sp.
Referenced by lldb_private::Target::Attach(), lldb_private::TargetList::CreateTargetInternal(), CommandObjectPlatformStatus::DoExecute(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectPlatformProcessList::DoExecute(), CommandObjectPlatformProcessInfo::DoExecute(), lldb_private::CommandInterpreter::GetPlatform(), lldb_private::CommandCompletions::RemoteDiskDirectories(), and lldb_private::CommandCompletions::RemoteDiskFiles().
|
inline |
Definition at line 1079 of file Platform.h.
References m_mutex, and m_platforms.
bool PlatformList::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.
The binary will be loaded into the Target, or will be registered with the DynamicLoader so that it will be loaded at a later stage. Returns true to indicate that this is a platform binary and has been loaded/registered, no further action should be taken by the caller.
[in] | process | Process read memory from, a Process must be provided. |
[in] | addr | Address of a binary in memory. |
[in] | notify | Whether ModulesDidLoad should be called, if a binary is loaded. Caller may prefer to call ModulesDidLoad for multiple binaries that were loaded at the same time. |
Definition at line 2235 of file Platform.cpp.
References lldb_private::PluginManager::GetPlatformCreateCallbackAtIndex(), and m_mutex.
Referenced by ObjectFileMachO::LoadCoreFileImages().
|
privatedelete |
|
inline |
Definition at line 1108 of file Platform.h.
References m_mutex, m_platforms, and m_selected_platform_sp.
Referenced by lldb_private::OptionGroupPlatform::CreatePlatformWithOptions(), lldb_private::TargetList::CreateTargetInternal(), CommandObjectPlatformSelect::DoExecute(), and lldb::SBDebugger::SetCurrentPlatform().
|
mutableprotected |
Definition at line 1177 of file Platform.h.
Referenced by Append(), Create(), GetAtIndex(), GetOrCreate(), GetSelectedPlatform(), GetSize(), LoadPlatformBinaryAndSetup(), and SetSelectedPlatform().
|
protected |
Definition at line 1178 of file Platform.h.
Referenced by Append(), Create(), GetAtIndex(), GetOrCreate(), GetSelectedPlatform(), GetSize(), and SetSelectedPlatform().
|
protected |
Definition at line 1179 of file Platform.h.
Referenced by Append(), GetOrCreate(), GetSelectedPlatform(), and SetSelectedPlatform().