LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
lldb_private::ObjectContainerMachOFileset Class Reference

#include <ObjectContainerMachOFileset.h>

Inheritance diagram for lldb_private::ObjectContainerMachOFileset:
Inheritance graph
[legend]

Classes

struct  Entry
 

Public Member Functions

 ObjectContainerMachOFileset (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)
 
 ObjectContainerMachOFileset (const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
 
 ~ObjectContainerMachOFileset () override
 
bool ParseHeader () override
 Attempts to parse the object header.
 
size_t GetNumObjects () const override
 Get the number of objects within this object file (archives).
 
lldb::ObjectFileSP GetObjectFile (const lldb_private::FileSpec *file) override
 Selects an architecture in an object file.
 
llvm::StringRef GetPluginName () override
 
EntryFindEntry (llvm::StringRef id)
 
- Public Member Functions inherited from lldb_private::ObjectContainer
 ObjectContainer (const lldb::ModuleSP &module_sp, const FileSpec *file, 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.
 
 ~ObjectContainer () override=default
 Destructor.
 
virtual bool GetArchitectureAtIndex (uint32_t idx, ArchSpec &arch) const
 Gets the architecture given an index.
 
virtual lldb::addr_t GetOffset () const
 Returns the offset into a file at which this object resides.
 
virtual lldb::addr_t GetByteSize () const
 
virtual size_t GetNumObjects () const
 Get the number of objects within this object file (archives).
 
virtual size_t GetNumArchitectures () const
 Get the number of architectures in this object file.
 
virtual bool ParseHeader ()=0
 Attempts to parse the object header.
 
virtual lldb::ObjectFileSP GetObjectFile (const FileSpec *file)=0
 Selects an architecture in an object file.
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module.
 
 ~ModuleChild ()
 Destructor.
 
const ModuleChildoperator= (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 Member Functions

static void Initialize ()
 
static void Terminate ()
 
static llvm::StringRef GetPluginNameStatic ()
 
static llvm::StringRef GetPluginDescriptionStatic ()
 
static lldb_private::ObjectContainerCreateInstance (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)
 
static lldb_private::ObjectContainerCreateMemoryInstance (const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP 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 MagicBytesMatch (const lldb_private::DataExtractor &data)
 
static bool MagicBytesMatch (lldb::DataBufferSP data_sp, lldb::addr_t data_offset, lldb::addr_t data_length)
 
- Static Public Member Functions inherited from lldb_private::ObjectContainer
static lldb::ObjectContainerSP FindPlugin (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::WritableDataBufferSP file_data_sp)
 

Static Private Member Functions

static bool ParseHeader (lldb_private::DataExtractor &data, const lldb_private::FileSpec &file, lldb::offset_t file_offset, std::vector< Entry > &entries)
 

Private Attributes

std::vector< Entrym_entries
 
lldb::ProcessWP m_process_wp
 
const lldb::addr_t m_memory_addr
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::ObjectContainer
FileSpec m_file
 The file that represents this container objects (which can be different from the module's file).
 
lldb::addr_t m_offset
 The offset in bytes into the file, or the address in memory.
 
lldb::addr_t m_length
 The size in bytes if known (can be zero).
 
DataExtractor m_data
 The data for this object file so things can be parsed lazily.
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class.
 

Detailed Description

Definition at line 18 of file ObjectContainerMachOFileset.h.

Constructor & Destructor Documentation

◆ ObjectContainerMachOFileset() [1/2]

ObjectContainerMachOFileset::ObjectContainerMachOFileset ( 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 36 of file ObjectContainerMachOFileset.cpp.

◆ ObjectContainerMachOFileset() [2/2]

ObjectContainerMachOFileset::ObjectContainerMachOFileset ( const lldb::ModuleSP module_sp,
lldb::WritableDataBufferSP  data_sp,
const lldb::ProcessSP process_sp,
lldb::addr_t  header_addr 
)

Definition at line 43 of file ObjectContainerMachOFileset.cpp.

◆ ~ObjectContainerMachOFileset()

ObjectContainerMachOFileset::~ObjectContainerMachOFileset ( )
overridedefault

Member Function Documentation

◆ CreateInstance()

ObjectContainer * ObjectContainerMachOFileset::CreateInstance ( 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 
)
static

Definition at line 50 of file ObjectContainerMachOFileset.cpp.

References MagicBytesMatch(), and lldb_private::DataExtractor::SetData().

Referenced by Terminate().

◆ CreateMemoryInstance()

ObjectContainer * ObjectContainerMachOFileset::CreateMemoryInstance ( const lldb::ModuleSP module_sp,
lldb::WritableDataBufferSP  data_sp,
const lldb::ProcessSP process_sp,
lldb::addr_t  header_addr 
)
static

Definition at line 70 of file ObjectContainerMachOFileset.cpp.

References MagicBytesMatch().

◆ FindEntry()

ObjectContainerMachOFileset::Entry * ObjectContainerMachOFileset::FindEntry ( llvm::StringRef  id)

Definition at line 293 of file ObjectContainerMachOFileset.cpp.

References m_entries.

Referenced by GetObjectFile().

◆ GetModuleSpecifications()

size_t ObjectContainerMachOFileset::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

◆ GetNumObjects()

size_t lldb_private::ObjectContainerMachOFileset::GetNumObjects ( ) const
inlineoverridevirtual

Get the number of objects within this object file (archives).

Returns
Zero for object files that are not archives, or the number of objects contained in the archive.

Reimplemented from lldb_private::ObjectContainer.

Definition at line 65 of file ObjectContainerMachOFileset.h.

References m_entries.

◆ GetObjectFile()

ObjectFileSP ObjectContainerMachOFileset::GetObjectFile ( const lldb_private::FileSpec file)
overridevirtual

Selects an architecture in an object file.

Object files that contain a single architecture should verify that the specified arch matches the architecture in the object file and return true or false accordingly.

Object files that contain more than one architecture should attempt to select that architecture, and if successful, clear out any previous state from any previously selected architecture and prepare to return information for the new architecture.

Returns
Returns a pointer to the object file of the requested arch and optional name. Returns nullptr of no such object file exists in the container.

Implements lldb_private::ObjectContainer.

Definition at line 272 of file ObjectContainerMachOFileset.cpp.

References lldb_private::ObjectContainerMachOFileset::Entry::fileoff, FindEntry(), lldb_private::ObjectFile::FindPlugin(), lldb_private::DataExtractor::GetByteSize(), lldb_private::ConstString::GetCString(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectContainer::m_data, and lldb_private::ObjectContainer::m_offset.

◆ GetPluginDescriptionStatic()

static llvm::StringRef lldb_private::ObjectContainerMachOFileset::GetPluginDescriptionStatic ( )
inlinestatic

Definition at line 38 of file ObjectContainerMachOFileset.h.

◆ GetPluginName()

llvm::StringRef lldb_private::ObjectContainerMachOFileset::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 69 of file ObjectContainerMachOFileset.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

static llvm::StringRef lldb_private::ObjectContainerMachOFileset::GetPluginNameStatic ( )
inlinestatic

Definition at line 36 of file ObjectContainerMachOFileset.h.

Referenced by GetPluginName().

◆ Initialize()

void ObjectContainerMachOFileset::Initialize ( )
static

◆ MagicBytesMatch() [1/2]

bool ObjectContainerMachOFileset::MagicBytesMatch ( const lldb_private::DataExtractor data)
static

◆ MagicBytesMatch() [2/2]

bool ObjectContainerMachOFileset::MagicBytesMatch ( lldb::DataBufferSP  data_sp,
lldb::addr_t  data_offset,
lldb::addr_t  data_length 
)
static

◆ ParseHeader() [1/2]

bool ObjectContainerMachOFileset::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 ObjectContainer::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::ObjectContainer.

Definition at line 193 of file ObjectContainerMachOFileset.cpp.

References lldb_private::DataExtractor::GetByteSize(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectContainer::m_data, m_entries, lldb_private::ObjectContainer::m_file, m_memory_addr, lldb_private::ObjectContainer::m_offset, m_process_wp, MachHeaderSizeFromMagic(), lldb_private::ObjectFile::MapFileData(), ParseFileset(), ParseMachOHeader(), lldb_private::ObjectFile::ReadMemory(), and lldb_private::DataExtractor::SetData().

Referenced by GetModuleSpecifications().

◆ ParseHeader() [2/2]

bool ObjectContainerMachOFileset::ParseHeader ( lldb_private::DataExtractor data,
const lldb_private::FileSpec file,
lldb::offset_t  file_offset,
std::vector< Entry > &  entries 
)
staticprivate

◆ Terminate()

void ObjectContainerMachOFileset::Terminate ( )
static

Member Data Documentation

◆ m_entries

std::vector<Entry> lldb_private::ObjectContainerMachOFileset::m_entries
private

Definition at line 87 of file ObjectContainerMachOFileset.h.

Referenced by FindEntry(), GetNumObjects(), and ParseHeader().

◆ m_memory_addr

const lldb::addr_t lldb_private::ObjectContainerMachOFileset::m_memory_addr
private

Definition at line 89 of file ObjectContainerMachOFileset.h.

Referenced by ParseHeader().

◆ m_process_wp

lldb::ProcessWP lldb_private::ObjectContainerMachOFileset::m_process_wp
private

Definition at line 88 of file ObjectContainerMachOFileset.h.

Referenced by ParseHeader().


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