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

#include <ObjectFilePECOFF.h>

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

Classes

struct  coff_header
 
struct  coff_opt_header
 
struct  coff_symbol
 
struct  data_directory
 
struct  dos_header
 
struct  export_directory_entry
 
struct  section_header
 

Public Types

enum  MachineType {
  MachineUnknown = 0x0, MachineAm33 = 0x1d3, MachineAmd64 = 0x8664, MachineArm = 0x1c0,
  MachineArmNt = 0x1c4, MachineArm64 = 0xaa64, MachineEbc = 0xebc, MachineX86 = 0x14c,
  MachineIA64 = 0x200, MachineM32R = 0x9041, MachineMips16 = 0x266, MachineMipsFpu = 0x366,
  MachineMipsFpu16 = 0x466, MachinePowerPc = 0x1f0, MachinePowerPcfp = 0x1f1, MachineR4000 = 0x166,
  MachineSh3 = 0x1a2, MachineSh3dsp = 0x1a3, MachineSh4 = 0x1a6, MachineSh5 = 0x1a8,
  MachineThumb = 0x1c2, MachineWcemIpsv2 = 0x169
}
 
typedef enum ObjectFilePECOFF::MachineType MachineType
 
- 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
}
 

Public Member Functions

 ObjectFilePECOFF (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)
 
 ObjectFilePECOFF (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &header_data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
 
 ~ObjectFilePECOFF () 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...
 
uint32_t GetAddressByteSize () const override
 Gets the address size in bytes for the current 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::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...
 
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...
 
lldb_private::ConstString GetPluginName () override
 
uint32_t GetPluginVersion () override
 
bool IsWindowsSubsystem ()
 
lldb_private::DataExtractor ReadImageData (uint32_t offset, size_t size)
 
- 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 AddressClass GetAddressClass (lldb::addr_t file_addr)
 Get the address type given a file address in an object file. 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::FileSpecList GetDebugSymbolFilePaths ()
 Gets the symbol file spec list for this object file. More...
 
virtual lldb_private::FileSpecList GetReExportedLibraries ()
 Gets the file spec list of libraries re-exported by this object file. More...
 
virtual bool AllowAssemblyEmulationUnwindPlans ()
 Returns if the function bounds for symbols in this symbol file are likely accurate. More...
 
virtual lldb_private::Address GetImageInfoAddress (Target *target)
 Similar to Process::GetImageInfoAddress(). More...
 
virtual uint32_t GetNumThreadContexts ()
 
virtual std::string GetIdentifierString ()
 Some object files may have an identifier string embedded in them, e.g. More...
 
virtual bool GetCorefileMainBinaryInfo (lldb::addr_t &address, UUID &uuid)
 When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file. More...
 
virtual lldb::RegisterContextSP GetThreadContextAtIndex (uint32_t idx, lldb_private::Thread &thread)
 
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...
 
virtual llvm::VersionTuple GetVersion ()
 Get the object file version numbers. More...
 
virtual llvm::VersionTuple GetMinimumOSVersion ()
 Get the minimum OS version this object file can run on. More...
 
virtual uint32_t GetSDKVersion (uint32_t *versions, uint32_t num_versions)
 Get the SDK OS version this object file was built with. More...
 
virtual bool GetIsDynamicLinkEditor ()
 Return true if this file is a dynamic link editor (dyld) 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...
 
- 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 ObjectFileCreateInstance (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::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)
 
static lldb::SymbolType MapSymbolType (uint16_t coff_symbol_type)
 
- 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 (const char *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)
 

Protected Types

enum  coff_data_dir_type { coff_data_dir_export_table = 0, coff_data_dir_import_table = 1 }
 
typedef struct ObjectFilePECOFF::dos_header dos_header_t
 
typedef struct ObjectFilePECOFF::coff_header coff_header_t
 
typedef struct ObjectFilePECOFF::data_directory data_directory_t
 
typedef struct ObjectFilePECOFF::coff_opt_header coff_opt_header_t
 
typedef enum ObjectFilePECOFF::coff_data_dir_type coff_data_dir_type
 
typedef struct ObjectFilePECOFF::section_header section_header_t
 
typedef struct ObjectFilePECOFF::coff_symbol coff_symbol_t
 
typedef struct ObjectFilePECOFF::export_directory_entry export_directory_entry
 
typedef std::vector< section_header_tSectionHeaderColl
 
typedef SectionHeaderColl::iterator SectionHeaderCollIter
 
typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter
 

Protected Member Functions

bool NeedsEndianSwap () const
 
bool ParseCOFFOptionalHeader (lldb::offset_t *offset_ptr)
 
bool ParseSectionHeaders (uint32_t offset)
 
uint32_t ParseDependentModules ()
 
void DumpSectionHeaders (lldb_private::Stream *s)
 
void DumpSectionHeader (lldb_private::Stream *s, const section_header_t &sh)
 
void DumpDependentModules (lldb_private::Stream *s)
 
llvm::StringRef GetSectionName (const section_header_t &sect)
 
- 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 bool ParseDOSHeader (lldb_private::DataExtractor &data, dos_header_t &dos_header)
 
static bool ParseCOFFHeader (lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr, coff_header_t &coff_header)
 
static void DumpDOSHeader (lldb_private::Stream *s, const dos_header_t &header)
 
static void DumpCOFFHeader (lldb_private::Stream *s, const coff_header_t &header)
 
static void DumpOptCOFFHeader (lldb_private::Stream *s, const coff_opt_header_t &header)
 
- Static Protected Member Functions inherited from lldb_private::ObjectFile
static lldb::DataBufferSP MapFileData (const FileSpec &file, uint64_t Size, uint64_t Offset)
 

Additional Inherited Members

- 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...
 

Detailed Description

Definition at line 17 of file ObjectFilePECOFF.h.

Member Typedef Documentation

◆ coff_data_dir_type

◆ coff_header_t

◆ coff_opt_header_t

◆ coff_symbol_t

◆ data_directory_t

◆ dos_header_t

◆ export_directory_entry

◆ MachineType

◆ section_header_t

◆ SectionHeaderColl

typedef std::vector<section_header_t> ObjectFilePECOFF::SectionHeaderColl
protected

Definition at line 272 of file ObjectFilePECOFF.h.

◆ SectionHeaderCollConstIter

typedef SectionHeaderColl::const_iterator ObjectFilePECOFF::SectionHeaderCollConstIter
protected

Definition at line 274 of file ObjectFilePECOFF.h.

◆ SectionHeaderCollIter

typedef SectionHeaderColl::iterator ObjectFilePECOFF::SectionHeaderCollIter
protected

Definition at line 273 of file ObjectFilePECOFF.h.

Member Enumeration Documentation

◆ coff_data_dir_type

Enumerator
coff_data_dir_export_table 
coff_data_dir_import_table 

Definition at line 209 of file ObjectFilePECOFF.h.

◆ MachineType

Enumerator
MachineUnknown 
MachineAm33 
MachineAmd64 
MachineArm 
MachineArmNt 
MachineArm64 
MachineEbc 
MachineX86 
MachineIA64 
MachineM32R 
MachineMips16 
MachineMipsFpu 
MachineMipsFpu16 
MachinePowerPc 
MachinePowerPcfp 
MachineR4000 
MachineSh3 
MachineSh3dsp 
MachineSh4 
MachineSh5 
MachineThumb 
MachineWcemIpsv2 

Definition at line 19 of file ObjectFilePECOFF.h.

Constructor & Destructor Documentation

◆ ObjectFilePECOFF() [1/2]

ObjectFilePECOFF::ObjectFilePECOFF ( 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 
)

Referenced by MapSymbolType().

◆ ObjectFilePECOFF() [2/2]

ObjectFilePECOFF::ObjectFilePECOFF ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  header_data_sp,
const lldb::ProcessSP &  process_sp,
lldb::addr_t  header_addr 
)

