LLDB mainline
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
elf::ELFSymbol Class Reference

Represents a symbol within an ELF symbol table. More...

#include <ELFHeader.h>

Public Member Functions

 ELFSymbol ()
 
unsigned char getBinding () const
 Returns the binding attribute of the st_info member.
 
unsigned char getType () const
 Returns the type attribute of the st_info member.
 
void setBindingAndType (unsigned char binding, unsigned char type)
 Sets the binding and type of the st_info member.
 
bool Parse (const lldb_private::DataExtractor &data, lldb::offset_t *offset)
 Parse an ELFSymbol entry from the given DataExtractor starting at position offset.
 
void Dump (lldb_private::Stream *s, uint32_t idx, const lldb_private::DataExtractor *strtab_data, const lldb_private::SectionList *section_list)
 

Static Public Member Functions

static const char * bindingToCString (unsigned char binding)
 
static const char * typeToCString (unsigned char type)
 
static const char * sectionIndexToCString (elf_half shndx, const lldb_private::SectionList *section_list)
 

Public Attributes

elf_addr st_value
 Absolute or relocatable address.
 
elf_xword st_size
 Size of the symbol or zero.
 
elf_word st_name
 Symbol name string index.
 
unsigned char st_info
 Symbol type and binding attributes.
 
unsigned char st_other
 Reserved for future use.
 
elf_half st_shndx
 Section to which this symbol applies.
 

Detailed Description

Represents a symbol within an ELF symbol table.

Definition at line 224 of file ELFHeader.h.

Constructor & Destructor Documentation

◆ ELFSymbol()

ELFSymbol::ELFSymbol ( )

Definition at line 257 of file ELFHeader.cpp.

Member Function Documentation

◆ bindingToCString()

const char * ELFSymbol::bindingToCString ( unsigned char  binding)
static

Definition at line 263 of file ELFHeader.cpp.

References ENUM_TO_CSTR.

Referenced by Dump().

◆ Dump()

void ELFSymbol::Dump ( lldb_private::Stream s,
uint32_t  idx,
const lldb_private::DataExtractor strtab_data,
const lldb_private::SectionList section_list 
)

◆ getBinding()

unsigned char elf::ELFSymbol::getBinding ( ) const
inline

Returns the binding attribute of the st_info member.

Definition at line 235 of file ELFHeader.h.

References st_info.

Referenced by Dump(), and ObjectFileELF::ParseSymbols().

◆ getType()

unsigned char elf::ELFSymbol::getType ( ) const
inline

Returns the type attribute of the st_info member.

Definition at line 238 of file ELFHeader.h.

References st_info.

Referenced by Dump(), and ObjectFileELF::ParseSymbols().

◆ Parse()

bool ELFSymbol::Parse ( const lldb_private::DataExtractor data,
lldb::offset_t offset 
)

Parse an ELFSymbol entry from the given DataExtractor starting at position offset.

The address size of the DataExtractor determines if a 32 or 64 bit object is to be parsed.

Parameters
[in]dataThe DataExtractor to read from. The address size of the extractor determines if a 32 or 64 bit object should be read.
[in,out]offsetPointer to an offset in the data. On return the offset will be advanced by the number of bytes read.
Returns
True if the ELFSymbol was successfully read and false otherwise.

Definition at line 325 of file ELFHeader.cpp.

References lldb_private::DataExtractor::GetAddressByteSize(), GetMaxU64(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), st_info, st_name, st_shndx, and st_value.

Referenced by ParsePLTRelocations(), and ObjectFileELF::ParseSymbols().

◆ sectionIndexToCString()

const char * ELFSymbol::sectionIndexToCString ( elf_half  shndx,
const lldb_private::SectionList section_list 
)
static

◆ setBindingAndType()

void elf::ELFSymbol::setBindingAndType ( unsigned char  binding,
unsigned char  type 
)
inline

Sets the binding and type of the st_info member.

Definition at line 241 of file ELFHeader.h.

References st_info.

◆ typeToCString()

const char * ELFSymbol::typeToCString ( unsigned char  type)
static

Definition at line 276 of file ELFHeader.cpp.

References ENUM_TO_CSTR.

Referenced by Dump().

Member Data Documentation

◆ st_info

unsigned char elf::ELFSymbol::st_info

Symbol type and binding attributes.

Definition at line 228 of file ELFHeader.h.

Referenced by Dump(), getBinding(), getType(), Parse(), ObjectFileELF::ParseSymbols(), and setBindingAndType().

◆ st_name

elf_word elf::ELFSymbol::st_name

Symbol name string index.

Definition at line 227 of file ELFHeader.h.

Referenced by Dump(), Parse(), ParsePLTRelocations(), and ObjectFileELF::ParseSymbols().

◆ st_other

unsigned char elf::ELFSymbol::st_other

Reserved for future use.

Definition at line 229 of file ELFHeader.h.

Referenced by Dump(), and ObjectFileELF::ParseSymbols().

◆ st_shndx

elf_half elf::ELFSymbol::st_shndx

Section to which this symbol applies.

Definition at line 230 of file ELFHeader.h.

Referenced by Dump(), Parse(), and ObjectFileELF::ParseSymbols().

◆ st_size

elf_xword elf::ELFSymbol::st_size

Size of the symbol or zero.

Definition at line 226 of file ELFHeader.h.

Referenced by Dump(), and ObjectFileELF::ParseSymbols().

◆ st_value

elf_addr elf::ELFSymbol::st_value

Absolute or relocatable address.

Definition at line 225 of file ELFHeader.h.

Referenced by Dump(), Parse(), and ObjectFileELF::ParseSymbols().


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