Dyninst::Elf_X Class Reference

#include <Elf_X.h>

Public Member Functions

void end ()
Elf * e_elfp () const
unsigned char * e_ident () const
unsigned short e_type () const
unsigned short e_machine () const
unsigned long e_version () const
unsigned long e_entry () const
unsigned long e_phoff () const
unsigned long e_shoff () const
unsigned long e_flags () const
unsigned short e_ehsize () const
unsigned short e_phentsize () const
unsigned short e_phnum () const
unsigned short e_shentsize () const
unsigned short e_shnum () const
unsigned short e_shstrndx () const
const char * e_rawfile (size_t &nbytes) const
Elf_Xe_next (Elf_X *ref)
Elf_Xe_rand (unsigned offset)
void e_ident (unsigned char *input)
void e_type (unsigned short input)
void e_machine (unsigned short input)
void e_version (unsigned long input)
void e_entry (unsigned long input)
void e_phoff (unsigned long input)
void e_shoff (unsigned long input)
void e_flags (unsigned long input)
void e_ehsize (unsigned short input)
void e_phentsize (unsigned short input)
void e_phnum (unsigned short input)
void e_shentsize (unsigned short input)
void e_shnum (unsigned short input)
void e_shstrndx (unsigned short input)
bool isValid () const
int wordSize () const
Elf_X_Phdrget_phdr (unsigned int i=0)
Elf_X_Shdrget_shdr (unsigned int i)
bool findDebugFile (std::string origfilename, std::string &output_name, char *&output_buffer, unsigned long &output_buffer_size)

Static Public Member Functions

static Elf_XnewElf_X (int input, Elf_Cmd cmd, Elf_X *ref=NULL, std::string name=std::string())
static Elf_XnewElf_X (char *mem_image, size_t mem_size, std::string name=std::string())

Protected Member Functions

 Elf_X ()
 Elf_X (int input, Elf_Cmd cmd, Elf_X *ref=NULL)
 Elf_X (char *mem_image, size_t mem_size)
 ~Elf_X ()

Protected Attributes

Elf * elf
Elf32_Ehdr * ehdr32
Elf64_Ehdr * ehdr64
Elf32_Phdr * phdr32
Elf64_Phdr * phdr64
int filedes
bool is64
bool isArchive
std::vector< Elf_X_Shdrshdrs
std::vector< Elf_X_Phdrphdrs
unsigned int ref_count
std::string filename
char * cached_debug_buffer
unsigned long cached_debug_size
std::string cached_debug_name
bool cached_debug

Static Protected Attributes

static std::map< std::pair
< std::string, int >, Elf_X * > 
elf_x_by_fd
static std::map< std::pair
< std::string, char * >, Elf_X * > 
elf_x_by_ptr

Detailed Description

Definition at line 67 of file Elf_X.h.


Constructor & Destructor Documentation

Elf_X::Elf_X (  )  [protected]

Definition at line 112 of file Elf_X.C.

Elf_X::Elf_X ( int  input,
Elf_Cmd  cmd,
Elf_X ref = NULL 
) [protected]

Definition at line 118 of file Elf_X.C.

References e_elfp(), e_phnum(), e_shnum(), ehdr32, ehdr64, elf, fprintf, is64, isArchive, phdr32, phdr64, phdrs, and shdrs.

Elf_X::Elf_X ( char *  mem_image,
size_t  mem_size 
) [protected]

Definition at line 163 of file Elf_X.C.

References e_phnum(), e_shnum(), ehdr32, ehdr64, elf, is64, phdr32, phdr64, phdrs, and shdrs.

Elf_X::~Elf_X (  )  [protected]

Definition at line 220 of file Elf_X.C.

References elf_x_by_fd, and elf_x_by_ptr.


Member Function Documentation

void Elf_X::e_ehsize ( unsigned short  input  ) 

Definition at line 410 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_ehsize (  )  const

Definition at line 299 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

Elf * Elf_X::e_elfp (  )  const
void Elf_X::e_entry ( unsigned long  input  ) 

Definition at line 386 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned long Elf_X::e_entry (  )  const

Definition at line 271 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

void Elf_X::e_flags ( unsigned long  input  ) 

Definition at line 404 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned long Elf_X::e_flags (  )  const

Definition at line 292 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

void Elf_X::e_ident ( unsigned char *  input  ) 

Definition at line 362 of file Elf_X.C.

References ehdr32, ehdr64, is64, and P_memcpy().

unsigned char * Elf_X::e_ident (  )  const

Definition at line 243 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

Referenced by Dyninst::SymtabAPI::Object::emitDriver().

void Elf_X::e_machine ( unsigned short  input  ) 

Definition at line 374 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_machine (  )  const
Elf_X * Elf_X::e_next ( Elf_X ref  ) 

Definition at line 345 of file Elf_X.C.

References e_elfp(), filedes, isArchive, and newElf_X().

void Elf_X::e_phentsize ( unsigned short  input  ) 

Definition at line 416 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_phentsize (  )  const