◆ ~ObjectFilePECOFF()

ObjectFilePECOFF::~ObjectFilePECOFF ( )
override

Definition at line 290 of file ObjectFilePECOFF.cpp.

Member Function Documentation

◆ CalculateStrata()

ObjectFile::Strata ObjectFilePECOFF::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 1223 of file ObjectFilePECOFF.cpp.

◆ CalculateType()

ObjectFile::Type ObjectFilePECOFF::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 1213 of file ObjectFilePECOFF.cpp.

◆ CreateInstance()

ObjectFile * ObjectFilePECOFF::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 111 of file ObjectFilePECOFF.cpp.

References MagicBytesMatch().

◆ CreateMemoryInstance()

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

Definition at line 146 of file ObjectFilePECOFF.cpp.

References MagicBytesMatch().

◆ CreateSections()

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

◆ Dump()

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

Definition at line 994 of file ObjectFilePECOFF.cpp.

References lldb_private::SectionList::Dump(), lldb_private::Stream::EOL(), lldb_private::eSortOrderNone, lldb_private::ArchSpec::GetArchitectureName(), lldb_private::Stream::Indent(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and UINT32_MAX.

◆ DumpCOFFHeader()

void ObjectFilePECOFF::DumpCOFFHeader ( lldb_private::Stream s,
const coff_header_t header 
)
staticprotected

◆ DumpDependentModules()

void ObjectFilePECOFF::DumpDependentModules ( lldb_private::Stream s)
protected

◆ DumpDOSHeader()

void ObjectFilePECOFF::DumpDOSHeader ( lldb_private::Stream s,
const dos_header_t header 
)
staticprotected

◆ DumpOptCOFFHeader()

void ObjectFilePECOFF::DumpOptCOFFHeader ( lldb_private::Stream s,
const coff_opt_header_t header 
)
staticprotected

Definition at line 1078 of file ObjectFilePECOFF.cpp.

References ObjectFilePECOFF::coff_opt_header::bss_size, ObjectFilePECOFF::coff_opt_header::checksum, ObjectFilePECOFF::coff_opt_header::code_offset, ObjectFilePECOFF::coff_opt_header::code_size, ObjectFilePECOFF::coff_opt_header::data_dirs, ObjectFilePECOFF::coff_opt_header::data_offset, ObjectFilePECOFF::coff_opt_header::data_size, ObjectFilePECOFF::coff_opt_header::dll_flags, ObjectFilePECOFF::coff_opt_header::entry, ObjectFilePECOFF::coff_opt_header::file_alignment, ObjectFilePECOFF::coff_opt_header::header_size, ObjectFilePECOFF::coff_opt_header::heap_commit_size, ObjectFilePECOFF::coff_opt_header::heap_reserve_size, ObjectFilePECOFF::coff_opt_header::image_base, ObjectFilePECOFF::coff_opt_header::image_size, ObjectFilePECOFF::coff_opt_header::loader_flags, ObjectFilePECOFF::coff_opt_header::magic, ObjectFilePECOFF::coff_opt_header::major_image_version, ObjectFilePECOFF::coff_opt_header::major_linker_version, ObjectFilePECOFF::coff_opt_header::major_os_system_version, ObjectFilePECOFF::coff_opt_header::major_subsystem_version, ObjectFilePECOFF::coff_opt_header::minor_image_version, ObjectFilePECOFF::coff_opt_header::minor_linker_version, ObjectFilePECOFF::coff_opt_header::minor_os_system_version, ObjectFilePECOFF::coff_opt_header::minor_subsystem_version, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), ObjectFilePECOFF::coff_opt_header::reserved1, ObjectFilePECOFF::coff_opt_header::sect_alignment, ObjectFilePECOFF::coff_opt_header::stack_commit_size, ObjectFilePECOFF::coff_opt_header::stack_reserve_size, and ObjectFilePECOFF::coff_opt_header::subsystem.

