LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ObjectFileMachO Class Reference

#include <ObjectFileMachO.h>

Inheritance diagram for ObjectFileMachO:
Inheritance graph
[legend]
Collaboration diagram for ObjectFileMachO:
Collaboration graph
[legend]

Classes

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::DataBufferSP &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. More...
 
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. More...
 
lldb::ByteOrder GetByteOrder () const override
 Gets whether endian swapping should occur when extracting data from this object file. More...
 
bool IsExecutable () const override
 Tells whether this object file is capable of being the main executable for a process. More...
 
bool IsDynamicLoader () const
 
uint32_t GetAddressByteSize () const override
 Gets the address size in bytes for the current object file. More...
 
lldb_private::AddressClass GetAddressClass (lldb::addr_t file_addr) override
 Get the address type given a file address in an object file. More...
 
lldb_private::SymtabGetSymtab () override
 Gets the symbol table for the currently selected architecture (and object for archives). More...
 
bool IsStripped () override
 Detect if this object file has been stripped of local symbols. More...
 
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. More...
 
lldb_private::ArchSpec GetArchitecture () override
 Get the ArchSpec for this object file. More...
 
lldb_private::UUID GetUUID () override
 Gets the UUID for this object file. More...
 
uint32_t GetDependentModules (lldb_private::FileSpecList &files) override
 
lldb_private::FileSpecList GetReExportedLibraries () override
 Gets the file spec list of libraries re-exported by this object file. More...
 
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. More...
 
lldb_private::Address GetBaseAddress () override
 Returns base address of this object file. More...
 
uint32_t GetNumThreadContexts () override
 
std::string GetIdentifierString () override
 Some object files may have an identifier string embedded in them, e.g. More...
 
bool GetCorefileMainBinaryInfo (lldb::addr_t &address, lldb_private::UUID &uuid) override
 When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file. More...
 
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. More...
 
ObjectFile::Strata CalculateStrata () override
 The object file should be able to calculate the strata of the object file. More...
 
llvm::VersionTuple GetVersion () override
 Get the object file version numbers. More...
 
llvm::VersionTuple GetMinimumOSVersion () override
 Get the minimum OS version this object file can run on. More...
 
llvm::VersionTuple GetSDKVersion () override
 Get the SDK OS version this object file was built with. More...
 
bool GetIsDynamicLinkEditor () override
 Return true if this file is a dynamic link editor (dyld) More...
 
bool AllowAssemblyEmulationUnwindPlans () override
 Returns if the function bounds for symbols in this symbol file are likely accurate. More...
 
lldb_private::ConstString GetPluginName () override
 
uint32_t GetPluginVersion () 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, const lldb::DataBufferSP &data_sp, lldb::offset_t data_offset)
 Construct with a parent module, offset, and header data. More...
 
 ObjectFile (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP &data_sp)
 
 ~ObjectFile () override
 Destructor. More...
 
virtual uint32_t GetDependentModules (FileSpecList &file_list)=0
 Extract the dependent modules from an object file. More...
 
virtual lldb::addr_t GetFileOffset () const
 Returns the offset into a file at which this object resides. More...
 
virtual lldb::addr_t GetByteSize () const
 
virtual FileSpecGetFileSpec ()
 Get accessor to the object file specification. More...
 
virtual const FileSpecGetFileSpec () const
 Get const accessor to the object file specification. More...
 
virtual SectionListGetSectionList (bool update_module_section_list=true)
 Gets the section list for the currently selected architecture (and object for archives). More...
 
virtual void SectionFileAddressesChanged ()
 Notify the ObjectFile that the file addresses in the Sections for this module have been changed. More...
 
virtual void RelocateSection (lldb_private::Section *section)
 Perform relocations on the section if necessary. More...
 
virtual SymbolResolveSymbolForAddress (const Address &so_addr, bool verify_unique)
 Appends a Symbol for the specified so_addr to the symbol table. More...
 
virtual void ClearSymtab ()
 Frees the symbol table. More...
 
virtual lldb_private::Address GetImageInfoAddress (Target *target)
 Similar to Process::GetImageInfoAddress(). More...
 
virtual void SetType (Type type)
 In cases where the type can't be calculated (elf files), this routine allows someone to explicitly set it. More...
 
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 &section_data)
 
bool IsInMemory () const
 
virtual llvm::StringRef StripLinkerSymbolAnnotations (llvm::StringRef symbol_name) const
 
virtual std::vector< LoadableDataGetLoadableData (Target &target)
 Loads this objfile to memory. More...
 
virtual std::unique_ptr< CallFrameInfoCreateCallFrameInfo ()
 Creates a plugin-specific call frame info. More...
 
