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

#include <ObjectContainerBSDArchive.h>

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

Classes

class  Archive
 
struct  Object
 

Public Member Functions

 ObjectContainerBSDArchive (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)
 
 ~ObjectContainerBSDArchive () override
 
bool ParseHeader () override
 Attempts to parse the object header. More...
 
size_t GetNumObjects () const override
 Get the number of objects within this object file (archives). More...
 
void Dump (lldb_private::Stream *s) const override
 Dump a description of this object to a Stream. More...
 
lldb::ObjectFileSP GetObjectFile (const lldb_private::FileSpec *file) override
 Selects an architecture in an object file. More...
 
lldb_private::ConstString GetPluginName () override
 
uint32_t GetPluginVersion () override
 
- 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. More...
 
 ~ObjectContainer () override=default
 Destructor. More...
 
virtual bool GetArchitectureAtIndex (uint32_t idx, ArchSpec &arch) const
 Gets the architecture given an index. More...
 
virtual lldb::addr_t GetOffset () const
 Returns the offset into a file at which this object resides. More...
 
virtual lldb::addr_t GetByteSize () const
 
virtual size_t GetNumArchitectures () const
 Get the number of architectures in this object file. More...
 
virtual bool ObjectAtIndexIsContainer (uint32_t object_idx)
 
virtual ObjectFileGetObjectFileAtIndex (uint32_t object_idx)
 
virtual ObjectContainerGetObjectContainerAtIndex (uint32_t object_idx)
 
virtual const char * GetObjectNameAtIndex (uint32_t object_idx) const
 
- 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 (const ModuleChild &rhs)
 Copy constructor. 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::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 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)
 

Protected Member Functions

void SetArchive (Archive::shared_ptr &archive_sp)
 

Protected Attributes

Archive::shared_ptr m_archive_sp
 
- 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). More...
 
lldb::addr_t m_offset
 The offset in bytes into the file, or the address in memory. More...
 
lldb::addr_t m_length
 The size in bytes if known (can be zero). More...
 
DataExtractor m_data
 The data for this object file so things can be parsed lazily. More...
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class. More...
 

Detailed Description

Definition at line 24 of file ObjectContainerBSDArchive.h.

Constructor & Destructor Documentation

◆ ObjectContainerBSDArchive()

ObjectContainerBSDArchive::ObjectContainerBSDArchive ( 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 368 of file ObjectContainerBSDArchive.cpp.

Referenced by CreateInstance().

◆ ~ObjectContainerBSDArchive()

ObjectContainerBSDArchive::~ObjectContainerBSDArchive ( )
override

Definition at line 378 of file ObjectContainerBSDArchive.cpp.

Member Function Documentation

◆ CreateInstance()

ObjectContainer * ObjectContainerBSDArchive::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

◆ Dump()

void ObjectContainerBSDArchive::Dump ( lldb_private::Stream s) const
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.

Parameters
[in]sThe stream to which to dump the object description.

Implements lldb_private::ObjectContainer.

Definition at line 397 of file ObjectContainerBSDArchive.cpp.

References lldb_private::Stream::EOL(), lldb_private::ObjectContainer::GetArchitectureAtIndex(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::ObjectContainer::GetNumArchitectures(), GetNumObjects(), lldb_private::ObjectContainer::GetObjectNameAtIndex(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), and lldb_private::Stream::Printf().

Referenced by GetNumObjects().

◆ GetModuleSpecifications()

size_t ObjectContainerBSDArchive::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 ObjectContainerBSDArchive::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 60 of file ObjectContainerBSDArchive.h.

References Dump(), GetObjectFile(), GetPluginName(), GetPluginVersion(), and m_archive_sp.

Referenced by Dump().

◆ GetObjectFile()

ObjectFileSP ObjectContainerBSDArchive::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 in 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 421 of file ObjectContainerBSDArchive.cpp.

References ObjectContainerBSDArchive::Object::ar_file_offset, ObjectContainerBSDArchive::Object::ar_file_size, lldb_private::ModuleChild::GetModule(), m_archive_sp, and lldb_private::ObjectContainer::m_offset.

Referenced by GetNumObjects().

◆ GetPluginDescriptionStatic()

const char * ObjectContainerBSDArchive::GetPluginDescriptionStatic ( )
static

Definition at line 282 of file ObjectContainerBSDArchive.cpp.

Referenced by Initialize().

◆ GetPluginName()

lldb_private::ConstString ObjectContainerBSDArchive::GetPluginName ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 440 of file ObjectContainerBSDArchive.cpp.

References GetPluginNameStatic().

Referenced by GetNumObjects().

◆ GetPluginNameStatic()

lldb_private::ConstString ObjectContainerBSDArchive::GetPluginNameStatic ( )
static

Definition at line 277 of file ObjectContainerBSDArchive.cpp.

Referenced by GetPluginName(), and Initialize().

◆ GetPluginVersion()

uint32_t ObjectContainerBSDArchive::GetPluginVersion ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 444 of file ObjectContainerBSDArchive.cpp.

Referenced by GetNumObjects().

◆ Initialize()

void ObjectContainerBSDArchive::Initialize ( )
static

◆ MagicBytesMatch()

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

◆ ParseHeader()

bool ObjectContainerBSDArchive::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 380 of file ObjectContainerBSDArchive.cpp.

References lldb_private::DataExtractor::Clear(), lldb_private::DataExtractor::GetByteSize(), lldb_private::ModuleChild::GetModule(), m_archive_sp, lldb_private::ObjectContainer::m_data, lldb_private::ObjectContainer::m_file, lldb_private::ObjectContainer::m_offset, and ObjectContainerBSDArchive::Archive::ParseAndCacheArchiveForFile().

◆ SetArchive()

void ObjectContainerBSDArchive::SetArchive ( Archive::shared_ptr archive_sp)
protected

Definition at line 374 of file ObjectContainerBSDArchive.cpp.

References m_archive_sp.

◆ Terminate()

void ObjectContainerBSDArchive::Terminate ( )
static

Member Data Documentation

◆ m_archive_sp

Archive::shared_ptr ObjectContainerBSDArchive::m_archive_sp
protected

Definition at line 163 of file ObjectContainerBSDArchive.h.

Referenced by GetNumObjects(), GetObjectFile(), ParseHeader(), and SetArchive().


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