◆ DumpSectionHeader()

void ObjectFilePECOFF::DumpSectionHeader ( lldb_private::Stream s,
const section_header_t sh 
)
protected

◆ DumpSectionHeaders()

void ObjectFilePECOFF::DumpSectionHeaders ( lldb_private::Stream s)
protected

◆ GetAddressByteSize()

uint32_t ObjectFilePECOFF::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 353 of file ObjectFilePECOFF.cpp.

References OPT_HEADER_MAGIC_PE32, and OPT_HEADER_MAGIC_PE32_PLUS.

◆ GetArchitecture()

ArchSpec ObjectFilePECOFF::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 1192 of file ObjectFilePECOFF.cpp.

References lldb_private::eArchTypeCOFF, LLDB_INVALID_CPUTYPE, and lldb_private::ArchSpec::SetArchitecture().

◆ GetBaseAddress()

Address ObjectFilePECOFF::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 986 of file ObjectFilePECOFF.cpp.

◆ GetByteOrder()

ByteOrder ObjectFilePECOFF::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 347 of file ObjectFilePECOFF.cpp.

References lldb::eByteOrderLittle.

◆ GetDependentModules()

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

Definition at line 958 of file ObjectFilePECOFF.cpp.

◆ GetEntryPointAddress()

lldb_private::Address ObjectFilePECOFF::GetEntryPointAddress ( )
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.