- Public Member Functions inherited from lldb_private::PluginInterface
virtual ~PluginInterface ()
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module. More...
 
 ~ModuleChild ()
 Destructor. More...
 
const ModuleChildoperator= (const ModuleChild &rhs)
 Assignment operator. More...
 
lldb::ModuleSP GetModule () const
 Get const accessor for the module pointer. More...
 
void SetModule (const lldb::ModuleSP &module_sp)
 Set accessor for the module pointer. More...
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static lldb_private::ConstString GetPluginNameStatic ()
 
static const char * GetPluginDescriptionStatic ()
 
static lldb_private::ObjectFileCreateInstance (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
 
static lldb_private::ObjectFileCreateMemoryInstance (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
 
static size_t GetModuleSpecifications (const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs)
 
static bool SaveCore (const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, lldb_private::Status &error)
 
static bool MagicBytesMatch (lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length)
 
static bool classof (const ObjectFile *obj)
 
static bool ParseHeader (lldb_private::DataExtractor &data, lldb::offset_t *data_offset_ptr, llvm::MachO::mach_header &header)
 
- Static Public Member Functions inherited from lldb_private::ObjectFile
static lldb::ObjectFileSP FindPlugin (const lldb::ModuleSP &module_sp, const FileSpec *file_spec, lldb::offset_t file_offset, lldb::offset_t file_size, lldb::DataBufferSP &data_sp, lldb::offset_t &data_offset)
 Find a ObjectFile plug-in that can parse file_spec. More...
 
static lldb::ObjectFileSP FindPlugin (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP &file_data_sp)
 Find a ObjectFile plug-in that can parse a file in memory. More...
 
static size_t GetModuleSpecifications (const FileSpec &file, lldb::offset_t file_offset, lldb::offset_t file_size, ModuleSpecList &specs)
 
static size_t GetModuleSpecifications (const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t file_size, lldb_private::ModuleSpecList &specs)
 
static bool SplitArchivePathWithObject (llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist)
 Split a path into a file path with object name. More...
 
static lldb::DataBufferSP ReadMemory (const lldb::ProcessSP &process_sp, lldb::addr_t addr, size_t byte_size)
 
static lldb::SymbolType GetSymbolTypeFromName (llvm::StringRef name, lldb::SymbolType symbol_type_hint=lldb::eSymbolTypeUndefined)
 

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_tFileRangeArray
 

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. More...
 
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. More...
 
lldb_private::SectionGetMachHeaderSection ()
 
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)
 
- Protected Member Functions inherited from lldb_private::ObjectFile
bool SetModulesArchitecture (const ArchSpec &new_arch)
 Sets the architecture for a module. More...
 
ConstString GetNextSyntheticSymbolName ()
 

Static Protected Member Functions

static lldb_private::UUID GetUUID (const llvm::MachO::mach_header &header, const lldb_private::DataExtractor &data, lldb::offset_t lc_offset)
 
static lldb_private::ArchSpec GetArchitecture (lldb::ModuleSP module_sp, const llvm::MachO::mach_header &header, const lldb_private::DataExtractor &data, lldb::offset_t lc_offset)
 
static void GetAllArchSpecs (const llvm::MachO::mach_header &header, const lldb_private::DataExtractor &data, lldb::offset_t lc_offset, lldb_private::ModuleSpec &base_spec, lldb_private::ModuleSpecList &all_specs)
 Enumerate all ArchSpecs supported by this Mach-O file. More...
 
static lldb_private::ConstString GetSegmentNameTEXT ()
 
static lldb_private::ConstString GetSegmentNameDATA ()
 
static lldb_private::ConstString GetSegmentNameDATA_DIRTY ()
 
static lldb_private::ConstString GetSegmentNameDATA_CONST ()
 
static lldb_private::ConstString GetSegmentNameOBJC ()
 
static lldb_private::ConstString GetSegmentNameLINKEDIT ()
 
static lldb_private::ConstString GetSegmentNameDWARF ()
 
static lldb_private::ConstString GetSectionNameEHFrame ()
 
- Static Protected Member Functions inherited from lldb_private::ObjectFile
static lldb::DataBufferSP MapFileData (const FileSpec &file, uint64_t Size, uint64_t Offset)
 

Protected Attributes

llvm::MachO::mach_header m_header
 
llvm::MachO::dysymtab_command m_dysymtab
 
std::vector< llvm::MachO::segment_command_64 > m_mach_segments
 
std::vector< llvm::MachO::section_64 > m_mach_sections
 
llvm::Optional< llvm::VersionTuple > m_min_os_version
 
llvm::Optional< llvm::VersionTuple > m_sdk_versions
 
lldb_private::Address m_entry_point_address
 
FileRangeArray m_thread_context_offsets
 
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. More...
 
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). More...
 
