Show All Descriptions Reset

SymtabAPI Interface

This document describes the functions in the symtabAPI. The primary classes are Dyn_Symtab, Dyn_module, Dyn_Symbol, Dyn_Archive and Dyn_ExceptionBlock.OFFSET used in any of the functions below is of type unsigned long.

Class Dyn_Symtab

The Dyn_Symtab class represents the entire SymtabAPI library. This class is responsible for the parsing of the Object file information and holding the data that can be accessed through lookup functions.
static bool openFile( string &filename, Dyn_Symtab *&obj)
static bool openFile( char *mem_image, size_t size, Dyn_Symtab *&obj)
bool findSymbolByType(vector <Dyn_Symbol *> &ret, const string &name, Dyn_Symbol::SymbolType sType, bool isMangled = false, bool isRegex = false, bool checkCase = false);
bool findModule(const string &name, Dyn_Module *&ret)
bool findFuncByEntryOffset(const OFFSET &offset, Dyn_Symbol *ret)
bool addSymbol(Dyn_Symbol *newsym)
bool getAllSymbolsByType(vector<Dyn_Symbol *> &ret, Dyn_Symbol::SymbolType sType)
bool getAllModules(vector<module *> &ret)
bool isExec() const
bool isCode(const OFFSET &where) const
bool isData(const OFFSET &where) const
bool isValidOffset(const OFFSET &where) const
string file() const
string name() const
char *mem_image() const
OFFSET codeOffset() const
OFFSET dataOffset() const
OFFSET dataLength() const
OFFSET codeLength() const
Word* code_ptr () const
Word* data_ptr () const
unsigned getNumberOfSymbols() const
bool findException(OFFSET &addr, Dyn_ExceptionBlock &excp);
bool findCatchBlock(Dyn_ExceptionBlock &excp, OFFSET addr, unsigned size = 0)
bool getAllExceptions(vector<Dyn_ExceptionBlock *> &exceptions)
unsigned getAddressWidth() const
OFFSET getLoadAddress() const
OFFSET getEntryAddress() const
OFFSET getBaseAddress() const
enum SymtabError
static SymtabError getLastSymtabError()
static string printError(SymtabError serr)

Class Dyn_Module

This class represents a module which is part of the image. This class also gives all the information pertaining to a module.
enum supportedLanguages
bool getAllSymbolsByType(vector<Dyn_Symbol *> &ret, Dyn_Symbol::SymbolType sType)
bool findSymbolByType(vector <Dyn_Symbol *> &ret, const string &name, Dyn_Symbol::SymbolType sType, bool isMangled = false, bool isRegex = false, bool checkCase = false);
bool isShared() const
const string& fileName() const
const string& fullName() const
bool setName(string newName)
supportedLangugaes language() const
bool setLanguage(supportedLanguages lang)
OFFSET addr() const

Class Dyn_Symbol

The Symbol class represents a symbol in the object file. This class holds the symbol information such as the mangled, pretty and typed Names, the module in which it is present, type and linkage, address, size.
enum SymbolType
enum SymbolLinkage
Dyn_Symbol (const string &name, Dyn_Module *module, SymbolType stype, SymbolLinkage slinkage, OFFSET addr, Dyn_Section *sec = NULL, unsigned size = 0, void *upPtr = NULL)
Dyn_Symbol(const Dyn_Symbol &)
bool operator== (const Dyn_Symbol &sym) const;
const string& getName () const
const string& getPrettyName() const
const string& getTypedName() const
const Dyn_Module *getModule () const
const string &getModuleName () const
SymbolType getType() const
SymbolLinkage getLinkage() const
OFFSET getAddr() const
vector<string> getAllMangledNames() const
vector<string> getAllPrettyNames() const
vector<string> getAllTypedNames() const
unsigned getSize() const
Dyn_Section *getSec() const
void *getUpPtr() const

void setModule (Dyn_Module *module)
void setModuleName (string moduleName)
void setSize (unsigned ns)
void setAddr(OFFSET newAddr)
bool setType(SymbolType sType)
bool setUpPtr(void *newUpPtr)
bool addMangledName(string name, bool isPrimary = false)
bool addPrettyName(string name,bool isPrimary = false)
bool addTypedName(string name, bool isPrimary = false)
bool isWeak()
bool isLocal()
bool isGlobal()

Class Dyn_Archive

This class represents an archive on AIX. This class has information of all the members in the archives.
static bool openArchive(string &name, Dyn_Archive *&img)
static bool openArchive( char *mem_image, size_t size, Dyn_Symtab *&img)
bool getMember(string &member_name,Dyn_Symtab *&img)
bool getMemberByOffset(OFFSET &memberOffset, Dyn_Symtab *&img)
bool getAllMembers(vector <Dyn_Symtab *> &members)
bool isMemberInArchive(string &member_name)
static SymtabError getLastSymtabError()
static string printError(SymtabError serr)

Class Dyn_ExceptionBlock

This class represents an Exception Block present in the Object file. This class gives all the information pertaining to that Exception Block.
bool hasTry() const
OFFSET tryStart() const
OFFSET tryEnd() const
OFFSET trySize() const
OFFSET catchStart() const
bool contains(OFFSET addr) const