Returns
Returns the entry address for this module.

Reimplemented from lldb_private::ObjectFile.

Definition at line 968 of file ObjectFilePECOFF.cpp.

◆ GetModuleSpecifications()

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

◆ GetPluginDescriptionStatic()

const char * ObjectFilePECOFF::GetPluginDescriptionStatic ( )
static

Definition at line 106 of file ObjectFilePECOFF.cpp.

◆ GetPluginName()

ConstString ObjectFilePECOFF::GetPluginName ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 1226 of file ObjectFilePECOFF.cpp.

◆ GetPluginNameStatic()

lldb_private::ConstString ObjectFilePECOFF::GetPluginNameStatic ( )
static

Definition at line 101 of file ObjectFilePECOFF.cpp.

◆ GetPluginVersion()

uint32_t ObjectFilePECOFF::GetPluginVersion ( )
overridevirtual

Implements lldb_private::PluginInterface.

Definition at line 1228 of file ObjectFilePECOFF.cpp.

◆ GetSectionName()

llvm::StringRef ObjectFilePECOFF::GetSectionName ( const section_header_t sect)
protected

Definition at line 578 of file ObjectFilePECOFF.cpp.

References ObjectFilePECOFF::section_header::name.

◆ GetSymtab()

Symtab * ObjectFilePECOFF::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 595 of file ObjectFilePECOFF.cpp.

References ObjectFilePECOFF::export_directory_entry::address_of_functions, ObjectFilePECOFF::export_directory_entry::address_of_name_ordinals, ObjectFilePECOFF::export_directory_entry::address_of_names, ObjectFilePECOFF::export_directory_entry::base, ObjectFilePECOFF::export_directory_entry::characteristics, lldb::eSymbolTypeCode, lldb_private::Symbol::GetAddressRef(), lldb_private::DataExtractor::GetDataStart(), lldb_private::Symbol::GetMangled(), lldb_private::Address::GetOffset(), lldb_private::Address::GetSection(), lldb_private::SectionList::GetSectionAtIndex(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), ObjectFilePECOFF::export_directory_entry::major_version, ObjectFilePECOFF::export_directory_entry::minor_version, ObjectFilePECOFF::coff_symbol::name, ObjectFilePECOFF::export_directory_entry::name, ObjectFilePECOFF::coff_symbol::naux, ObjectFilePECOFF::export_directory_entry::number_of_functions, ObjectFilePECOFF::export_directory_entry::number_of_names, lldb_private::DataExtractor::PeekCStr(), ObjectFilePECOFF::coff_symbol::sect, lldb_private::Symbol::SetDebug(), lldb_private::Symbol::SetType(), ObjectFilePECOFF::coff_symbol::storage, ObjectFilePECOFF::export_directory_entry::time_date_stamp, ObjectFilePECOFF::coff_symbol::type, and ObjectFilePECOFF::coff_symbol::value.