Definition at line 306 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

void Elf_X::e_phnum ( unsigned short  input  ) 

Definition at line 422 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_phnum (  )  const
void Elf_X::e_phoff ( unsigned long  input  ) 

Definition at line 392 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned long Elf_X::e_phoff (  )  const

Definition at line 278 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

Referenced by pdelf_check_ehdr().

Elf_X * Elf_X::e_rand ( unsigned  offset  ) 

Definition at line 353 of file Elf_X.C.

References elf, filedes, isArchive, and newElf_X().

const char * Elf_X::e_rawfile ( size_t &  nbytes  )  const

Definition at line 340 of file Elf_X.C.

References elf.

Referenced by Dyninst::SymElf::getInterpreterName().

void Elf_X::e_shentsize ( unsigned short  input  ) 

Definition at line 428 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_shentsize (  )  const

Definition at line 319 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

void Elf_X::e_shnum ( unsigned short  input  ) 

Definition at line 434 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_shnum (  )  const
void Elf_X::e_shoff ( unsigned long  input  ) 

Definition at line 398 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned long Elf_X::e_shoff (  )  const

Definition at line 285 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

Referenced by pdelf_check_ehdr().

void Elf_X::e_shstrndx ( unsigned short  input  ) 

Definition at line 440 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_shstrndx (  )  const
void Elf_X::e_type ( unsigned short  input  ) 

Definition at line 368 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned short Elf_X::e_type (  )  const
void Elf_X::e_version ( unsigned long  input  ) 

Definition at line 380 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

unsigned long Elf_X::e_version (  )  const

Definition at line 264 of file Elf_X.C.

References ehdr32, ehdr64, and is64.

void Elf_X::end (  ) 
bool Dyninst::Elf_X::findDebugFile ( std::string  origfilename,
std::string &  output_name,
char *&  output_buffer,
unsigned long &  output_buffer_size 
)
Elf_X_Phdr & Elf_X::get_phdr ( unsigned int  i = 0  ) 
Elf_X_Shdr & Elf_X::get_shdr ( unsigned int  i  ) 
bool Elf_X::isValid (  )  const
static Elf_X* Dyninst::Elf_X::newElf_X ( char *  mem_image,
size_t  mem_size,
std::string  name = std::string() 
) [static]
static Elf_X* Dyninst::Elf_X::newElf_X ( int  input,
Elf_Cmd  cmd,
Elf_X ref = NULL,
std::string  name = std::string() 
) [static]
int Elf_X::wordSize (  )  const

Field Documentation

bool Dyninst::Elf_X::cached_debug [protected]

Definition at line 135 of file Elf_X.h.

Definition at line 132 of file Elf_X.h.

std::string Dyninst::Elf_X::cached_debug_name [protected]

Definition at line 134 of file Elf_X.h.

unsigned long Dyninst::Elf_X::cached_debug_size [protected]

Definition at line 133 of file Elf_X.h.

Elf32_Ehdr* Dyninst::Elf_X::ehdr32 [protected]
Elf64_Ehdr* Dyninst::Elf_X::ehdr64 [protected]
Elf* Dyninst::Elf_X::elf [protected]

Definition at line 119 of file Elf_X.h.

Referenced by e_elfp(), e_rand(), e_rawfile(), Elf_X(), and get_shdr().

map< pair< string, int >, Elf_X * > Elf_X::elf_x_by_fd [static, protected]

Definition at line 146 of file Elf_X.h.

Referenced by ~Elf_X().

map< pair< string, char * >, Elf_X * > Elf_X::elf_x_by_ptr [static, protected]

Definition at line 147 of file Elf_X.h.

Referenced by ~Elf_X().

int Dyninst::Elf_X::filedes [protected]

Definition at line 124 of file Elf_X.h.

Referenced by e_next(), and e_rand().

std::string Dyninst::Elf_X::filename [protected]

Definition at line 130 of file Elf_X.h.

bool Dyninst::Elf_X::is64 [protected]
bool Dyninst::Elf_X::isArchive [protected]

Definition at line 126 of file Elf_X.h.

Referenced by e_next(), e_rand(), and Elf_X().

Elf32_Phdr* Dyninst::Elf_X::phdr32 [protected]

Definition at line 122 of file Elf_X.h.

Referenced by Elf_X(), and get_phdr().

Elf64_Phdr* Dyninst::Elf_X::phdr64 [protected]

Definition at line 123 of file Elf_X.h.

Referenced by Elf_X(), and get_phdr().

std::vector<Elf_X_Phdr> Dyninst::Elf_X::phdrs [protected]

Definition at line 128 of file Elf_X.h.

Referenced by Elf_X(), and get_phdr().

unsigned int Dyninst::Elf_X::ref_count [protected]

Definition at line 129 of file Elf_X.h.

Referenced by end().

std::vector<Elf_X_Shdr> Dyninst::Elf_X::shdrs [protected]

Definition at line 127 of file Elf_X.h.

Referenced by Elf_X(), and get_shdr().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1