DataExtractor m_data
 The data for this object file so things can be parsed lazily. More...
 
lldb::ProcessWP m_process_wp
 
const lldb::addr_t m_memory_addr
 
std::unique_ptr< lldb_private::SectionListm_sections_up
 
std::unique_ptr< lldb_private::Symtabm_symtab_up
 
uint32_t m_synthetic_symbol_idx
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class. More...
 

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
}
 

Detailed Description

Definition at line 22 of file ObjectFileMachO.h.

Member Typedef Documentation

◆ EncryptedFileRanges

Definition at line 196 of file ObjectFileMachO.h.

◆ FileRangeArray

Definition at line 225 of file ObjectFileMachO.h.

Constructor & Destructor Documentation

◆ ObjectFileMachO() [1/2]

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 
)

Referenced by MagicBytesMatch().

◆ ObjectFileMachO() [2/2]

ObjectFileMachO::ObjectFileMachO ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
const lldb::ProcessSP &  process_sp,
lldb::addr_t  header_addr 
)

Definition at line 914 of file ObjectFileMachO.cpp.

References m_dysymtab, and m_header.

◆ ~ObjectFileMachO()

ObjectFileMachO::~ObjectFileMachO ( )
overridedefault

Member Function Documentation

◆ AllowAssemblyEmulationUnwindPlans()

bool ObjectFileMachO::AllowAssemblyEmulationUnwindPlans ( )
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.

Returns
Returns true if assembly emulation should be used for this module. Only returns false if the ObjectFile is sure that symbol addresses are insufficient for accurate assembly emulation.

Reimplemented from lldb_private::ObjectFile.

Definition at line 6029 of file ObjectFileMachO.cpp.

References m_allow_assembly_emulation_unwind_plans.

Referenced by GetReExportedLibraries().

◆ CalculateSectionLoadAddressForMemoryImage()

lldb::addr_t ObjectFileMachO::CalculateSectionLoadAddressForMemoryImage ( lldb::addr_t  mach_header_load_address,
const lldb_private::Section mach_header_section,
const lldb_private::Section section 
)
protected

◆ CalculateStrata()

ObjectFile::Strata ObjectFileMachO::CalculateStrata ( )
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.

Returns
The calculated object file strata for the current object file.

Implements lldb_private::ObjectFile.

Definition at line 5668 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 GetReExportedLibraries(), and ParseSymtab().

◆ CalculateType()

ObjectFile::Type ObjectFileMachO::CalculateType ( )
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.

Returns
The calculated file type for the current object file.

Implements lldb_private::ObjectFile.

Definition at line 5625 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(), and GetReExportedLibraries().

◆ classof()

static bool ObjectFileMachO::classof ( const ObjectFile obj)
inlinestatic

◆ CreateInstance()

ObjectFile * ObjectFileMachO::CreateInstance ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
lldb::offset_t  data_offset,
const lldb_private::FileSpec file,
lldb::offset_t  file_offset,
lldb::offset_t  length 
)
static

Definition at line 777 of file ObjectFileMachO.cpp.

References MagicBytesMatch().

◆ CreateMemoryInstance()

ObjectFile * ObjectFileMachO::CreateMemoryInstance ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
const lldb::ProcessSP &  process_sp,
lldb::addr_t  header_addr 
)
static

Definition at line 808 of file ObjectFileMachO.cpp.

References MagicBytesMatch().

◆ CreateSections()

void ObjectFileMachO::CreateSections ( lldb_private::SectionList unified_section_list)
overridevirtual

◆ Dump()

void ObjectFileMachO::Dump ( lldb_private::Stream s)
overridevirtual

◆ GetAddressByteSize()

uint32_t ObjectFileMachO::GetAddressByteSize ( ) const
overridevirtual

Gets the address size in bytes for the current object file.

Returns
The size of an address in bytes for the currently selected architecture (and object for archives). Returns zero if no architecture or object has been selected.

Implements lldb_private::ObjectFile.

Definition at line 1081 of file ObjectFileMachO.cpp.

References lldb_private::DataExtractor::GetAddressByteSize(), and lldb_private::ObjectFile::m_data.

Referenced by CalculateType(), and classof().

◆ GetAddressClass()

AddressClass ObjectFileMachO::GetAddressClass ( lldb::addr_t  file_addr)
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

