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

#include <ELFHeader.h>

Collaboration diagram for elf::ELFSymbol:
Collaboration graph
[legend]

Public Member Functions

 ELFSymbol ()
 
unsigned char getBinding () const
 Returns the binding attribute of the st_info member. More...
 
unsigned char getType () const
 Returns the type attribute of the st_info member. More...
 
void setBindingAndType (unsigned char binding, unsigned char type)
 Sets the binding and type of the st_info member. More...
 
bool Parse (const lldb_private::DataExtractor &data, lldb::offset_t *offset)
 Parse an ELFSymbol entry from the given DataExtractor starting at position offset. More...
 
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. More...
 
elf_xword st_size
 Size of the symbol or zero. More...
 
elf_word st_name
 Symbol name string index. More...
 
unsigned char st_info
 Symbol type and binding attributes. More...
 
unsigned char st_other
 Reserved for future use. More...
 
elf_half st_shndx
 Section to which this symbol applies. More...
 

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 251 of file ELFHeader.cpp.

Member Function Documentation

◆ bindingToCString()

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

Definition at line 257 of file ELFHeader.cpp.

References ENUM_TO_CSTR.

◆ 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 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 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 319 of file ELFHeader.cpp.

References lldb_private::DataExtractor::GetAddressByteSize(), GetMaxU64(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), and lldb_private::DataExtractor::GetU8().

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 270 of file ELFHeader.cpp.

References ENUM_TO_CSTR.

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 getBinding(), getType(), 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 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 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 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 ObjectFileELF::ParseSymbols().

◆ st_value

elf_addr elf::ELFSymbol::st_value

Absolute or relocatable address.

Definition at line 225 of file ELFHeader.h.

Referenced by ObjectFileELF::ParseSymbols().


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