LLDB mainline
|
Interface to the runtime linker. More...
#include <HexagonDYLDRendezvous.h>
Classes | |
struct | Rendezvous |
struct | SOEntry |
Structure representing the shared objects currently loaded into the inferior process. More... | |
struct | ThreadInfo |
Public Types | |
enum | RendezvousState { eConsistent = 0 , eAdd , eDelete } |
Constants describing the state of the rendezvous. More... | |
typedef SOEntryList::const_iterator | iterator |
Public Member Functions | |
HexagonDYLDRendezvous (lldb_private::Process *process) | |
bool | Resolve () |
Update the internal snapshot of runtime linker rendezvous and recompute the currently loaded modules. | |
bool | IsValid () |
lldb::addr_t | GetRendezvousAddress () const |
void | SetRendezvousAddress (lldb::addr_t) |
Provide the dyld structure address. | |
uint64_t | GetVersion () const |
lldb::addr_t | GetLinkMapAddress () const |
lldb::addr_t | GetBreakAddress () const |
A breakpoint should be set at this address and Resolve called on each hit. | |
void | SetBreakAddress (lldb::addr_t addr) |
In hexagon it is possible that we can know the dyld breakpoint without having to find it from the rendezvous structure. | |
uint64_t | GetState () const |
Returns the current state of the rendezvous structure. | |
lldb::addr_t | GetLDBase () const |
const ThreadInfo & | GetThreadInfo () |
bool | ModulesDidLoad () const |
bool | ModulesDidUnload () const |
void | DumpToLog (lldb_private::Log *log) const |
iterator | begin () const |
Iterators over all currently loaded modules. | |
iterator | end () const |
iterator | loaded_begin () const |
Iterators over all modules loaded into the inferior since the last call to Resolve(). | |
iterator | loaded_end () const |
iterator | unloaded_begin () const |
Iterators over all modules unloaded from the inferior since the last call to Resolve(). | |
iterator | unloaded_end () const |
Protected Types | |
enum | PThreadField { eSize , eNElem , eOffset } |
typedef std::list< SOEntry > | SOEntryList |
Protected Member Functions | |
lldb::addr_t | ReadWord (lldb::addr_t addr, uint64_t *dst, size_t size) |
Reads an unsigned integer of size bytes from the inferior's address space starting at addr . | |
lldb::addr_t | ReadPointer (lldb::addr_t addr, lldb::addr_t *dst) |
Reads an address from the inferior's address space starting at addr . | |
std::string | ReadStringFromMemory (lldb::addr_t addr) |
Reads a null-terminated C string from the memory location starting at addr . | |
bool | ReadSOEntryFromMemory (lldb::addr_t addr, SOEntry &entry) |
Reads an SOEntry starting at addr . | |
bool | UpdateSOEntries () |
Updates the current set of SOEntries, the set of added entries, and the set of removed entries. | |
bool | UpdateSOEntriesForAddition () |
bool | UpdateSOEntriesForDeletion () |
bool | TakeSnapshot (SOEntryList &entry_list) |
Reads the current list of shared objects according to the link map supplied by the runtime linker. | |
bool | FindMetadata (const char *name, PThreadField field, uint32_t &value) |
Protected Attributes | |
lldb_private::Process * | m_process |
char | m_exe_path [PATH_MAX] |
lldb::addr_t | m_rendezvous_addr |
Location of the r_debug structure in the inferiors address space. | |
Rendezvous | m_current |
Current and previous snapshots of the rendezvous structure. | |
Rendezvous | m_previous |
SOEntryList | m_soentries |
List of SOEntry objects corresponding to the current link map state. | |
SOEntryList | m_added_soentries |
List of SOEntry's added to the link map since the last call to Resolve(). | |
SOEntryList | m_removed_soentries |
List of SOEntry's removed from the link map since the last call to Resolve(). | |
ThreadInfo | m_thread_info |
Threading metadata read from the inferior. |
Interface to the runtime linker.
A structure is present in a processes memory space which is updated by the runtime liker each time a module is loaded or unloaded. This class provides an interface to this structure and maintains a consistent snapshot of the currently loaded modules.
Definition at line 31 of file HexagonDYLDRendezvous.h.
typedef SOEntryList::const_iterator HexagonDYLDRendezvous::iterator |
Definition at line 165 of file HexagonDYLDRendezvous.h.
|
protected |
Definition at line 162 of file HexagonDYLDRendezvous.h.
|
protected |
Enumerator | |
---|---|
eSize | |
eNElem | |
eOffset |
Definition at line 239 of file HexagonDYLDRendezvous.h.
Constants describing the state of the rendezvous.
Enumerator | |
---|---|
eConsistent | |
eAdd | |
eDelete |
Definition at line 126 of file HexagonDYLDRendezvous.h.
HexagonDYLDRendezvous::HexagonDYLDRendezvous | ( | lldb_private::Process * | process | ) |
Definition at line 45 of file HexagonDYLDRendezvous.cpp.
References lldb_private::Module::GetFileSpec(), lldb_private::FileSpec::GetPath(), LLDB_INVALID_ADDRESS, m_added_soentries, m_current, m_exe_path, m_previous, m_process, m_removed_soentries, m_rendezvous_addr, m_soentries, m_thread_info, and PATH_MAX.
|
inline |
Iterators over all currently loaded modules.
Definition at line 168 of file HexagonDYLDRendezvous.h.
References m_soentries.
Referenced by DumpToLog(), and UpdateSOEntriesForDeletion().
void HexagonDYLDRendezvous::DumpToLog | ( | lldb_private::Log * | log | ) | const |
Definition at line 335 of file HexagonDYLDRendezvous.cpp.
References begin(), eAdd, eConsistent, eDelete, end(), GetBreakAddress(), GetLDBase(), GetLinkMapAddress(), GetRendezvousAddress(), GetState(), GetVersion(), LLDB_LOGF, and lldb_private::Log::PutCString().
|
inline |
Definition at line 169 of file HexagonDYLDRendezvous.h.
References m_soentries.
Referenced by DumpToLog(), and UpdateSOEntriesForDeletion().
|
protected |
Definition at line 287 of file HexagonDYLDRendezvous.cpp.
References error(), eSize, lldb::eSymbolTypeAny, lldb_private::ModuleList::FindSymbolsWithNameAndType(), lldb_private::Target::GetImages(), lldb_private::Address::GetLoadAddress(), lldb_private::SymbolContextList::IsEmpty(), LLDB_INVALID_ADDRESS, and m_process.
Referenced by GetThreadInfo().
|
inline |
A breakpoint should be set at this address and Resolve called on each hit.
Definition at line 96 of file HexagonDYLDRendezvous.h.
References m_current.
Referenced by DumpToLog().
|
inline |
Definition at line 108 of file HexagonDYLDRendezvous.h.
References m_current.
Referenced by DumpToLog().
|
inline |
Definition at line 87 of file HexagonDYLDRendezvous.h.
References m_current.
Referenced by DumpToLog().
|
inline |
Definition at line 77 of file HexagonDYLDRendezvous.h.
References m_rendezvous_addr.
Referenced by DumpToLog().
|
inline |
Returns the current state of the rendezvous structure.
Definition at line 104 of file HexagonDYLDRendezvous.h.
References m_current.
Referenced by DumpToLog().
const HexagonDYLDRendezvous::ThreadInfo & HexagonDYLDRendezvous::GetThreadInfo | ( | ) |
Definition at line 315 of file HexagonDYLDRendezvous.cpp.
References eOffset, eSize, FindMetadata(), and m_thread_info.
|
inline |
Definition at line 83 of file HexagonDYLDRendezvous.h.
References m_current.
Referenced by DumpToLog().
bool HexagonDYLDRendezvous::IsValid | ( | ) |
Definition at line 108 of file HexagonDYLDRendezvous.cpp.
References LLDB_INVALID_ADDRESS, and m_rendezvous_addr.
Referenced by DynamicLoaderHexagonDYLD::RendezvousBreakpointHit().
|
inline |
Iterators over all modules loaded into the inferior since the last call to Resolve().
Definition at line 173 of file HexagonDYLDRendezvous.h.
References m_added_soentries.
|
inline |
Definition at line 174 of file HexagonDYLDRendezvous.h.
References m_added_soentries.
|
inline |
Definition at line 115 of file HexagonDYLDRendezvous.h.
References m_added_soentries.
|
inline |
Definition at line 119 of file HexagonDYLDRendezvous.h.
References m_removed_soentries.
|
protected |
Reads an address from the inferior's address space starting at addr
.
Definition at line 228 of file HexagonDYLDRendezvous.cpp.
References error(), and m_process.
Referenced by ReadSOEntryFromMemory(), and Resolve().
|
protected |
Reads an SOEntry starting at addr
.
Definition at line 262 of file HexagonDYLDRendezvous.cpp.
References HexagonDYLDRendezvous::SOEntry::base_addr, HexagonDYLDRendezvous::SOEntry::clear(), HexagonDYLDRendezvous::SOEntry::dyn_addr, HexagonDYLDRendezvous::SOEntry::link_addr, HexagonDYLDRendezvous::SOEntry::next, HexagonDYLDRendezvous::SOEntry::path, HexagonDYLDRendezvous::SOEntry::path_addr, HexagonDYLDRendezvous::SOEntry::prev, ReadPointer(), and ReadStringFromMemory().
Referenced by TakeSnapshot(), and UpdateSOEntriesForAddition().
|
protected |
Reads a null-terminated C string from the memory location starting at addr
.
Definition at line 238 of file HexagonDYLDRendezvous.cpp.
References error(), LLDB_INVALID_ADDRESS, and m_process.
Referenced by ReadSOEntryFromMemory().
|
protected |
Reads an unsigned integer of size
bytes from the inferior's address space starting at addr
.
Definition at line 217 of file HexagonDYLDRendezvous.cpp.
References error(), and m_process.
Referenced by Resolve().
bool HexagonDYLDRendezvous::Resolve | ( | ) |
Update the internal snapshot of runtime linker rendezvous and recompute the currently loaded modules.
This method should be called once one start up, then once each time the runtime linker enters the function given by GetBreakAddress().
Definition at line 62 of file HexagonDYLDRendezvous.cpp.
References HexagonDYLDRendezvous::Rendezvous::brk, HexagonDYLDRendezvous::Rendezvous::ldbase, LLDB_INVALID_ADDRESS, m_current, m_previous, m_process, m_rendezvous_addr, HexagonDYLDRendezvous::Rendezvous::map_addr, ReadPointer(), ReadWord(), ResolveRendezvousAddress(), HexagonDYLDRendezvous::Rendezvous::state, UpdateSOEntries(), HexagonDYLDRendezvous::Rendezvous::version, and word_size.
|
inline |
In hexagon it is possible that we can know the dyld breakpoint without having to find it from the rendezvous structure.
Definition at line 101 of file HexagonDYLDRendezvous.h.
References m_current.
void HexagonDYLDRendezvous::SetRendezvousAddress | ( | lldb::addr_t | addr | ) |
Provide the dyld structure address.
Definition at line 104 of file HexagonDYLDRendezvous.cpp.
References m_rendezvous_addr.
Referenced by DynamicLoaderHexagonDYLD::RendezvousBreakpointHit().
|
protected |
Reads the current list of shared objects according to the link map supplied by the runtime linker.
Definition at line 195 of file HexagonDYLDRendezvous.cpp.
References m_current, m_exe_path, HexagonDYLDRendezvous::SOEntry::next, HexagonDYLDRendezvous::SOEntry::path, and ReadSOEntryFromMemory().
Referenced by UpdateSOEntries(), and UpdateSOEntriesForDeletion().
|
inline |
Iterators over all modules unloaded from the inferior since the last call to Resolve().
Definition at line 178 of file HexagonDYLDRendezvous.h.
References m_removed_soentries.
|
inline |
Definition at line 179 of file HexagonDYLDRendezvous.h.
References m_removed_soentries.
|
protected |
Updates the current set of SOEntries, the set of added entries, and the set of removed entries.
Definition at line 112 of file HexagonDYLDRendezvous.cpp.
References eAdd, eConsistent, eDelete, m_added_soentries, m_current, m_previous, m_removed_soentries, m_soentries, TakeSnapshot(), UpdateSOEntriesForAddition(), and UpdateSOEntriesForDeletion().
Referenced by Resolve().
|
protected |
Definition at line 149 of file HexagonDYLDRendezvous.cpp.
References eAdd, m_added_soentries, m_current, m_exe_path, m_previous, m_soentries, HexagonDYLDRendezvous::SOEntry::next, HexagonDYLDRendezvous::SOEntry::path, and ReadSOEntryFromMemory().
Referenced by UpdateSOEntries().
|
protected |
Definition at line 177 of file HexagonDYLDRendezvous.cpp.
References begin(), eDelete, end(), m_previous, m_removed_soentries, m_soentries, and TakeSnapshot().
Referenced by UpdateSOEntries().
|
protected |
List of SOEntry's added to the link map since the last call to Resolve().
Definition at line 199 of file HexagonDYLDRendezvous.h.
Referenced by HexagonDYLDRendezvous(), loaded_begin(), loaded_end(), ModulesDidLoad(), UpdateSOEntries(), and UpdateSOEntriesForAddition().
|
protected |
Current and previous snapshots of the rendezvous structure.
Definition at line 191 of file HexagonDYLDRendezvous.h.
Referenced by GetBreakAddress(), GetLDBase(), GetLinkMapAddress(), GetState(), GetVersion(), HexagonDYLDRendezvous(), Resolve(), SetBreakAddress(), TakeSnapshot(), UpdateSOEntries(), and UpdateSOEntriesForAddition().
|
protected |
Definition at line 185 of file HexagonDYLDRendezvous.h.
Referenced by HexagonDYLDRendezvous(), TakeSnapshot(), and UpdateSOEntriesForAddition().
|
protected |
Definition at line 192 of file HexagonDYLDRendezvous.h.
Referenced by HexagonDYLDRendezvous(), Resolve(), UpdateSOEntries(), UpdateSOEntriesForAddition(), and UpdateSOEntriesForDeletion().
|
protected |
Definition at line 182 of file HexagonDYLDRendezvous.h.
Referenced by FindMetadata(), HexagonDYLDRendezvous(), ReadPointer(), ReadStringFromMemory(), ReadWord(), and Resolve().
|
protected |
List of SOEntry's removed from the link map since the last call to Resolve().
Definition at line 203 of file HexagonDYLDRendezvous.h.
Referenced by HexagonDYLDRendezvous(), ModulesDidUnload(), unloaded_begin(), unloaded_end(), UpdateSOEntries(), and UpdateSOEntriesForDeletion().
|
protected |
Location of the r_debug structure in the inferiors address space.
Definition at line 188 of file HexagonDYLDRendezvous.h.
Referenced by GetRendezvousAddress(), HexagonDYLDRendezvous(), IsValid(), Resolve(), and SetRendezvousAddress().
|
protected |
List of SOEntry objects corresponding to the current link map state.
Definition at line 195 of file HexagonDYLDRendezvous.h.
Referenced by begin(), end(), HexagonDYLDRendezvous(), UpdateSOEntries(), UpdateSOEntriesForAddition(), and UpdateSOEntriesForDeletion().
|
protected |
Threading metadata read from the inferior.
Definition at line 206 of file HexagonDYLDRendezvous.h.
Referenced by GetThreadInfo(), and HexagonDYLDRendezvous().