Returns
The size of an address in bytes for the currently selected architecture (and object for archives). Returns zero if no architecture or object has been selected.

Reimplemented from lldb_private::ObjectFile.

Definition at line 1085 of file ObjectFileMachO.cpp.

References lldb::eSectionTypeAbsoluteAddress, lldb::eSectionTypeARMexidx, lldb::eSectionTypeARMextab, lldb::eSectionTypeCode, lldb::eSectionTypeCompactUnwind, lldb::eSectionTypeContainer, 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::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(), GetSymtab(), lldb_private::Symbol::GetType(), m_header, MACHO_NLIST_ARM_SYMBOL_IS_THUMB, and lldb_private::Symbol::ValueIsAddress().

Referenced by classof().

◆ GetAllArchSpecs()

void ObjectFileMachO::GetAllArchSpecs ( const llvm::MachO::mach_header &  header,
const lldb_private::DataExtractor data,
lldb::offset_t  lc_offset,
lldb_private::ModuleSpec base_spec,
lldb_private::ModuleSpecList all_specs 
)
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 4972 of file ObjectFileMachO.cpp.

References lldb_private::ModuleSpecList::Append(), lldb_private::eArchTypeMachO, lldb_private::DataExtractor::ExtractBytes(), GetArchitecture(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::ModuleSpecList::GetModuleSpecRefAtIndex(), GetOSName(), lldb_private::ModuleSpecList::GetSize(), lldb_private::ArchSpec::GetTriple(), lldb_private::DataExtractor::GetU32(), GetUUID(), lldb_private::ArchSpec::IsCompatibleMatch(), MachHeaderSizeFromMagic(), NULL, and lldb_private::ArchSpec::SetArchitecture().

Referenced by Dump(), GetReExportedLibraries(), and ParseHeader().

◆ GetArchitecture() [1/2]

ArchSpec ObjectFileMachO::GetArchitecture ( )
overridevirtual

Get the ArchSpec for this object file.

Returns
The ArchSpec of this object file. In case of error, an invalid ArchSpec object is returned.

Implements lldb_private::ObjectFile.

Definition at line 5761 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().

Referenced by classof(), GetAllArchSpecs(), GetReExportedLibraries(), and ParseSymtab().

◆ GetArchitecture() [2/2]

static lldb_private::ArchSpec ObjectFileMachO::GetArchitecture ( lldb::ModuleSP  module_sp,
const llvm::MachO::mach_header &  header,
const lldb_private::DataExtractor data,
lldb::offset_t  lc_offset 
)
staticprotected

◆ GetBaseAddress()

lldb_private::Address ObjectFileMachO::GetBaseAddress ( )
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 5418 of file ObjectFileMachO.cpp.

References lldb_private::SectionList::FindSectionByName(), lldb_private::ObjectFile::GetSectionList(), GetSegmentNameTEXT(), lldb_private::Address::SetOffset(), and lldb_private::Address::SetSection().

Referenced by GetReExportedLibraries().

◆ GetByteOrder()

ByteOrder ObjectFileMachO::GetByteOrder ( ) const
overridevirtual

Gets whether endian swapping should occur when extracting data from this object file.

Returns
Returns true if endian swapping is needed, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 1069 of file ObjectFileMachO.cpp.

References lldb_private::DataExtractor::GetByteOrder(), and lldb_private::ObjectFile::m_data.

Referenced by classof().

◆ GetCorefileMainBinaryInfo()

bool ObjectFileMachO::GetCorefileMainBinaryInfo ( lldb::addr_t address,
lldb_private::UUID uuid 
)
overridevirtual

When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file.

lldb can iterate over the pages looking for a valid binary, but some core files may have metadata describing where the main binary is exactly which removes ambiguity when there are multiple binaries present in the captured memory pages.

Parameters
[out]addressIf the address of the binary is specified, this will be set. This is an address is the virtual address space of the core file memory segments; it is not an offset into the object file. If no address is available, will be set to LLDB_INVALID_ADDRESS.
[out]uuidIf the uuid of the binary is specified, this will be set. If no UUID is available, will be cleared.
Returns
Returns true if either address or uuid has been set.

Reimplemented from lldb_private::ObjectFile.

Definition at line 5528 of file ObjectFileMachO.cpp.

References lldb_private::UUID::Clear(), lldb_private::DataExtractor::CopyData(), lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU64_unchecked(), LLDB_INVALID_ADDRESS, lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().

Referenced by GetReExportedLibraries().

◆ GetDependentModules()

uint32_t ObjectFileMachO::GetDependentModules ( lldb_private::FileSpecList &  files)
override

◆ GetEncryptedFileRanges()

ObjectFileMachO::EncryptedFileRanges ObjectFileMachO::GetEncryptedFileRanges ( )
protected

◆ GetEntryPointAddress()

lldb_private::Address ObjectFileMachO::GetEntryPointAddress ( )
overridevirtual

◆ GetIdentifierString()

std::string ObjectFileMachO::GetIdentifierString ( )
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)