◆ GetUUID()

UUID ObjectFilePECOFF::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 886 of file ObjectFilePECOFF.cpp.

References GetCoffUUID().

◆ Initialize()

void ObjectFilePECOFF::Initialize ( )
static

◆ IsExecutable()

bool ObjectFilePECOFF::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 349 of file ObjectFilePECOFF.cpp.

◆ IsStripped()

bool ObjectFilePECOFF::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 740 of file ObjectFilePECOFF.cpp.

◆ IsWindowsSubsystem()

bool ObjectFilePECOFF::IsWindowsSubsystem ( )

Definition at line 1177 of file ObjectFilePECOFF.cpp.

◆ MagicBytesMatch()

bool ObjectFilePECOFF::MagicBytesMatch ( lldb::DataBufferSP &  data_sp)
static

◆ MapSymbolType()

lldb::SymbolType ObjectFilePECOFF::MapSymbolType ( uint16_t  coff_symbol_type)
static

◆ NeedsEndianSwap()

bool ObjectFilePECOFF::NeedsEndianSwap ( ) const
protected

Definition at line 365 of file ObjectFilePECOFF.cpp.

◆ ParseCOFFHeader()

bool ObjectFilePECOFF::ParseCOFFHeader ( lldb_private::DataExtractor data,
lldb::offset_t offset_ptr,
coff_header_t coff_header 
)
staticprotected

◆ ParseCOFFOptionalHeader()

bool ObjectFilePECOFF::ParseCOFFOptionalHeader ( lldb::offset_t offset_ptr)
protected

Definition at line 451 of file ObjectFilePECOFF.cpp.

References OPT_HEADER_MAGIC_PE32.

◆ ParseDependentModules()

uint32_t ObjectFilePECOFF::ParseDependentModules ( )
protected

◆ ParseDOSHeader()

bool ObjectFilePECOFF::ParseDOSHeader ( lldb_private::DataExtractor data,
dos_header_t dos_header 
)
staticprotected

◆ ParseHeader()

bool ObjectFilePECOFF::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 292 of file ObjectFilePECOFF.cpp.

References lldb::eByteOrderLittle, and IMAGE_NT_SIGNATURE.

◆ ParseSectionHeaders()

bool ObjectFilePECOFF::ParseSectionHeaders ( uint32_t  offset)
protected

Definition at line 542 of file ObjectFilePECOFF.cpp.

◆ ReadImageData()

DataExtractor ObjectFilePECOFF::ReadImageData ( uint32_t  offset,
size_t  size 
)

Definition at line 518 of file ObjectFilePECOFF.cpp.

◆ SaveCore()

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

Definition at line 206 of file ObjectFilePECOFF.cpp.

References lldb_private::SaveMiniDump().

◆ SetLoadAddress()

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

Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the implementation.

Returns
Returns true iff any section's load address changed.

Reimplemented from lldb_private::ObjectFile.

Definition at line 316 of file ObjectFilePECOFF.cpp.

References lldb_private::SectionList::GetSectionAtIndex(), lldb_private::Target::GetSectionLoadList(), lldb_private::SectionList::GetSize(), and lldb_private::SectionLoadList::SetSectionLoadAddress().

◆ Terminate()

void ObjectFilePECOFF::Terminate ( )
static

Definition at line 97 of file ObjectFilePECOFF.cpp.

Referenced by lldb_private::SystemInitializerFull::Terminate().


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