LLDB mainline
|
#include <ObjectFileMachO.h>
Classes | |
struct | LCNoteEntry |
struct | MachOCorefileAllImageInfos |
struct | MachOCorefileImageEntry |
A corefile may include metadata about all of the binaries that were present in the process when the corefile was taken. More... | |
struct | SegmentParsingContext |
Public Member Functions | |
ObjectFileMachO (const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length) | |
ObjectFileMachO (const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) | |
~ObjectFileMachO () override=default | |
bool | isA (const void *ClassID) const override |
bool | ParseHeader () override |
Attempts to parse the object header. | |
bool | SetLoadAddress (lldb_private::Target &target, lldb::addr_t value, bool value_is_offset) override |
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the implementation. | |
lldb::ByteOrder | GetByteOrder () const override |
Gets whether endian swapping should occur when extracting data from this object file. | |
bool | IsExecutable () const override |
Tells whether this object file is capable of being the main executable for a process. | |
bool | IsDynamicLoader () const |
bool | IsSharedCacheBinary () const |
bool | IsKext () const |
uint32_t | GetAddressByteSize () const override |
Gets the address size in bytes for the current object file. | |
lldb_private::AddressClass | GetAddressClass (lldb::addr_t file_addr) override |
Get the address type given a file address in an object file. | |
void | ParseSymtab (lldb_private::Symtab &symtab) override |
Parse the symbol table into the provides symbol table object. | |
bool | IsStripped () override |
Detect if this object file has been stripped of local symbols. | |
void | CreateSections (lldb_private::SectionList &unified_section_list) override |
void | Dump (lldb_private::Stream *s) override |
Dump a description of this object to a Stream. | |
lldb_private::ArchSpec | GetArchitecture () override |
Get the ArchSpec for this object file. | |
lldb_private::UUID | GetUUID () override |
Gets the UUID for this object file. | |
uint32_t | GetDependentModules (lldb_private::FileSpecList &files) override |
Extract the dependent modules from an object file. | |
lldb_private::FileSpecList | GetReExportedLibraries () override |
Gets the file spec list of libraries re-exported by this object file. | |
lldb_private::Address | GetEntryPointAddress () override |
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry point (because it is not an executable file) then an invalid address is returned. | |
lldb_private::Address | GetBaseAddress () override |
Returns base address of this object file. | |
uint32_t | GetNumThreadContexts () override |
std::vector< std::tuple< lldb::offset_t, lldb::offset_t > > | FindLC_NOTEByName (std::string name) |
std::string | GetIdentifierString () override |
Some object files may have an identifier string embedded in them, e.g. | |
lldb_private::AddressableBits | GetAddressableBits () override |
Some object files may have the number of bits used for addressing embedded in them, e.g. | |
bool | GetCorefileMainBinaryInfo (lldb::addr_t &value, bool &value_is_offset, lldb_private::UUID &uuid, ObjectFile::BinaryType &type) override |
bool | GetCorefileThreadExtraInfos (std::vector< lldb::tid_t > &tids) override |
Get metadata about threads from the corefile. | |
bool | LoadCoreFileImages (lldb_private::Process &process) override |
Load binaries listed in a corefile. | |
lldb::RegisterContextSP | GetThreadContextAtIndex (uint32_t idx, lldb_private::Thread &thread) override |
ObjectFile::Type | CalculateType () override |
The object file should be able to calculate its type by looking at its file header and possibly the sections or other data in the object file. | |
ObjectFile::Strata | CalculateStrata () override |
The object file should be able to calculate the strata of the object file. | |
llvm::VersionTuple | GetVersion () override |
Get the object file version numbers. | |
llvm::VersionTuple | GetMinimumOSVersion () override |
Get the minimum OS version this object file can run on. | |
llvm::VersionTuple | GetSDKVersion () override |
Get the SDK OS version this object file was built with. | |
bool | GetIsDynamicLinkEditor () override |
Return true if this file is a dynamic link editor (dyld) | |
bool | CanTrustAddressRanges () override |
Can we trust the address ranges accelerator associated with this object file to be complete. | |
bool | AllowAssemblyEmulationUnwindPlans () override |
Returns if the function bounds for symbols in this symbol file are likely accurate. | |
lldb_private::Section * | GetMachHeaderSection () |
llvm::StringRef | GetPluginName () override |
Public Member Functions inherited from lldb_private::ObjectFile | |
ObjectFile (const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, lldb::DataBufferSP data_sp, lldb::offset_t data_offset) | |
Construct with a parent module, offset, and header data. | |
ObjectFile (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP data_sp) | |
~ObjectFile () override | |
Destructor. | |
virtual void | Dump (Stream *s)=0 |
Dump a description of this object to a Stream. | |
virtual bool | isA (const void *ClassID) const |
virtual uint32_t | GetAddressByteSize () const =0 |
Gets the address size in bytes for the current object file. | |
virtual AddressClass | GetAddressClass (lldb::addr_t file_addr) |
Get the address type given a file address in an object file. | |
virtual uint32_t | GetDependentModules (FileSpecList &file_list)=0 |
Extract the dependent modules from an object file. | |
virtual bool | IsExecutable () const =0 |
Tells whether this object file is capable of being the main executable for a process. | |
virtual lldb::addr_t | GetFileOffset () const |
Returns the offset into a file at which this object resides. | |
virtual lldb::addr_t | GetByteSize () const |
virtual FileSpec & | GetFileSpec () |
Get accessor to the object file specification. | |
virtual const FileSpec & | GetFileSpec () const |
Get const accessor to the object file specification. | |
virtual ArchSpec | GetArchitecture ()=0 |
Get the ArchSpec for this object file. | |
virtual SectionList * | GetSectionList (bool update_module_section_list=true) |
Gets the section list for the currently selected architecture (and object for archives). | |
virtual void | CreateSections (SectionList &unified_section_list)=0 |
virtual void | SectionFileAddressesChanged () |
Notify the ObjectFile that the file addresses in the Sections for this module have been changed. | |
Symtab * | GetSymtab () |
Gets the symbol table for the currently selected architecture (and object for archives). | |
virtual void | ParseSymtab (Symtab &symtab)=0 |
Parse the symbol table into the provides symbol table object. | |
virtual void | RelocateSection (lldb_private::Section *section) |
Perform relocations on the section if necessary. | |
virtual Symbol * | ResolveSymbolForAddress (const Address &so_addr, bool verify_unique) |
Appends a Symbol for the specified so_addr to the symbol table. | |
virtual bool | IsStripped ()=0 |
Detect if this object file has been stripped of local symbols. | |
virtual void | ClearSymtab () |
Frees the symbol table. | |
virtual UUID | GetUUID ()=0 |
Gets the UUID for this object file. | |
virtual lldb_private::FileSpecList | GetReExportedLibraries () |
Gets the file spec list of libraries re-exported by this object file. | |
virtual bool | SetLoadAddress (Target &target, lldb::addr_t value, bool value_is_offset) |
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the implementation. | |
virtual lldb::ByteOrder | GetByteOrder () const =0 |
Gets whether endian swapping should occur when extracting data from this object file. | |
virtual bool | ParseHeader ()=0 |
Attempts to parse the object header. | |
virtual bool | AllowAssemblyEmulationUnwindPlans () |
Returns if the function bounds for symbols in this symbol file are likely accurate. | |
virtual lldb_private::Address | GetImageInfoAddress (Target *target) |
Similar to Process::GetImageInfoAddress(). | |
virtual lldb_private::Address | GetEntryPointAddress () |
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry point (because it is not an executable file) then an invalid address is returned. | |
virtual lldb_private::Address | GetBaseAddress () |
Returns base address of this object file. | |
virtual uint32_t | GetNumThreadContexts () |
virtual std::string | GetIdentifierString () |
Some object files may have an identifier string embedded in them, e.g. | |
virtual lldb_private::AddressableBits | GetAddressableBits () |
Some object files may have the number of bits used for addressing embedded in them, e.g. | |
virtual bool | GetCorefileMainBinaryInfo (lldb::addr_t &value, bool &value_is_offset, UUID &uuid, ObjectFile::BinaryType &type) |
When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file. | |
virtual bool | GetCorefileThreadExtraInfos (std::vector< lldb::tid_t > &tids) |
Get metadata about threads from the corefile. | |
virtual lldb::RegisterContextSP | GetThreadContextAtIndex (uint32_t idx, lldb_private::Thread &thread) |
virtual Type | CalculateType ()=0 |
The object file should be able to calculate its type by looking at its file header and possibly the sections or other data in the object file. | |
virtual void | SetType (Type type) |
In cases where the type can't be calculated (elf files), this routine allows someone to explicitly set it. | |
virtual Strata | CalculateStrata ()=0 |
The object file should be able to calculate the strata of the object file. | |
virtual llvm::VersionTuple | GetVersion () |
Get the object file version numbers. | |
virtual llvm::VersionTuple | GetMinimumOSVersion () |
Get the minimum OS version this object file can run on. | |
virtual llvm::VersionTuple | GetSDKVersion () |
Get the SDK OS version this object file was built with. | |
virtual bool | GetIsDynamicLinkEditor () |
Return true if this file is a dynamic link editor (dyld) | |
Type | GetType () |
Strata | GetStrata () |
size_t | GetData (lldb::offset_t offset, size_t length, DataExtractor &data) const |
size_t | CopyData (lldb::offset_t offset, size_t length, void *dst) const |
virtual size_t | ReadSectionData (Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len) |
virtual size_t | ReadSectionData (Section *section, DataExtractor §ion_data) |
virtual size_t | GetSectionDataSize (Section *section) |
bool | IsInMemory () const |
Returns true if the object file exists only in memory. | |
virtual llvm::StringRef | StripLinkerSymbolAnnotations (llvm::StringRef symbol_name) const |
virtual bool | CanTrustAddressRanges () |
Can we trust the address ranges accelerator associated with this object file to be complete. | |
virtual std::vector< LoadableData > | GetLoadableData (Target &target) |
Loads this objfile to memory. | |
virtual std::unique_ptr< CallFrameInfo > | CreateCallFrameInfo () |
Creates a plugin-specific call frame info. | |
virtual bool | LoadCoreFileImages (lldb_private::Process &process) |
Load binaries listed in a corefile. | |
uint32_t | GetCacheHash () |
Get a hash that can be used for caching object file releated information. | |
Public Member Functions inherited from lldb_private::PluginInterface | |
PluginInterface ()=default | |
virtual | ~PluginInterface ()=default |
virtual llvm::StringRef | GetPluginName ()=0 |
PluginInterface (const PluginInterface &)=delete | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Public Member Functions inherited from lldb_private::ModuleChild | |
ModuleChild (const lldb::ModuleSP &module_sp) | |
Construct with owning module. | |
~ModuleChild () | |
Destructor. | |
const ModuleChild & | operator= (const ModuleChild &rhs) |
Assignment operator. | |
lldb::ModuleSP | GetModule () const |
Get const accessor for the module pointer. | |
void | SetModule (const lldb::ModuleSP &module_sp) |
Set accessor for the module pointer. | |
Static Public Attributes | |
static char | ID |
Static Public Attributes inherited from lldb_private::ObjectFile | |
static char | ID |
Protected Types | |
typedef lldb_private::RangeVector< uint32_t, uint32_t, 8 > | EncryptedFileRanges |
typedef lldb_private::RangeVector< uint32_t, uint32_t > | FileRangeArray |
Protected Member Functions | |
void | GetProcessSharedCacheUUID (lldb_private::Process *, lldb::addr_t &base_addr, lldb_private::UUID &uuid) |
Intended for same-host arm device debugging where lldb needs to detect libraries in the shared cache and augment the nlist entries with an on-disk dyld_shared_cache file. | |
void | GetLLDBSharedCacheUUID (lldb::addr_t &base_addir, lldb_private::UUID &uuid) |
Intended for same-host arm device debugging where lldb will read shared cache libraries out of its own memory instead of the remote process' memory as an optimization. | |
lldb::addr_t | CalculateSectionLoadAddressForMemoryImage (lldb::addr_t mach_header_load_address, const lldb_private::Section *mach_header_section, const lldb_private::Section *section) |
lldb_private::UUID | GetSharedCacheUUID (lldb_private::FileSpec dyld_shared_cache, const lldb::ByteOrder byte_order, const uint32_t addr_byte_size) |
size_t | ParseSymtab () |
EncryptedFileRanges | GetEncryptedFileRanges () |
void | ProcessDysymtabCommand (const llvm::MachO::load_command &load_cmd, lldb::offset_t offset) |
void | ProcessSegmentCommand (const llvm::MachO::load_command &load_cmd, lldb::offset_t offset, uint32_t cmd_idx, SegmentParsingContext &context) |
void | SanitizeSegmentCommand (llvm::MachO::segment_command_64 &seg_cmd, uint32_t cmd_idx) |
bool | SectionIsLoadable (const lldb_private::Section *section) |
MachOCorefileAllImageInfos | GetCorefileAllImageInfos () |
Get the list of binary images that were present in the process when the corefile was produced. | |
Protected Member Functions inherited from lldb_private::ObjectFile | |
bool | SetModulesArchitecture (const ArchSpec &new_arch) |
Sets the architecture for a module. | |
Protected Attributes | |
llvm::MachO::mach_header | m_header |
llvm::MachO::dysymtab_command | m_dysymtab |
std::vector< llvm::MachO::section_64 > | m_mach_sections |
std::optional< llvm::VersionTuple > | m_min_os_version |
std::optional< llvm::VersionTuple > | m_sdk_versions |
lldb_private::Address | m_entry_point_address |
FileRangeArray | m_thread_context_offsets |
lldb::offset_t | m_linkedit_original_offset = 0 |
lldb::addr_t | m_text_address = LLDB_INVALID_ADDRESS |
bool | m_thread_context_offsets_valid |
lldb_private::FileSpecList | m_reexported_dylibs |
bool | m_allow_assembly_emulation_unwind_plans |
Protected Attributes inherited from lldb_private::ObjectFile | |
FileSpec | m_file |
Type | m_type |
Strata | m_strata |
lldb::addr_t | m_file_offset |
The offset in bytes into the file, or the address in memory. | |
lldb::addr_t | m_length |
The length of this object file if it is known (can be zero if length is unknown or can't be determined). | |
DataExtractor | m_data |
The data for this object file so things can be parsed lazily. | |
lldb::ProcessWP | m_process_wp |
const lldb::addr_t | m_memory_addr |
Set if the object file only exists in memory. | |
std::unique_ptr< lldb_private::SectionList > | m_sections_up |
std::unique_ptr< lldb_private::Symtab > | m_symtab_up |
std::unique_ptr< llvm::once_flag > | m_symtab_once_up |
We need a llvm::once_flag that we can use to avoid locking the module lock and deadlocking LLDB. | |
std::optional< uint32_t > | m_cache_hash |
Protected Attributes inherited from lldb_private::ModuleChild | |
lldb::ModuleWP | m_module_wp |
The Module that owns the object that inherits from this class. | |
Additional Inherited Members | |
Public Types inherited from lldb_private::ObjectFile | |
enum | Type { eTypeInvalid = 0 , eTypeCoreFile , eTypeExecutable , eTypeDebugInfo , eTypeDynamicLinker , eTypeObjectFile , eTypeSharedLibrary , eTypeStubLibrary , eTypeJIT , eTypeUnknown } |
enum | Strata { eStrataInvalid = 0 , eStrataUnknown , eStrataUser , eStrataKernel , eStrataRawImage , eStrataJIT } |
enum | BinaryType { eBinaryTypeInvalid = 0 , eBinaryTypeUnknown , eBinaryTypeKernel , eBinaryTypeUser , eBinaryTypeStandalone } |
If we have a corefile binary hint, this enum specifies the binary type which we can use to select the correct DynamicLoader plugin. More... | |
Static Protected Attributes inherited from lldb_private::ObjectFile | |
static size_t | g_initial_bytes_to_read = 512 |
The number of bytes to read when going through the plugins. | |
Definition at line 24 of file ObjectFileMachO.h.
|
protected |
Definition at line 216 of file ObjectFileMachO.h.
|
protected |
Definition at line 280 of file ObjectFileMachO.h.
ObjectFileMachO::ObjectFileMachO | ( | const lldb::ModuleSP & | module_sp, |
lldb::DataBufferSP | data_sp, | ||
lldb::offset_t | data_offset, | ||
const lldb_private::FileSpec * | file, | ||
lldb::offset_t | offset, | ||
lldb::offset_t | length | ||
) |
Definition at line 942 of file ObjectFileMachO.cpp.
References m_dysymtab, and m_header.
ObjectFileMachO::ObjectFileMachO | ( | const lldb::ModuleSP & | module_sp, |
lldb::WritableDataBufferSP | data_sp, | ||
const lldb::ProcessSP & | process_sp, | ||
lldb::addr_t | header_addr | ||
) |
Definition at line 956 of file ObjectFileMachO.cpp.
References m_dysymtab, and m_header.
|
overridedefault |
|
overridevirtual |
Returns if the function bounds for symbols in this symbol file are likely accurate.
The unwinder can emulate the instructions of functions to understand prologue/epilogue code sequences, where registers are spilled on the stack, etc. This feature relies on having the correct start addresses of all functions. If the ObjectFile has a way to tell that symbols have been stripped and there's no way to reconstruct start addresses (e.g. LC_FUNCTION_STARTS on Mach-O, or eh_frame unwind info), the ObjectFile should indicate that assembly emulation should not be used for this module.
It is uncommon for this to return false. An ObjectFile needs to be sure that symbol start addresses are unavailable before false is returned. If it is unclear, this should return true.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6126 of file ObjectFileMachO.cpp.
References m_allow_assembly_emulation_unwind_plans.
|
protected |
Definition at line 6188 of file ObjectFileMachO.cpp.
References lldb_private::Section::GetFileAddress(), lldb_private::ModuleChild::GetModule(), LLDB_INVALID_ADDRESS, and SectionIsLoadable().
Referenced by SetLoadAddress().
|
overridevirtual |
The object file should be able to calculate the strata of the object file.
Many object files for platforms might be for either user space debugging or for kernel debugging. If your object file subclass can figure this out, it will help with debugger plug-in selection when it comes time to debug.
Implements lldb_private::ObjectFile.
Definition at line 5835 of file ObjectFileMachO.cpp.
References lldb_private::ObjectFile::eStrataKernel, lldb_private::ObjectFile::eStrataRawImage, lldb_private::ObjectFile::eStrataUnknown, lldb_private::ObjectFile::eStrataUser, lldb_private::ObjectFile::eTypeInvalid, lldb_private::ObjectFile::eTypeSharedLibrary, lldb_private::SectionList::FindSectionByName(), lldb_private::ObjectFile::GetSectionList(), GetUUID(), m_header, and lldb_private::ObjectFile::m_type.
Referenced by ParseSymtab().
|
overridevirtual |
The object file should be able to calculate its type by looking at its file header and possibly the sections or other data in the object file.
The file type is used in the debugger to help select the correct plug- ins for the job at hand, so this is important to get right. If any eTypeXXX definitions do not match up with the type of file you are loading, please feel free to add a new enumeration value.
Implements lldb_private::ObjectFile.
Definition at line 5792 of file ObjectFileMachO.cpp.
References lldb_private::ObjectFile::eStrataInvalid, lldb_private::ObjectFile::eStrataKernel, lldb_private::ObjectFile::eTypeCoreFile, lldb_private::ObjectFile::eTypeDebugInfo, lldb_private::ObjectFile::eTypeDynamicLinker, lldb_private::ObjectFile::eTypeExecutable, lldb_private::ObjectFile::eTypeObjectFile, lldb_private::ObjectFile::eTypeSharedLibrary, lldb_private::ObjectFile::eTypeStubLibrary, lldb_private::ObjectFile::eTypeUnknown, GetAddressByteSize(), GetUUID(), m_header, and lldb_private::ObjectFile::m_strata.
Referenced by GetDependentModules().
|
overridevirtual |
Can we trust the address ranges accelerator associated with this object file to be complete.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6120 of file ObjectFileMachO.cpp.
References m_header.
|
inlinestatic |
Definition at line 76 of file ObjectFileMachO.h.
References ID.
|
static |
Definition at line 803 of file ObjectFileMachO.cpp.
References MagicBytesMatch(), and lldb_private::ObjectFile::MapFileData().
Referenced by Initialize(), and Terminate().
|
static |
Definition at line 834 of file ObjectFileMachO.cpp.
References MagicBytesMatch().
Referenced by Initialize().
|
overridevirtual |
Implements lldb_private::ObjectFile.
Definition at line 1927 of file ObjectFileMachO.cpp.
References ObjectFileMachO::SegmentParsingContext::FileAddressesChanged, GetEncryptedFileRanges(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, lldb_private::ObjectFile::m_sections_up, MachHeaderSizeFromMagic(), ProcessDysymtabCommand(), and ProcessSegmentCommand().
|
overridevirtual |
Dump a description of this object to a Stream.
Dump a description of the current contents of this object to the supplied stream s. The dumping should include the section list if it has been parsed, and the symbol table if it has been parsed.
[in] | s | The stream to which to dump the object description. |
Implements lldb_private::ObjectFile.
Definition at line 4795 of file ObjectFileMachO.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::SectionList::Dump(), lldb_private::eSortOrderNone, GetAllArchSpecs(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::Stream::GetIndentLevel(), lldb_private::ModuleChild::GetModule(), lldb_private::ModuleSpecList::GetModuleSpecRefAtIndex(), lldb_private::ObjectFile::GetSectionList(), lldb_private::ModuleSpecList::GetSize(), lldb_private::ArchSpec::GetTriple(), lldb_private::Stream::Indent(), lldb_private::ObjectFile::m_data, lldb_private::ObjectFile::m_file, m_header, lldb_private::ObjectFile::m_symtab_up, MachHeaderSizeFromMagic(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and UINT32_MAX.
std::vector< std::tuple< offset_t, offset_t > > ObjectFileMachO::FindLC_NOTEByName | ( | std::string | name | ) |
Definition at line 5452 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::CopyData(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64_unchecked(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().
Referenced by GetAddressableBits(), GetCorefileAllImageInfos(), GetCorefileMainBinaryInfo(), GetCorefileThreadExtraInfos(), and GetIdentifierString().
|
overridevirtual |
Some object files may have the number of bits used for addressing embedded in them, e.g.
a Mach-O core file using an LC_NOTE. These object files can return an AddressableBits object that can can be used to set the address masks in the Process.
Reimplemented from lldb_private::ObjectFile.
Definition at line 5528 of file ObjectFileMachO.cpp.
References FindLC_NOTEByName(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU32_unchecked(), LLDB_LOGF, lldb_private::ObjectFile::m_data, and lldb_private::AddressableBits::SetAddressableBits().
|
overridevirtual |
Gets the address size in bytes for the current object file.
Implements lldb_private::ObjectFile.
Definition at line 1131 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), and lldb_private::ObjectFile::m_data.
Referenced by CalculateType().
|
overridevirtual |
Get the address type given a file address in an object file.
Many binary file formats know what kinds This is primarily for ARM binaries, though it can be applied to any executable file format that supports different opcode types within the same binary. ARM binaries support having both ARM and Thumb within the same executable container. We need to be able to get
Reimplemented from lldb_private::ObjectFile.
Definition at line 1135 of file ObjectFileMachO.cpp.
References lldb::eSectionTypeAbsoluteAddress, lldb::eSectionTypeARMexidx, lldb::eSectionTypeARMextab, lldb::eSectionTypeCode, lldb::eSectionTypeCompactUnwind, lldb::eSectionTypeContainer, lldb::eSectionTypeCTF, lldb::eSectionTypeData, lldb::eSectionTypeData16, lldb::eSectionTypeData4, lldb::eSectionTypeData8, lldb::eSectionTypeDataCString, lldb::eSectionTypeDataCStringPointers, lldb::eSectionTypeDataObjCCFStrings, lldb::eSectionTypeDataObjCMessageRefs, lldb::eSectionTypeDataPointers, lldb::eSectionTypeDataSymbolAddress, lldb::eSectionTypeDebug, lldb::eSectionTypeDWARFAppleNames, lldb::eSectionTypeDWARFAppleNamespaces, lldb::eSectionTypeDWARFAppleObjC, lldb::eSectionTypeDWARFAppleTypes, lldb::eSectionTypeDWARFDebugAbbrev, lldb::eSectionTypeDWARFDebugAbbrevDwo, lldb::eSectionTypeDWARFDebugAddr, lldb::eSectionTypeDWARFDebugAranges, lldb::eSectionTypeDWARFDebugCuIndex, lldb::eSectionTypeDWARFDebugFrame, lldb::eSectionTypeDWARFDebugInfo, lldb::eSectionTypeDWARFDebugInfoDwo, lldb::eSectionTypeDWARFDebugLine, lldb::eSectionTypeDWARFDebugLineStr, lldb::eSectionTypeDWARFDebugLoc, lldb::eSectionTypeDWARFDebugLocDwo, lldb::eSectionTypeDWARFDebugLocLists, lldb::eSectionTypeDWARFDebugLocListsDwo, lldb::eSectionTypeDWARFDebugMacInfo, lldb::eSectionTypeDWARFDebugMacro, lldb::eSectionTypeDWARFDebugNames, lldb::eSectionTypeDWARFDebugPubNames, lldb::eSectionTypeDWARFDebugPubTypes, lldb::eSectionTypeDWARFDebugRanges, lldb::eSectionTypeDWARFDebugRngLists, lldb::eSectionTypeDWARFDebugRngListsDwo, lldb::eSectionTypeDWARFDebugStr, lldb::eSectionTypeDWARFDebugStrDwo, lldb::eSectionTypeDWARFDebugStrOffsets, lldb::eSectionTypeDWARFDebugStrOffsetsDwo, lldb::eSectionTypeDWARFDebugTuIndex, lldb::eSectionTypeDWARFDebugTypes, lldb::eSectionTypeDWARFDebugTypesDwo, lldb::eSectionTypeDWARFGNUDebugAltLink, lldb::eSectionTypeEHFrame, lldb::eSectionTypeELFDynamicLinkInfo, lldb::eSectionTypeELFDynamicSymbols, lldb::eSectionTypeELFRelocationEntries, lldb::eSectionTypeELFSymbolTable, lldb::eSectionTypeGoSymtab, lldb::eSectionTypeInvalid, lldb::eSectionTypeOther, lldb::eSectionTypeSwiftModules, lldb::eSectionTypeZeroFill, lldb::eSymbolTypeAbsolute, lldb::eSymbolTypeAdditional, lldb::eSymbolTypeAny, lldb::eSymbolTypeBlock, lldb::eSymbolTypeCode, lldb::eSymbolTypeCommonBlock, lldb::eSymbolTypeCompiler, lldb::eSymbolTypeData, lldb::eSymbolTypeException, lldb::eSymbolTypeHeaderFile, lldb::eSymbolTypeInstrumentation, lldb::eSymbolTypeLineEntry, lldb::eSymbolTypeLineHeader, lldb::eSymbolTypeLocal, lldb::eSymbolTypeObjCClass, lldb::eSymbolTypeObjCIVar, lldb::eSymbolTypeObjCMetaClass, lldb::eSymbolTypeObjectFile, lldb::eSymbolTypeParam, lldb::eSymbolTypeReExported, lldb::eSymbolTypeResolver, lldb::eSymbolTypeRuntime, lldb::eSymbolTypeScopeBegin, lldb::eSymbolTypeScopeEnd, lldb::eSymbolTypeSourceFile, lldb::eSymbolTypeTrampoline, lldb::eSymbolTypeUndefined, lldb::eSymbolTypeVariable, lldb::eSymbolTypeVariableType, lldb_private::Symtab::FindSymbolContainingFileAddress(), lldb_private::Symbol::GetAddressRef(), lldb_private::Symbol::GetFlags(), lldb_private::Address::GetSection(), lldb_private::ObjectFile::GetSymtab(), lldb_private::Symbol::GetType(), m_header, MACHO_NLIST_ARM_SYMBOL_IS_THUMB, and lldb_private::Symbol::ValueIsAddress().
|
staticprotected |
Enumerate all ArchSpecs supported by this Mach-O file.
On macOS one Mach-O slice can contain multiple load commands: One load command for being loaded into a macOS process and one load command for being loaded into a macCatalyst process. In contrast to ObjectContainerUniversalMachO, this is the same binary that can be loaded into different contexts.
Definition at line 4949 of file ObjectFileMachO.cpp.
References lldb_private::ModuleSpecList::Append(), lldb_private::eArchTypeMachO, lldb_private::DataExtractor::ExtractBytes(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::DataExtractor::GetByteOrder(), GetOSName(), lldb_private::ArchSpec::GetTriple(), lldb_private::DataExtractor::GetU32(), GetUUID(), and lldb_private::ArchSpec::SetArchitecture().
Referenced by Dump(), GetArchitecture(), GetModuleSpecifications(), and ParseHeader().
|
overridevirtual |
Get the ArchSpec for this object file.
Implements lldb_private::ObjectFile.
Definition at line 5928 of file ObjectFileMachO.cpp.
References GetArchitecture(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().
Referenced by GetArchitecture(), and ParseSymtab().
|
staticprotected |
Definition at line 5085 of file ObjectFileMachO.cpp.
References GetAllArchSpecs(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::ModuleSpecList::GetModuleSpecRefAtIndex(), lldb_private::ModuleSpecList::GetSize(), lldb_private::ArchSpec::IsCompatibleMatch(), and MachHeaderSizeFromMagic().
|
overridevirtual |
Returns base address of this object file.
This also sometimes referred to as the "preferred load address" or the "image base address". Addresses within object files are often expressed relative to this base. If this address corresponds to a specific section (usually the first byte of the first section) then the returned address will have this section set. Otherwise, the address will just have the offset member filled in, indicating that this represents a file address.
Reimplemented from lldb_private::ObjectFile.
Definition at line 5411 of file ObjectFileMachO.cpp.
References lldb_private::SectionList::FindSectionByName(), lldb_private::ObjectFile::GetSectionList(), GetSegmentNameTEXT(), lldb_private::Address::SetOffset(), and lldb_private::Address::SetSection().
|
overridevirtual |
Gets whether endian swapping should occur when extracting data from this object file.
Implements lldb_private::ObjectFile.
Definition at line 1111 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::GetByteOrder(), and lldb_private::ObjectFile::m_data.
|
protected |
Get the list of binary images that were present in the process when the corefile was produced.
Definition at line 6903 of file ObjectFileMachO.cpp.
References ObjectFileMachO::MachOCorefileAllImageInfos::all_image_infos, lldb_private::DataExtractor::CopyData(), FindLC_NOTEByName(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetData(), lldb_private::GetLog(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), LLDB_LOGF, image_entry::load_address, lldb_private::ObjectFile::m_data, and image_entry::uuid.
Referenced by LoadCoreFileImages().
|
override |
Definition at line 5565 of file ObjectFileMachO.cpp.
References lldb_private::UUID::Clear(), lldb_private::DataExtractor::CopyData(), lldb_private::ObjectFile::eBinaryTypeKernel, lldb_private::ObjectFile::eBinaryTypeStandalone, lldb_private::ObjectFile::eBinaryTypeUnknown, lldb_private::ObjectFile::eBinaryTypeUser, FindLC_NOTEByName(), lldb_private::UUID::GetAsString(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), LLDB_INVALID_ADDRESS, LLDB_LOGF, and lldb_private::ObjectFile::m_data.
|
overridevirtual |
Get metadata about threads from the corefile.
The corefile may have metadata (e.g. a Mach-O "thread extrainfo" LC_NOTE) which for the threads in the process; this method tries to retrieve them.
[out] | tids | Filled in with a vector of tid_t's that matches the number of threads in the corefile (ObjectFile::GetNumThreadContexts). If a tid is not specified for one of the corefile threads, that entry in the vector will have LLDB_INVALID_THREAD_ID and the caller should assign a tid to the thread that does not conflict with the ones provided in this array. As additional metadata are added, this method may return a tids vector with no thread id's specified at all; the corefile may only specify one of the other metadata. |
Reimplemented from lldb_private::ObjectFile.
Definition at line 5676 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::CopyData(), lldb_private::StructuredData::Object::Dump(), FindLC_NOTEByName(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StreamString::GetData(), lldb_private::StructuredData::Array::GetItemAtIndexAsDictionary(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), GetNumThreadContexts(), lldb_private::StructuredData::Array::GetSize(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsArray(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger(), LLDB_INVALID_THREAD_ID, LLDB_LOGF, lldb_private::ObjectFile::m_data, lldb_private::StructuredData::ParseJSON(), and lldb_private::Stream::Printf().
|
overridevirtual |
Extract the dependent modules from an object file.
If an object file has information about which other images it depends on (such as shared libraries), this function will provide the list. Since many executables or shared libraries may depend on the same files, FileSpecList::AppendIfUnique(const FileSpec &) should be used to make sure any files that are added are not already in the list.
[out] | file_list | A list of file specification objects that gets dependent files appended to. |
Implements lldb_private::ObjectFile.
Definition at line 5121 of file ObjectFileMachO.cpp.
References lldb_private::FileSpecList::AppendIfUnique(), CalculateType(), lldb_private::FileSpec::CopyByAppendingPathComponent(), lldb_private::FileSpec::CopyByRemovingLastPathComponent(), lldb_private::ObjectFile::eTypeExecutable, g_executable_path, g_loader_path, lldb_private::FileSpec::GetDirectory(), lldb_private::ModuleChild::GetModule(), lldb_private::ConstString::GetString(), lldb_private::DataExtractor::GetU32(), lldb_private::FileSystem::Instance(), lldb_private::ObjectFile::m_data, lldb_private::ObjectFile::m_file, m_header, MachHeaderSizeFromMagic(), lldb_private::DataExtractor::PeekCStr(), and lldb_private::FileSystem::Resolve().
|
protected |
Definition at line 1334 of file ObjectFileMachO.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, MachHeaderSizeFromMagic(), lldb_private::Range< B, S >::SetByteSize(), and lldb_private::Range< B, S >::SetRangeBase().
Referenced by CreateSections().
|
overridevirtual |
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry point (because it is not an executable file) then an invalid address is returned.
Reimplemented from lldb_private::ObjectFile.
Definition at line 5240 of file ObjectFileMachO.cpp.
References lldb_private::Address::Clear(), lldb_private::Symtab::eDebugAny, lldb::eSymbolTypeCode, lldb_private::Symtab::eVisibilityAny, lldb_private::Symtab::FindFirstSymbolWithNameAndType(), lldb_private::SectionList::FindSectionByName(), lldb_private::Symbol::GetAddress(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::Address::GetFileAddress(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::GetSectionList(), GetSegmentNameTEXT(), lldb_private::SymbolContextList::GetSize(), lldb_private::ObjectFile::GetSymtab(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), IsDynamicLoader(), IsExecutable(), lldb_private::Address::IsValid(), LLDB_INVALID_ADDRESS, lldb_private::ObjectFile::m_data, m_entry_point_address, m_header, MachHeaderSizeFromMagic(), lldb_private::Address::ResolveAddressUsingFileSections(), and lldb_private::SymbolContext::symbol.
|
overridevirtual |
Some object files may have an identifier string embedded in them, e.g.
in a Mach-O core file using the LC_IDENT load command (which is obsolete, but can still be found in some old files)
Reimplemented from lldb_private::ObjectFile.
Definition at line 5482 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::CopyData(), FindLC_NOTEByName(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), LLDB_LOGF, lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().
|
overridevirtual |
Return true if this file is a dynamic link editor (dyld)
Often times dyld has symbols that mirror symbols in libc and other shared libraries (like "malloc" and "free") and the user does not want to stop in these shared libraries by default. We can ask the ObjectFile if it is such a file and should be avoided for things like settings breakpoints and doing function lookups for expressions.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6116 of file ObjectFileMachO.cpp.
References m_header.
|
protected |
Intended for same-host arm device debugging where lldb will read shared cache libraries out of its own memory instead of the remote process' memory as an optimization.
If lldb's shared cache UUID does not match the process' shared cache UUID, this optimization should not be used.
Definition at line 5973 of file ObjectFileMachO.cpp.
References lldb_copy__dyld_process_cache_info::cacheBaseAddress, lldb_copy__dyld_process_cache_info::cacheUUID, lldb_private::UUID::Clear(), lldb_private::UUID::GetAsString(), lldb_private::GetLog(), lldb_private::UUID::IsValid(), LLDB_INVALID_ADDRESS, LLDB_LOGF, and mach_task_self().
Section * ObjectFileMachO::GetMachHeaderSection | ( | ) |
Definition at line 6130 of file ObjectFileMachO.cpp.
References lldb_private::SectionList::FindSectionByName(), lldb_private::Section::GetFileOffset(), lldb_private::ModuleChild::GetModule(), lldb_private::SectionList::GetSectionAtIndex(), lldb_private::ObjectFile::GetSectionList(), GetSegmentNameTEXT(), lldb_private::SectionList::GetSize(), and SectionIsLoadable().
Referenced by SetLoadAddress().
|
overridevirtual |
Get the minimum OS version this object file can run on.
Some object files have information that specifies the minimum OS version that they can be used on.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6102 of file ObjectFileMachO.cpp.
References FindMinimumVersionInfo(), lldb_private::ObjectFile::m_data, m_header, m_min_os_version, and MachHeaderSizeFromMagic().
|
static |
Definition at line 846 of file ObjectFileMachO.cpp.
References GetAllArchSpecs(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::ModuleSpecList::GetSize(), MachHeaderSizeFromMagic(), MagicBytesMatch(), lldb_private::ObjectFile::MapFileData(), ParseHeader(), lldb_private::DataExtractor::SetData(), lldb_private::ModuleSpec::SetObjectOffset(), and lldb_private::ModuleSpec::SetObjectSize().
Referenced by Initialize().
|
overridevirtual |
Reimplemented from lldb_private::ObjectFile.
Definition at line 5425 of file ObjectFileMachO.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), lldb_private::ModuleChild::GetModule(), lldb_private::RangeVector< B, S, N >::GetSize(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, m_thread_context_offsets, m_thread_context_offsets_valid, MachHeaderSizeFromMagic(), lldb_private::Range< B, S >::SetByteSize(), and lldb_private::Range< B, S >::SetRangeBase().
Referenced by GetCorefileThreadExtraInfos(), and GetThreadContextAtIndex().
|
inlinestatic |
Definition at line 44 of file ObjectFileMachO.h.
Referenced by Initialize().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 163 of file ObjectFileMachO.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 42 of file ObjectFileMachO.h.
Referenced by GetPluginName(), and Initialize().
|
protected |
Intended for same-host arm device debugging where lldb needs to detect libraries in the shared cache and augment the nlist entries with an on-disk dyld_shared_cache file.
The process will record the shared cache UUID so the on-disk cache can be matched or rejected correctly.
Definition at line 5940 of file ObjectFileMachO.cpp.
References lldb_private::UUID::Clear(), lldb_private::UUID::GetAsString(), lldb_private::Process::GetDynamicLoader(), lldb_private::GetLog(), lldb_private::DynamicLoader::GetSharedCacheInformation(), LLDB_INVALID_ADDRESS, and LLDB_LOGF.
Referenced by ParseSymtab().
|
inlineoverridevirtual |
Gets the file spec list of libraries re-exported by this object file.
If the object file format has the notion of one library re-exporting the symbols from another, the re-exported libraries will be returned in the FileSpecList.
Reimplemented from lldb_private::ObjectFile.
Definition at line 112 of file ObjectFileMachO.h.
References m_reexported_dylibs.
|
overridevirtual |
Get the SDK OS version this object file was built with.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6109 of file ObjectFileMachO.cpp.
References FindMinimumVersionInfo(), lldb_private::ObjectFile::m_data, m_header, m_sdk_versions, and MachHeaderSizeFromMagic().
|
staticprotected |
Definition at line 916 of file ObjectFileMachO.cpp.
Referenced by ParseSymtab().
|
staticprotected |
Definition at line 881 of file ObjectFileMachO.cpp.
Referenced by ParseSymtab().
|
staticprotected |
Definition at line 891 of file ObjectFileMachO.cpp.
Referenced by ParseSymtab().
|
staticprotected |
Definition at line 886 of file ObjectFileMachO.cpp.
Referenced by ParseSymtab().
|
staticprotected |
Definition at line 906 of file ObjectFileMachO.cpp.
Referenced by SectionIsLoadable().
|
staticprotected |
Definition at line 901 of file ObjectFileMachO.cpp.
Referenced by ProcessSegmentCommand(), SanitizeSegmentCommand(), and SectionIsLoadable().
|
staticprotected |
Definition at line 911 of file ObjectFileMachO.cpp.
Referenced by SectionIsLoadable().
|
staticprotected |
Definition at line 896 of file ObjectFileMachO.cpp.
Referenced by ParseSymtab().
|
staticprotected |
Definition at line 876 of file ObjectFileMachO.cpp.
Referenced by GetBaseAddress(), GetEntryPointAddress(), GetMachHeaderSection(), ParseSymtab(), and SanitizeSegmentCommand().
|
protected |
|
overridevirtual |
Reimplemented from lldb_private::ObjectFile.
Definition at line 5748 of file ObjectFileMachO.cpp.
References lldb_private::Range< B, S >::GetByteSize(), lldb_private::RangeVector< B, S, N >::GetEntryAtIndex(), lldb_private::ModuleChild::GetModule(), GetNumThreadContexts(), lldb_private::Range< B, S >::GetRangeBase(), lldb_private::ObjectFile::m_data, m_header, m_thread_context_offsets, and m_thread_context_offsets_valid.
|
overridevirtual |
Gets the UUID for this object file.
If the object file format contains a UUID, the value should be returned. Else ObjectFile instances should return the MD5 checksum of all of the bytes for the object file (or memory for memory based object files).
Implements lldb_private::ObjectFile.
Definition at line 5111 of file ObjectFileMachO.cpp.
References lldb_private::ModuleChild::GetModule(), GetUUID(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().
Referenced by CalculateStrata(), CalculateType(), GetAllArchSpecs(), GetUUID(), and SetLoadAddress().
|
staticprotected |
Definition at line 4832 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::GetU32(), and lldb_private::DataExtractor::PeekData().
|
overridevirtual |
Get the object file version numbers.
Many object files have a set of version numbers that describe the version of the executable or shared library. Typically there are major, minor and build, but there may be more. This function will extract the versions from object files if they are available.
Reimplemented from lldb_private::ObjectFile.
Definition at line 5891 of file ObjectFileMachO.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().
|
static |
Definition at line 793 of file ObjectFileMachO.cpp.
References CreateInstance(), CreateMemoryInstance(), GetModuleSpecifications(), GetPluginDescriptionStatic(), GetPluginNameStatic(), lldb_private::PluginManager::RegisterPlugin(), and SaveCore().
|
inlineoverridevirtual |
Reimplemented from lldb_private::ObjectFile.
Definition at line 73 of file ObjectFileMachO.h.
References ID.
bool ObjectFileMachO::IsDynamicLoader | ( | ) | const |
Definition at line 1119 of file ObjectFileMachO.cpp.
References m_header.
Referenced by GetEntryPointAddress().
|
overridevirtual |
Tells whether this object file is capable of being the main executable for a process.
Implements lldb_private::ObjectFile.
Definition at line 1115 of file ObjectFileMachO.cpp.
References m_header.
Referenced by GetEntryPointAddress().
bool ObjectFileMachO::IsKext | ( | ) | const |
Definition at line 1127 of file ObjectFileMachO.cpp.
References m_header.
bool ObjectFileMachO::IsSharedCacheBinary | ( | ) | const |
Definition at line 1123 of file ObjectFileMachO.cpp.
References m_header.
Referenced by ParseSymtab(), ProcessSegmentCommand(), and SanitizeSegmentCommand().
|
overridevirtual |
Detect if this object file has been stripped of local symbols.
Detect if this object file has been stripped of local symbols.
Implements lldb_private::ObjectFile.
Definition at line 1303 of file ObjectFileMachO.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_dysymtab, m_header, and MachHeaderSizeFromMagic().
|
overridevirtual |
Load binaries listed in a corefile.
A corefile may have metadata listing binaries that can be loaded, and the offsets at which they were loaded. This method will try to add them to the Target. If any binaries were loaded,
[in] | process | Process where to load binaries. |
Reimplemented from lldb_private::ObjectFile.
Definition at line 6997 of file ObjectFileMachO.cpp.
References ObjectFileMachO::MachOCorefileAllImageInfos::all_image_infos, lldb_private::ModuleList::Append(), ObjectFileMachO::MachOCorefileImageEntry::currently_executing, error(), ObjectFileMachO::MachOCorefileImageEntry::filename, lldb_private::SectionList::FindSectionByName(), lldb_private::Process::Flush(), lldb_private::UUID::GetAsString(), GetCorefileAllImageInfos(), lldb_private::Target::GetDebugger(), lldb_private::GetLog(), lldb_private::Debugger::GetPlatformList(), lldb_private::ModuleList::GetSize(), lldb_private::Process::GetTarget(), lldb_private::UUID::IsValid(), LLDB_INVALID_ADDRESS, LLDB_LOGF, ObjectFileMachO::MachOCorefileImageEntry::load_address, lldb_private::DynamicLoader::LoadBinaryWithUUIDAndAddress(), lldb_private::PlatformList::LoadPlatformBinaryAndSetup(), lldb_private::Target::ModulesDidLoad(), lldb_private::Log::Printf(), ObjectFileMachO::MachOCorefileImageEntry::segment_load_addresses, lldb_private::Target::SetSectionLoadAddress(), ObjectFileMachO::MachOCorefileImageEntry::slide, and ObjectFileMachO::MachOCorefileImageEntry::uuid.
|
static |
Definition at line 921 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::GetU32(), MachHeaderSizeFromMagic(), and lldb_private::DataExtractor::SetData().
Referenced by CreateInstance(), CreateMemoryInstance(), and GetModuleSpecifications().
|
overridevirtual |
Attempts to parse the object header.
This function is used as a test to see if a given plug-in instance can parse the header data already contained in ObjectFile::m_data. If an object file parser does not recognize that magic bytes in a header, false should be returned and the next plug-in can attempt to parse an object file.
Implements lldb_private::ObjectFile.
Definition at line 1022 of file ObjectFileMachO.cpp.
References lldb::eByteOrderBig, lldb::eByteOrderLittle, GetAllArchSpecs(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::DataExtractor::GetByteSize(), lldb_private::ModuleChild::GetModule(), lldb_private::ModuleSpecList::GetModuleSpecRefAtIndex(), lldb_private::ModuleSpecList::GetSize(), lldb_private::DataExtractor::GetU32(), lldb_private::endian::InlHostByteOrder(), lldb_private::ArchSpec::IsCompatibleMatch(), lldb_private::ArchSpec::IsValid(), lldb_private::ObjectFile::m_data, lldb_private::ObjectFile::m_file, lldb_private::ObjectFile::m_file_offset, m_header, lldb_private::ObjectFile::m_memory_addr, lldb_private::ObjectFile::m_process_wp, MachHeaderSizeFromMagic(), lldb_private::ObjectFile::MapFileData(), lldb_private::ObjectFile::ReadMemory(), lldb_private::DataExtractor::SetAddressByteSize(), lldb_private::DataExtractor::SetByteOrder(), lldb_private::DataExtractor::SetData(), and lldb_private::ObjectFile::SetModulesArchitecture().
Referenced by ProcessMachCore::CreateInstance(), and GetModuleSpecifications().
|
static |
|
protected |
|
overridevirtual |
Parse the symbol table into the provides symbol table object.
Symbol table parsing will be done once when this function is called by each object file plugin. All of the necessary locks will already be acquired before this function is called and the symbol table object to populate is supplied as an argument and doesn't need to be created by each plug-in.
The | symbol table to populate. |
Implements lldb_private::ObjectFile.
Definition at line 2225 of file ObjectFileMachO.cpp.
References lldb_private::FileSpecList::Append(), lldb_private::FileSpecList::AppendIfUnique(), lldb_private::ConstString::AsCString(), lldb_private::Range< B, S >::base, CalculateStrata(), lldb_private::Symbol::Clear(), lldb_private::FileSpec::ClearDirectory(), DebugSymbols, lldb_private::DWARFCallFrameInfo::EH, lldb_private::eMemoryModuleLoadLevelComplete, lldb_private::eMemoryModuleLoadLevelPartial, lldb_private::Mangled::ePreferMangled, lldb::eSectionTypeCode, lldb::eSectionTypeData, lldb::eSectionTypeData16, lldb::eSectionTypeData4, lldb::eSectionTypeData8, lldb::eSectionTypeDataCString, lldb::eSectionTypeDataCStringPointers, lldb::eSectionTypeDataSymbolAddress, lldb_private::ObjectFile::eStrataUser, lldb::eSymbolTypeAbsolute, lldb::eSymbolTypeAdditional, lldb::eSymbolTypeCode, lldb::eSymbolTypeCommonBlock, lldb::eSymbolTypeCompiler, lldb::eSymbolTypeData, lldb::eSymbolTypeException, lldb::eSymbolTypeHeaderFile, lldb::eSymbolTypeInstrumentation, lldb::eSymbolTypeInvalid, lldb::eSymbolTypeLineEntry, lldb::eSymbolTypeLocal, lldb::eSymbolTypeObjCClass, lldb::eSymbolTypeObjCIVar, lldb::eSymbolTypeObjCMetaClass, lldb::eSymbolTypeObjectFile, lldb::eSymbolTypeReExported, lldb::eSymbolTypeResolver, lldb::eSymbolTypeRuntime, lldb::eSymbolTypeScopeBegin, lldb::eSymbolTypeScopeEnd, lldb::eSymbolTypeSourceFile, lldb::eSymbolTypeTrampoline, lldb::eSymbolTypeUndefined, lldb::eSymbolTypeVariable, lldb::eSymbolTypeVariableType, lldb_private::ObjectFile::eTypeDebugInfo, lldb_private::SectionList::FindSectionByName(), lldb_private::Symtab::FindSymbolByID(), lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::Symbol::GetAddressRef(), GetArchitecture(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::Symbol::GetByteSize(), lldb_private::ConstString::GetCString(), lldb_private::Mangled::GetDemangledName(), lldb_private::RangeVector< B, S, N >::GetEntryAtIndex(), lldb_private::Address::GetFileAddress(), lldb_private::FileSpec::GetFilename(), lldb_private::FileSpecList::GetFileSpecAtIndex(), lldb_private::DWARFCallFrameInfo::GetFunctionAddressAndSizeVector(), lldb_private::GetLog(), lldb_private::Symbol::GetMangled(), lldb_private::TargetProperties::GetMemoryModuleLoadLevel(), lldb_private::ModuleChild::GetModule(), lldb_private::Mangled::GetName(), GetName(), lldb_private::Symtab::GetNumSymbols(), GetProcessSharedCacheUUID(), lldb_private::Address::GetSection(), MachSymtabSectionInfo::GetSection(), lldb_private::ObjectFile::GetSectionList(), GetSectionNameEHFrame(), GetSegmentNameDATA(), GetSegmentNameDATA_CONST(), GetSegmentNameDATA_DIRTY(), GetSegmentNameOBJC(), GetSegmentNameTEXT(), lldb_private::FileSpecList::GetSize(), lldb_private::RangeVector< B, S, N >::GetSize(), GetSymbolType(), lldb_private::ObjectFile::GetSymbolTypeFromName(), lldb_private::Symbol::GetType(), lldb_private::DataExtractor::GetU32(), lldb_private::FileSystem::Instance(), lldb_private::ArchSpec::IsAlwaysThumbInstructions(), lldb_private::ObjectFile::IsInMemory(), IsSharedCacheBinary(), lldb_private::UUID::IsValid(), KERN_SUCCESS, LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_SCOPED_TIMERF, lldbassert, m_allow_assembly_emulation_unwind_plans, lldb_private::ObjectFile::m_data, m_dysymtab, lldb_private::ObjectFile::m_file, m_header, m_linkedit_original_offset, m_mach_sections, m_reexported_dylibs, lldb_private::ObjectFile::m_type, mach_task_self(), MachHeaderSizeFromMagic(), MACHO_NLIST_ARM_SYMBOL_IS_THUMB, NonDebugSymbols, ParseNList(), ParseTrieEntries(), lldb_private::DataExtractor::PeekCStr(), lldb_private::DataExtractor::PeekData(), lldb_private::Debugger::ReportError(), lldb_private::Symtab::Resize(), lldb_private::Symbol::SetByteSize(), lldb_private::Symbol::SetDebug(), lldb_private::Mangled::SetDemangledName(), lldb_private::Symbol::SetDemangledNameIsSynthesized(), lldb_private::Symbol::SetExternal(), lldb_private::FileSpec::SetFile(), lldb_private::Symbol::SetFlags(), lldb_private::Symbol::SetID(), lldb_private::Symbol::SetIsSynthetic(), lldb_private::Symbol::SetIsWeak(), lldb_private::Mangled::SetMangledName(), lldb_private::Address::SetOffset(), lldb_private::Symbol::SetReExportedSymbolName(), lldb_private::Symbol::SetReExportedSymbolSharedLibrary(), lldb_private::Address::SetSection(), lldb_private::Symbol::SetSizeIsSibling(), lldb_private::Symbol::SetType(), lldb_private::Mangled::SetValue(), lldb_private::Symtab::SymbolAtIndex(), THUMB_ADDRESS_BIT_MASK, TRIE_SYMBOL_IS_THUMB, UINT32_MAX, UINT64_MAX, and lldb_private::Log::Warning().
|
protected |
Definition at line 1919 of file ObjectFileMachO.cpp.
References lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, and m_dysymtab.
Referenced by CreateSections().
|
protected |
Definition at line 1638 of file ObjectFileMachO.cpp.
References lldb_private::SectionList::AddSection(), lldb_private::ConstString::AsCString(), lldb_private::ConstString::Clear(), ObjectFileMachO::SegmentParsingContext::EncryptedRanges, lldb::eSectionTypeContainer, lldb_private::ObjectFile::eTypeCoreFile, ObjectFileMachO::SegmentParsingContext::FileAddressesChanged, lldb_private::RangeVector< B, S, N >::FindEntryThatContains(), lldb_private::SectionList::FindSectionByName(), lldb_private::DataExtractor::GetAddress(), lldb_private::Section::GetByteSize(), lldb_private::Section::GetChildren(), lldb_private::Section::GetFileAddress(), lldb_private::Section::GetFileOffset(), lldb_private::Section::GetFileSize(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), GetSectionType(), GetSegmentNameLINKEDIT(), GetSegmentPermissions(), lldb_private::ObjectFile::GetType(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), lldb_private::ObjectFile::IsInMemory(), IsSharedCacheBinary(), lldb_private::ObjectFile::m_data, m_header, m_mach_sections, lldb_private::ObjectFile::m_sections_up, m_text_address, ObjectFileMachO::SegmentParsingContext::NextSectionIdx, ObjectFileMachO::SegmentParsingContext::NextSegmentIdx, lldb_private::Log::Printf(), SanitizeSegmentCommand(), lldb_private::Section::SetByteSize(), lldb_private::Section::SetFileOffset(), lldb_private::Section::SetFileSize(), lldb_private::ConstString::SetTrimmedCStringWithLength(), lldb_private::SectionList::Slide(), lldb_private::Section::Slide(), and ObjectFileMachO::SegmentParsingContext::UnifiedList.
Referenced by CreateSections().
|
protected |
Definition at line 1363 of file ObjectFileMachO.cpp.
References lldb_private::ModuleChild::GetModule(), GetSegmentNameLINKEDIT(), GetSegmentNameTEXT(), lldb_private::ObjectFile::IsInMemory(), IsSharedCacheBinary(), lldb_private::ObjectFile::m_length, m_linkedit_original_offset, and m_text_address.
Referenced by ProcessSegmentCommand().
|
static |
Definition at line 6525 of file ObjectFileMachO.cpp.
References lldb_private::bits(), RegisterContextDarwin_x86_64_Mach::Create_LC_THREAD(), RegisterContextDarwin_i386_Mach::Create_LC_THREAD(), RegisterContextDarwin_arm_Mach::Create_LC_THREAD(), RegisterContextDarwin_arm64_Mach::Create_LC_THREAD(), CreateAllImageInfosPayload(), lldb_private::Stream::eBinary, lldb_private::File::eOpenOptionCanCreate, lldb_private::File::eOpenOptionTruncate, lldb_private::File::eOpenOptionWriteOnly, error(), lldb::eSaveCoreDirtyOnly, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::Debugger::GetAsyncOutputStream(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::StreamString::GetData(), lldb_private::Target::GetDebugger(), lldb_private::ArchSpec::GetMachine(), lldb_private::ArchSpec::GetMachOCPUSubType(), lldb_private::ArchSpec::GetMachOCPUType(), lldb_private::SaveCoreOptions::GetOutputFile(), lldb_private::FileSpec::GetPath(), lldb_private::StreamString::GetSize(), lldb_private::ThreadList::GetSize(), lldb_private::StreamString::GetString(), lldb_private::SaveCoreOptions::GetStyle(), lldb_private::ThreadList::GetThreadAtIndex(), lldb_private::ArchSpec::GetTriple(), lldb_private::FileSystem::Instance(), LLDB_INVALID_ADDRESS_MASK, memory_read_error, lldb_private::FileSystem::Open(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutHex64(), lldb_private::Stream::PutRawBytes(), lldb_private::SaveCoreOptions::SetStyle(), and lldb_private::Stream::Write().
Referenced by Initialize().
|
protected |
Definition at line 6161 of file ObjectFileMachO.cpp.
References lldb_private::ObjectFile::eStrataKernel, lldb_private::ObjectFile::eStrataRawImage, lldb_private::ModuleChild::GetModule(), lldb_private::Section::GetName(), GetSegmentNameDWARF(), GetSegmentNameLINKEDIT(), GetSegmentNameLLVM_COV(), lldb_private::ObjectFile::GetStrata(), lldb_private::Section::IsThreadSpecific(), and lldb_private::ObjectFile::m_process_wp.
Referenced by CalculateSectionLoadAddressForMemoryImage(), GetMachHeaderSection(), and SetLoadAddress().
|
overridevirtual |
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the implementation.
Reimplemented from lldb_private::ObjectFile.
Definition at line 6201 of file ObjectFileMachO.cpp.
References CalculateSectionLoadAddressForMemoryImage(), lldb_private::UUID::GetAsString(), lldb_private::StreamString::GetData(), lldb_private::ObjectFile::GetFileSpec(), lldb_private::GetLog(), GetMachHeaderSection(), lldb_private::ModuleChild::GetModule(), lldb_private::FileSpec::GetPath(), lldb_private::SectionList::GetSectionAtIndex(), lldb_private::ObjectFile::GetSectionList(), lldb_private::Target::GetSectionLoadList(), lldb_private::SectionList::GetSize(), GetUUID(), LLDB_INVALID_ADDRESS, LLDB_LOGF, SectionIsLoadable(), and lldb_private::SectionLoadList::SetSectionLoadAddress().
|
static |
Definition at line 799 of file ObjectFileMachO.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
static |
Definition at line 72 of file ObjectFileMachO.h.
|
protected |
Definition at line 287 of file ObjectFileMachO.h.
Referenced by AllowAssemblyEmulationUnwindPlans(), and ParseSymtab().
|
protected |
Definition at line 276 of file ObjectFileMachO.h.
Referenced by IsStripped(), ObjectFileMachO(), ParseSymtab(), and ProcessDysymtabCommand().
|
protected |
Definition at line 281 of file ObjectFileMachO.h.
Referenced by GetEntryPointAddress().
|
protected |
Definition at line 265 of file ObjectFileMachO.h.
Referenced by CalculateStrata(), CalculateType(), CanTrustAddressRanges(), CreateSections(), Dump(), FindLC_NOTEByName(), GetAddressClass(), GetArchitecture(), GetDependentModules(), GetEncryptedFileRanges(), GetEntryPointAddress(), GetIdentifierString(), GetIsDynamicLinkEditor(), GetMinimumOSVersion(), GetNumThreadContexts(), GetSDKVersion(), GetThreadContextAtIndex(), GetUUID(), GetVersion(), IsDynamicLoader(), IsExecutable(), IsKext(), IsSharedCacheBinary(), IsStripped(), ObjectFileMachO(), ParseHeader(), ParseSymtab(), and ProcessSegmentCommand().
|
protected |
Definition at line 283 of file ObjectFileMachO.h.
Referenced by ParseSymtab(), and SanitizeSegmentCommand().
|
protected |
Definition at line 277 of file ObjectFileMachO.h.
Referenced by ParseSymtab(), and ProcessSegmentCommand().
|
protected |
Definition at line 278 of file ObjectFileMachO.h.
Referenced by GetMinimumOSVersion().
|
protected |
Definition at line 286 of file ObjectFileMachO.h.
Referenced by GetReExportedLibraries(), and ParseSymtab().
|
protected |
Definition at line 279 of file ObjectFileMachO.h.
Referenced by GetSDKVersion().
|
protected |
Definition at line 284 of file ObjectFileMachO.h.
Referenced by ProcessSegmentCommand(), and SanitizeSegmentCommand().
|
protected |
Definition at line 282 of file ObjectFileMachO.h.
Referenced by GetNumThreadContexts(), and GetThreadContextAtIndex().
|
protected |
Definition at line 285 of file ObjectFileMachO.h.
Referenced by GetNumThreadContexts(), and GetThreadContextAtIndex().