LLDB mainline
DynamicLoaderAcceleratorGDBRemote Class Reference

Dynamic loader for accelerator targets whose library changes are reported by the remote server instead of discovered through a rendezvous breakpoint. More...

#include <DynamicLoaderAcceleratorGDBRemote.h>

Inheritance diagram for DynamicLoaderAcceleratorGDBRemote:
[legend]

Public Member Functions

 DynamicLoaderAcceleratorGDBRemote (lldb_private::Process *process)
void DidAttach () override
 Called after attaching a process.
void DidLaunch () override
 Called after launching a process.
bool HandleStopReasonDynamicLoader () override
 Allow the dynamic loader to handle a request to update loaded modules.
lldb::ThreadPlanSP GetStepThroughTrampolinePlan (lldb_private::Thread &thread, bool stop_others) override
 Provides a plan to step through the dynamic loader trampoline for the current state of thread.
lldb_private::Status CanLoadImage () override
 Ask if it is ok to try and load or unload an shared library (image).
llvm::StringRef GetPluginName () override
Public Member Functions inherited from lldb_private::DynamicLoader
 DynamicLoader (Process *process)
 Construct with a process.
virtual bool ProcessDidExec ()
 Helper function that can be used to detect when a process has called exec and is now a new and different process.
bool GetStopWhenImagesChange () const
 Get whether the process should stop when images change.
void SetStopWhenImagesChange (bool stop)
 Set whether the process should stop when images change.
virtual void FindEquivalentSymbols (const Symbol *original_symbol, ModuleList &module_list, SymbolContextList &equivalent_symbols)
 Some dynamic loaders provide features where there are a group of symbols "equivalent to" a given symbol one of which will be chosen when the symbol is bound.
virtual bool AlwaysRelyOnEHUnwindInfo (SymbolContext &sym_ctx)
 Ask if the eh_frame information for the given SymbolContext should be relied on even when it's the first frame in a stack unwind.
virtual lldb::addr_t GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr)
 Retrieves the per-module TLS block for a given thread.
virtual lldb::ModuleSP LoadModuleAtAddress (const lldb_private::FileSpec &file, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset)
 Locates or creates a module given by file and updates/loads the resulting module at the virtual base address base_addr.
virtual bool GetSharedCacheInformation (lldb::addr_t &base_address, UUID &uuid, LazyBool &using_shared_cache, LazyBool &private_shared_cache, lldb_private::FileSpec &shared_cache_path, std::optional< uint64_t > &size)
 Get information about the shared cache for a process, if possible.
virtual bool IsFullyInitialized ()
 Return whether the dynamic loader is fully initialized and it's safe to call its APIs.
virtual std::optional< lldb_private::Address > GetStartAddress ()
 Return the start address in the dynamic loader module.
virtual void CalculateDynamicSaveCoreRanges (lldb_private::Process &process, std::vector< lldb_private::MemoryRegionInfo > &ranges, llvm::function_ref< bool(const lldb_private::Thread &)> save_thread_predicate)
 Returns a list of memory ranges that should be saved in the core file, specific for this dynamic loader.
Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
virtual ~PluginInterface ()=default
 PluginInterface (const PluginInterface &)=delete
PluginInterface & operator= (const PluginInterface &)=delete

Static Public Member Functions

static void Initialize ()
static void Terminate ()
static llvm::StringRef GetPluginNameStatic ()
static llvm::StringRef GetPluginDescriptionStatic ()
static lldb_private::DynamicLoader * CreateInstance (lldb_private::Process *process, bool force)
Static Public Member Functions inherited from lldb_private::DynamicLoader
static DynamicLoader * FindPlugin (Process *process, llvm::StringRef plugin_name)
 Find a dynamic loader plugin for a given process.
static llvm::Expected< lldb::ModuleSP > LocateAndLoadBinary (Process *process, BinarySpec &bin_spec)
 Find a binary and load it into a Target.
static void LocateBinaries (Process *process, llvm::MutableArrayRef< BinarySpec > bin_specs)
 Search for a batch of binaries, without mutating the Target.
