LLDB mainline
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | List of all members
lldb_private::PlatformList Class Reference

#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::PlatformSPcollection
 

Protected Attributes

std::recursive_mutex m_mutex
 
collection m_platforms
 
lldb::PlatformSP m_selected_platform_sp
 

Private Member Functions

 PlatformList (const PlatformList &)=delete
 
const PlatformListoperator= (const PlatformList &)=delete
 

Detailed Description

Definition at line 1026 of file Platform.h.

Member Typedef Documentation

◆ collection

Definition at line 1136 of file Platform.h.

Constructor & Destructor Documentation

◆ PlatformList() [1/2]

lldb_private::PlatformList::PlatformList ( )
default

◆ ~PlatformList()

lldb_private::PlatformList::~PlatformList ( )
default

◆ PlatformList() [2/2]

lldb_private::PlatformList::PlatformList ( const PlatformList )
privatedelete

Member Function Documentation

◆ Append()

void lldb_private::PlatformList::Append ( const lldb::PlatformSP platform_sp,
bool  set_selected 
)
inline

Definition at line 1032 of file Platform.h.

References m_mutex, m_platforms, and m_selected_platform_sp.

Referenced by lldb_private::Debugger::Debugger().

◆ Create()

PlatformSP PlatformList::Create ( llvm::StringRef  name)

◆ GetAtIndex()

lldb::PlatformSP lldb_private::PlatformList::GetAtIndex ( uint32_t  idx)
inline

Definition at line 1044 of file Platform.h.

References m_mutex, and m_platforms.

◆ GetOrCreate() [1/4]

PlatformSP PlatformList::GetOrCreate ( const ArchSpec arch,
const ArchSpec process_host_arch,
ArchSpec platform_arch_ptr 
)

Definition at line 2228 of file Platform.cpp.

References error(), GetOrCreate(), and lldb_private::ArchSpec::IsValid().

◆ GetOrCreate() [2/4]

PlatformSP PlatformList::GetOrCreate ( const ArchSpec arch,
const ArchSpec process_host_arch,
ArchSpec platform_arch_ptr,
Status error 
)

◆ GetOrCreate() [3/4]

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:

  1. Returns the selected platform if it matches any of the architectures.
  2. Returns the host platform if it matches any of the architectures.
  3. Returns the platform that matches all the architectures.

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 2237 of file Platform.cpp.

References lldb_private::ArchSpec::CompatibleMatch, lldb_private::Platform::GetHostPlatform(), GetOrCreate(), and m_selected_platform_sp.

◆ GetOrCreate() [4/4]

PlatformSP PlatformList::GetOrCreate ( llvm::StringRef  name)

◆ GetSelectedPlatform()

lldb::PlatformSP lldb_private::PlatformList::GetSelectedPlatform ( )
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 1060 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().

◆ GetSize()

size_t lldb_private::PlatformList::GetSize ( )
inline

Definition at line 1039 of file Platform.h.

References m_mutex, and m_platforms.

◆ LoadPlatformBinaryAndSetup()

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.

Parameters
[in]processProcess read memory from, a Process must be provided.
[in]addrAddress of a binary in memory.
[in]notifyWhether 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.
Returns
Returns true if the binary was loaded in the target (or will be via a DynamicLoader). Returns false if the binary was not loaded/registered, and the caller must load it into the target.

Definition at line 2296 of file Platform.cpp.

References lldb_private::PluginManager::GetPlatformCreateCallbackAtIndex(), and m_mutex.

Referenced by ObjectFileMachO::LoadCoreFileImages().

◆ operator=()

const PlatformList & lldb_private::PlatformList::operator= ( const PlatformList )
privatedelete

◆ SetSelectedPlatform()

void lldb_private::PlatformList::SetSelectedPlatform ( const lldb::PlatformSP platform_sp)
inline

Member Data Documentation

◆ m_mutex

std::recursive_mutex lldb_private::PlatformList::m_mutex
mutableprotected

◆ m_platforms

collection lldb_private::PlatformList::m_platforms
protected

◆ m_selected_platform_sp

lldb::PlatformSP lldb_private::PlatformList::m_selected_platform_sp
protected

Definition at line 1139 of file Platform.h.

Referenced by Append(), GetOrCreate(), GetSelectedPlatform(), and SetSelectedPlatform().


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