Returns
Returns the identifier string if one exists, else an empty string.

Reimplemented from lldb_private::ObjectFile.

Definition at line 5458 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 GetReExportedLibraries().

◆ GetIsDynamicLinkEditor()

bool ObjectFileMachO::GetIsDynamicLinkEditor ( )
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 6025 of file ObjectFileMachO.cpp.

References m_header.

Referenced by GetReExportedLibraries().

◆ GetLLDBSharedCacheUUID()

void ObjectFileMachO::GetLLDBSharedCacheUUID ( lldb::addr_t base_addir,
lldb_private::UUID uuid 
)
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 5807 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::GetLogIfAnyCategoriesSet(), lldb_private::UUID::IsValid(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_SYMBOLS, LLDB_INVALID_ADDRESS, LLDB_LOGF, and mach_task_self().

Referenced by GetReExportedLibraries(), and ParseSymtab().

◆ GetMachHeaderSection()

Section * ObjectFileMachO::GetMachHeaderSection ( )
protected

◆ GetMinimumOSVersion()

llvm::VersionTuple ObjectFileMachO::GetMinimumOSVersion ( )
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.

Returns
This function returns extracted version numbers as a llvm::VersionTuple. In case of error an empty VersionTuple is returned.

Reimplemented from lldb_private::ObjectFile.

Definition at line 5890 of file ObjectFileMachO.cpp.

References lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, m_min_os_version, and MachHeaderSizeFromMagic().

Referenced by GetReExportedLibraries().

◆ GetModuleSpecifications()

size_t ObjectFileMachO::GetModuleSpecifications ( const lldb_private::FileSpec file,
lldb::DataBufferSP &  data_sp,
lldb::offset_t  data_offset,
lldb::offset_t  file_offset,
lldb::offset_t  length,
lldb_private::ModuleSpecList specs 
)
static

◆ GetNumThreadContexts()

uint32_t ObjectFileMachO::GetNumThreadContexts ( )
overridevirtual

◆ GetPluginDescriptionStatic()

const char * ObjectFileMachO::GetPluginDescriptionStatic ( )
static

Definition at line 773 of file ObjectFileMachO.cpp.

◆ GetPluginName()

lldb_private::ConstString ObjectFileMachO::GetPluginName ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 6034 of file ObjectFileMachO.cpp.

References GetPluginNameStatic().

Referenced by GetReExportedLibraries().

◆ GetPluginNameStatic()

lldb_private::ConstString ObjectFileMachO::GetPluginNameStatic ( )
static

Definition at line 768 of file ObjectFileMachO.cpp.

Referenced by GetPluginName().

◆ GetPluginVersion()

uint32_t ObjectFileMachO::GetPluginVersion ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 6038 of file ObjectFileMachO.cpp.

Referenced by GetReExportedLibraries().

◆ GetProcessSharedCacheUUID()

void ObjectFileMachO::GetProcessSharedCacheUUID ( lldb_private::Process process,
lldb::addr_t base_addr,
lldb_private::UUID uuid 
)
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 5773 of file ObjectFileMachO.cpp.

References lldb_private::UUID::Clear(), lldb_private::UUID::GetAsString(), lldb_private::Process::GetDynamicLoader(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::DynamicLoader::GetSharedCacheInformation(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_SYMBOLS, LLDB_INVALID_ADDRESS, and LLDB_LOGF.

Referenced by GetReExportedLibraries(), and ParseSymtab().

◆ GetReExportedLibraries()

lldb_private::FileSpecList ObjectFileMachO::GetReExportedLibraries ( )
inlineoverridevirtual

◆ GetSDKVersion()

llvm::VersionTuple ObjectFileMachO::GetSDKVersion ( )
overridevirtual

Get the SDK OS version this object file was built with.

Returns
This function returns extracted version numbers as a llvm::VersionTuple. In case of error an empty VersionTuple is returned.

Reimplemented from lldb_private::ObjectFile.

Definition at line 5951 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, m_sdk_versions, and MachHeaderSizeFromMagic().

Referenced by GetReExportedLibraries().

◆ GetSectionNameEHFrame()

ConstString ObjectFileMachO::GetSectionNameEHFrame ( )
staticprotected

Definition at line 885 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab().

◆ GetSegmentNameDATA()

ConstString ObjectFileMachO::GetSegmentNameDATA ( )
staticprotected

Definition at line 855 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab().

◆ GetSegmentNameDATA_CONST()

ConstString ObjectFileMachO::GetSegmentNameDATA_CONST ( )
staticprotected

Definition at line 865 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab().

◆ GetSegmentNameDATA_DIRTY()

ConstString ObjectFileMachO::GetSegmentNameDATA_DIRTY ( )
staticprotected

Definition at line 860 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab().

◆ GetSegmentNameDWARF()

ConstString ObjectFileMachO::GetSegmentNameDWARF ( )
staticprotected

Definition at line 880 of file ObjectFileMachO.cpp.

Referenced by SectionIsLoadable().

◆ GetSegmentNameLINKEDIT()

ConstString ObjectFileMachO::GetSegmentNameLINKEDIT ( )
staticprotected

Definition at line 875 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab(), ProcessSegmentCommand(), and SectionIsLoadable().

◆ GetSegmentNameOBJC()

ConstString ObjectFileMachO::GetSegmentNameOBJC ( )
staticprotected

Definition at line 870 of file ObjectFileMachO.cpp.

Referenced by ParseSymtab().

◆ GetSegmentNameTEXT()

ConstString ObjectFileMachO::GetSegmentNameTEXT ( )
staticprotected

Definition at line 850 of file ObjectFileMachO.cpp.

Referenced by GetBaseAddress(), and ParseSymtab().

◆ GetSharedCacheUUID()

UUID ObjectFileMachO::GetSharedCacheUUID ( lldb_private::FileSpec  dyld_shared_cache,
const lldb::ByteOrder  byte_order,
const uint32_t  addr_byte_size 
)
protected

◆ GetSymtab()

Symtab * ObjectFileMachO::GetSymtab ( )
overridevirtual

Gets the symbol table for the currently selected architecture (and object for archives).

Symbol table parsing can be deferred by ObjectFile instances until this accessor is called the first time.

Returns
The symbol table for this object file.

Implements lldb_private::ObjectFile.

Definition at line 1251 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::m_symtab_up, and ParseSymtab().

Referenced by classof(), GetAddressClass(), and GetEntryPointAddress().

◆ GetThreadContextAtIndex()

lldb::RegisterContextSP ObjectFileMachO::GetThreadContextAtIndex ( uint32_t  idx,
lldb_private::Thread thread 
)
overridevirtual

◆ GetUUID() [1/2]

UUID ObjectFileMachO::GetUUID ( )
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).

Returns
The object file's UUID. In case of an error, an empty UUID is returned.

Implements lldb_private::ObjectFile.

Definition at line 5132 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().

Referenced by CalculateStrata(), CalculateType(), classof(), GetAllArchSpecs(), and GetReExportedLibraries().

◆ GetUUID() [2/2]

UUID ObjectFileMachO::GetUUID ( const llvm::MachO::mach_header &  header,
const lldb_private::DataExtractor data,
lldb::offset_t  lc_offset 
)
staticprotected

◆ GetVersion()

llvm::VersionTuple ObjectFileMachO::GetVersion ( )
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.

Returns
This function returns extracted version numbers as a llvm::VersionTuple. In case of error an empty VersionTuple is returned.

Reimplemented from lldb_private::ObjectFile.

Definition at line 5724 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_header, and MachHeaderSizeFromMagic().

Referenced by GetReExportedLibraries().

◆ Initialize()

void ObjectFileMachO::Initialize ( )
static

Definition at line 758 of file ObjectFileMachO.cpp.

◆ isA()

bool ObjectFileMachO::isA ( const void *  ClassID) const
inlineoverridevirtual

Reimplemented from lldb_private::ObjectFile.

Definition at line 68 of file ObjectFileMachO.h.

◆ IsDynamicLoader()

bool ObjectFileMachO::IsDynamicLoader ( ) const

Definition at line 1077 of file ObjectFileMachO.cpp.

References m_header.

Referenced by classof(), and GetEntryPointAddress().

◆ IsExecutable()

bool ObjectFileMachO::IsExecutable ( ) const
overridevirtual

Tells whether this object file is capable of being the main executable for a process.

Returns
true if it is, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 1073 of file ObjectFileMachO.cpp.

References m_header.

Referenced by classof(), and GetEntryPointAddress().

◆ IsStripped()

bool ObjectFileMachO::IsStripped ( )
overridevirtual

Detect if this object file has been stripped of local symbols.

Detect if this object file has been stripped of local symbols.

Returns
Return true if the object file has been stripped of local symbols.

Implements lldb_private::ObjectFile.

Definition at line 1266 of file ObjectFileMachO.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::DataExtractor::GetU32(), lldb_private::ObjectFile::m_data, m_dysymtab, m_header, and MachHeaderSizeFromMagic().

Referenced by classof().

◆ MagicBytesMatch()

bool ObjectFileMachO::MagicBytesMatch ( lldb::DataBufferSP &  data_sp,
lldb::addr_t  offset,
lldb::addr_t  length 
)
static

◆ ParseHeader() [1/2]

bool ObjectFileMachO::ParseHeader ( )
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.

Returns
Returns true if the header was parsed successfully, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 980 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 classof(), ProcessMachCore::CreateInstance(), and GetReExportedLibraries().

◆ ParseHeader() [2/2]

bool ObjectFileMachO::ParseHeader ( lldb_private::DataExtractor data,
lldb::offset_t data_offset_ptr,
llvm::MachO::mach_header &  header 
)
static

◆ ParseSymtab()

size_t ObjectFileMachO::ParseSymtab ( )
protected

Definition at line 2144 of file ObjectFileMachO.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Range< B, S >::base, CalculateSectionLoadAddressForMemoryImage(), CalculateStrata(), lldb_private::Symtab::CalculateSymbolSizes(), lldb_private::Symbol::Clear(), lldb_private::ConstString::Clear(), DebugSymbols, lldb_copy_dyld_cache_local_symbols_entry::dylibOffset, lldb::eByteOrderLittle, lldb::eLanguageTypeUnknown, lldb_private::eMemoryModuleLoadLevelComplete, lldb_private::eMemoryModuleLoadLevelPartial, lldb_copy_dyld_cache_local_symbols_info::entriesCount, lldb_copy_dyld_cache_local_symbols_info::entriesOffset, 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::ArchSpec::GetArchitectureName(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::FileSpec::GetDirectory(), lldb_private::RangeVector< B, S, N >::GetEntryAtIndex(), lldb_private::Address::GetFileAddress(), lldb_private::FileSpec::GetFilename(), lldb_private::DWARFCallFrameInfo::GetFunctionAddressAndSizeVector(), GetLLDBSharedCacheUUID(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::GetLogIfAnyCategoriesSet(), GetMachHeaderSection(), lldb_private::Symbol::GetMangled(), lldb_private::TargetProperties::GetMemoryModuleLoadLevel(), lldb_private::ModuleChild::GetModule(), GetName(), lldb_private::ObjectFile::GetNextSyntheticSymbolName(), lldb_private::Symtab::GetNumSymbols(), GetProcessSharedCacheUUID(), lldb_private::Address::GetSection(), MachSymtabSectionInfo::GetSection(), lldb_private::ObjectFile::GetSectionList(), GetSectionNameEHFrame(), GetSegmentNameDATA(), GetSegmentNameDATA_CONST(), GetSegmentNameDATA_DIRTY(), GetSegmentNameLINKEDIT(), GetSegmentNameOBJC(), GetSegmentNameTEXT(), GetSharedCacheUUID(), lldb_private::RangeVector< B, S, N >::GetSize(), GetSymbolType(), lldb_private::Symbol::GetType(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::ArchSpec::IsAlwaysThumbInstructions(), lldb_private::UUID::IsValid(), LIBLLDB_LOG_SYMBOLS, LIBLLDB_LOG_UNWIND, LLDB_INVALID_ADDRESS, m_allow_assembly_emulation_unwind_plans, lldb_private::ObjectFile::m_data, m_dysymtab, lldb_private::ObjectFile::m_file, m_header, m_mach_sections, lldb_private::ObjectFile::m_memory_addr, m_reexported_dylibs, lldb_private::ObjectFile::m_symtab_up, lldb_private::ObjectFile::m_type, MachHeaderSizeFromMagic(), MACHO_NLIST_ARM_SYMBOL_IS_THUMB, lldb_private::ObjectFile::MapFileData(), lldb_copy_dyld_cache_local_symbols_entry::nlistCount, lldb_copy_dyld_cache_local_symbols_info::nlistOffset, lldb_copy_dyld_cache_local_symbols_entry::nlistStartIndex, NonDebugSymbols, NULL, offsetof, ParseNList(), ParseTrieEntries(), PATH_MAX, lldb_private::DataExtractor::PeekCStr(), lldb_private::ObjectFile::ReadMemory(), lldb_private::Symtab::Resize(), lldb_private::Symbol::SetByteSize(), lldb_private::Symbol::SetDebug(), 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::Address::SetOffset(), lldb_private::Symbol::SetReExportedSymbolName(), lldb_private::Symbol::SetReExportedSymbolSharedLibrary(), lldb_private::Address::SetSection(), lldb_private::Symbol::SetSizeIsSibling(), lldb_private::Symbol::SetType(), lldb_private::ObjectFile::SetType(), lldb_copy_dyld_cache_local_symbols_info::stringsOffset, lldb_private::Symtab::SymbolAtIndex(), THUMB_ADDRESS_BIT_MASK, TRIE_SYMBOL_IS_THUMB, UINT32_MAX, and lldb_private::Log::Warning().

Referenced by GetReExportedLibraries(), and GetSymtab().

◆ ProcessDysymtabCommand()

void ObjectFileMachO::ProcessDysymtabCommand ( const llvm::MachO::load_command &  load_cmd,
lldb::offset_t  offset 
)
protected

◆ ProcessSegmentCommand()

void ObjectFileMachO::ProcessSegmentCommand ( const llvm::MachO::load_command &  load_cmd,
lldb::offset_t  offset,
uint32_t  cmd_idx,
SegmentParsingContext context 
)
protected

◆ SanitizeSegmentCommand()

void ObjectFileMachO::SanitizeSegmentCommand ( llvm::MachO::segment_command_64 &  seg_cmd,
uint32_t  cmd_idx 
)
protected

◆ SaveCore()

bool ObjectFileMachO::SaveCore ( const lldb::ProcessSP &  process_sp,
const lldb_private::FileSpec outfile,
lldb_private::Status error 
)
static

◆ SectionIsLoadable()

bool ObjectFileMachO::SectionIsLoadable ( const lldb_private::Section section)
protected

◆ SetLoadAddress()

bool ObjectFileMachO::SetLoadAddress ( lldb_private::Target target,
lldb::addr_t  value,
bool  value_is_offset 
)
overridevirtual

◆ Terminate()

void ObjectFileMachO::Terminate ( )
static

Definition at line 764 of file ObjectFileMachO.cpp.

Member Data Documentation

◆ ID

char ObjectFileMachO::ID
static

Definition at line 67 of file ObjectFileMachO.h.

◆ m_allow_assembly_emulation_unwind_plans

bool ObjectFileMachO::m_allow_assembly_emulation_unwind_plans
protected

Definition at line 230 of file ObjectFileMachO.h.

Referenced by AllowAssemblyEmulationUnwindPlans(), and ParseSymtab().

◆ m_dysymtab

llvm::MachO::dysymtab_command ObjectFileMachO::m_dysymtab
protected

◆ m_entry_point_address

lldb_private::Address ObjectFileMachO::m_entry_point_address
protected

Definition at line 226 of file ObjectFileMachO.h.

Referenced by GetEntryPointAddress().

◆ m_header

llvm::MachO::mach_header ObjectFileMachO::m_header
protected

◆ m_mach_sections

std::vector<llvm::MachO::section_64> ObjectFileMachO::m_mach_sections
protected

Definition at line 222 of file ObjectFileMachO.h.

Referenced by ParseSymtab(), and ProcessSegmentCommand().

◆ m_mach_segments

std::vector<llvm::MachO::segment_command_64> ObjectFileMachO::m_mach_segments
protected

Definition at line 221 of file ObjectFileMachO.h.

Referenced by ProcessSegmentCommand().

◆ m_min_os_version

llvm::Optional<llvm::VersionTuple> ObjectFileMachO::m_min_os_version
protected

Definition at line 223 of file ObjectFileMachO.h.

Referenced by GetMinimumOSVersion().

◆ m_reexported_dylibs

lldb_private::FileSpecList ObjectFileMachO::m_reexported_dylibs
protected

Definition at line 229 of file ObjectFileMachO.h.

Referenced by GetReExportedLibraries(), and ParseSymtab().

◆ m_sdk_versions

llvm::Optional<llvm::VersionTuple> ObjectFileMachO::m_sdk_versions
protected

Definition at line 224 of file ObjectFileMachO.h.

Referenced by GetSDKVersion().

◆ m_thread_context_offsets

FileRangeArray ObjectFileMachO::m_thread_context_offsets
protected

Definition at line 227 of file ObjectFileMachO.h.

Referenced by GetNumThreadContexts(), and GetThreadContextAtIndex().

◆ m_thread_context_offsets_valid

bool ObjectFileMachO::m_thread_context_offsets_valid
protected

Definition at line 228 of file ObjectFileMachO.h.

Referenced by GetNumThreadContexts(), and GetThreadContextAtIndex().


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