static llvm::Expected< lldb::ModuleSP > LoadBinaryInTarget (Process *process, BinarySpec &bin_spec)
 Add a binary that LocateBinaries searched for to the Target, and set its load address.

Private Member Functions

bool LoadModulesFromGDBServer (bool full)
 Returns true if the server answered the packet.

Additional Inherited Members

Protected Member Functions inherited from lldb_private::DynamicLoader
lldb::ModuleSP FindModuleViaTarget (const ModuleSpec &module_spec)
 Find a module in the target that matches the given module spec.
lldb::ModuleSP GetTargetExecutable ()
 Checks to see if the target module has changed, updates the target accordingly and returns the target executable module.
virtual void UpdateLoadedSections (lldb::ModuleSP module, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset)
 Updates the load address of every allocatable section in module.
void UpdateLoadedSectionsCommon (lldb::ModuleSP module, lldb::addr_t base_addr, bool base_addr_is_offset)
virtual void UnloadSections (const lldb::ModuleSP module)
 Removes the loaded sections from the target in module.
void UnloadSectionsCommon (const lldb::ModuleSP module)
const lldb_private::SectionList * GetSectionListFromModule (const lldb::ModuleSP module) const
int64_t ReadUnsignedIntWithSizeInBytes (lldb::addr_t addr, int size_in_bytes)
lldb::addr_t ReadPointer (lldb::addr_t addr)
void LoadOperatingSystemPlugin (bool flush)
Protected Attributes inherited from lldb_private::DynamicLoader
Process * m_process
 The process that this dynamic loader plug-in is tracking.

Detailed Description

Dynamic loader for accelerator targets whose library changes are reported by the remote server instead of discovered through a rendezvous breakpoint.

It obtains load and unload information through jAcceleratorPluginGetDynamicLoaderLibraryInfo.

Definition at line 19 of file DynamicLoaderAcceleratorGDBRemote.h.

Constructor & Destructor Documentation

◆ DynamicLoaderAcceleratorGDBRemote()

DynamicLoaderAcceleratorGDBRemote::DynamicLoaderAcceleratorGDBRemote ( lldb_private::Process * process)

Member Function Documentation

◆ CanLoadImage()

Status DynamicLoaderAcceleratorGDBRemote::CanLoadImage ( )
overridevirtual

Ask if it is ok to try and load or unload an shared library (image).

The dynamic loader often knows when it would be ok to try and load or unload a shared library. This function call allows the dynamic loader plug-ins to check any current dyld state to make sure it is an ok time to load a shared library.

Returns
true if it is currently ok to try and load a shared library into the process, false otherwise.

Implements lldb_private::DynamicLoader.

Definition at line 201 of file DynamicLoaderAcceleratorGDBRemote.cpp.

References lldb_private::Status::FromErrorString().

◆ CreateInstance()

◆ DidAttach()

void DynamicLoaderAcceleratorGDBRemote::DidAttach ( )
overridevirtual

Called after attaching a process.

Allow DynamicLoader plug-ins to execute some code after attaching to a process.

Implements lldb_private::DynamicLoader.

Definition at line 41 of file DynamicLoaderAcceleratorGDBRemote.cpp.

References LoadModulesFromGDBServer().

◆ DidLaunch()

void DynamicLoaderAcceleratorGDBRemote::DidLaunch ( )
overridevirtual

Called after launching a process.

Allow DynamicLoader plug-ins to execute some code after the process has stopped for the first time on launch.

Implements lldb_private::DynamicLoader.

Definition at line 45 of file DynamicLoaderAcceleratorGDBRemote.cpp.

References LoadModulesFromGDBServer().

◆ GetPluginDescriptionStatic()

llvm::StringRef DynamicLoaderAcceleratorGDBRemote::GetPluginDescriptionStatic ( )
static

Definition at line 215 of file DynamicLoaderAcceleratorGDBRemote.cpp.

Referenced by Initialize().

◆ GetPluginName()

llvm::StringRef DynamicLoaderAcceleratorGDBRemote::GetPluginName ( )
inlineoverridevirtual

◆ GetPluginNameStatic()

llvm::StringRef DynamicLoaderAcceleratorGDBRemote::GetPluginNameStatic ( )
inlinestatic

Definition at line 25 of file DynamicLoaderAcceleratorGDBRemote.h.

Referenced by GetPluginName(), and Initialize().

◆ GetStepThroughTrampolinePlan()

ThreadPlanSP DynamicLoaderAcceleratorGDBRemote::GetStepThroughTrampolinePlan ( lldb_private::Thread & thread,
bool stop_others )
overridevirtual

Provides a plan to step through the dynamic loader trampoline for the current state of thread.

Parameters
[in]stop_othersWhether the plan should be set to stop other threads.
Returns
A pointer to the plan (caller owned) or NULL if we are not at such a trampoline.

Implements lldb_private::DynamicLoader.

Definition at line 196 of file DynamicLoaderAcceleratorGDBRemote.cpp.

◆ HandleStopReasonDynamicLoader()

bool DynamicLoaderAcceleratorGDBRemote::HandleStopReasonDynamicLoader ( )
overridevirtual

Allow the dynamic loader to handle a request to update loaded modules.

This is intended for dynamic loaders that rely on notifications from a driver or debug service instead of a rendezvous breakpoint.

Returns
True if shared-library loading was handled, false otherwise.

Reimplemented from lldb_private::DynamicLoader.

Definition at line 49 of file DynamicLoaderAcceleratorGDBRemote.cpp.

References LoadModulesFromGDBServer().

◆ Initialize()

void DynamicLoaderAcceleratorGDBRemote::Initialize ( )
static

◆ LoadModulesFromGDBServer()

bool DynamicLoaderAcceleratorGDBRemote::LoadModulesFromGDBServer ( bool full)
private

Returns true if the server answered the packet.

Definition at line 53 of file DynamicLoaderAcceleratorGDBRemote.cpp.

References lldb_private::ModuleList::AppendIfNeeded(), lldb_private::Continue, lldb_private::DynamicLoader, error(), lldb_private::AcceleratorDynamicLoaderLibraryInfo::file_offset, lldb_private::AcceleratorDynamicLoaderLibraryInfo::file_size, lldb_private::ModuleList::FindModules(), lldb_private::ModuleList::ForEach(), lldb_private::AcceleratorDynamicLoaderArgs::full, lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetAcceleratorDynamicLoaderLibraryInfos(), lldb_private::Target::GetFirstTargetGroupOfType(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBRemote(), lldb_private::Target::GetImages(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetLLDBSettings(), lldb_private::GetLog(), lldb_private::Target::GetOrCreateModule(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetPluginNameStatic(), LLDB_LOG, lldb_private::AcceleratorDynamicLoaderLibraryInfo::load, lldb_private::AcceleratorDynamicLoaderLibraryInfo::load_address, lldb_private::AcceleratorSectionInfo::load_address, lldb_private::AcceleratorDynamicLoaderLibraryInfo::loaded_sections, lldb_private::DynamicLoader::m_process, lldb_private::Target::ModulesDidLoad(), lldb_private::Target::ModulesDidUnload(), lldb_private::AcceleratorSectionInfo::names, lldb_private::AcceleratorDynamicLoaderLibraryInfo::native_memory_address, lldb_private::AcceleratorDynamicLoaderLibraryInfo::native_memory_size, lldb_private::AcceleratorDynamicLoaderLibraryInfo::pathname, lldb_private::AcceleratorDynamicLoaderArgs::plugin_name, lldb_private::UUID::SetFromStringRef(), lldb_private::ModuleSpec::SetObjectOffset(), lldb_private::ModuleSpec::SetObjectSize(), lldb_private::Target::SetSectionLoadAddress(), lldb_private::DynamicLoader::UnloadSections(), and lldb_private::AcceleratorDynamicLoaderLibraryInfo::uuid_str.

Referenced by DidAttach(), DidLaunch(), and HandleStopReasonDynamicLoader().

◆ Terminate()

void DynamicLoaderAcceleratorGDBRemote::Terminate ( )
static

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