Dyninst::SymtabAPI::Function Class Reference

#include <Function.h>

Inheritance diagram for Dyninst::SymtabAPI::Function:
Dyninst::SymtabAPI::Aggregate Dyninst::Serializable Dyninst::AnnotatableSparse

Public Types

typedef dyn_hash_map< void
*, void *, void_ptr_hasher
annos_by_type_t
typedef std::vector
< annos_by_type_t * > 
annos_t

Public Member Functions

SYMTAB_EXPORT Function ()
virtual SYMTAB_EXPORT ~Function ()
SYMTAB_EXPORT bool removeSymbol (Symbol *sym)
SYMTAB_EXPORT TypegetReturnType () const
SYMTAB_EXPORT bool setReturnType (Type *)
SYMTAB_EXPORT bool setFramePtrRegnum (int regnum)
SYMTAB_EXPORT int getFramePtrRegnum () const
SYMTAB_EXPORT Offset getPtrOffset () const
SYMTAB_EXPORT Offset getTOCOffset () const
SYMTAB_EXPORT bool setFramePtr (std::vector< VariableLocation > *locs)
SYMTAB_EXPORT std::vector
< VariableLocation > & 
getFramePtrRefForInit ()
SYMTAB_EXPORT std::vector
< VariableLocation > & 
getFramePtr ()
SYMTAB_EXPORT bool findLocalVariable (std::vector< localVar * > &vars, std::string name)
SYMTAB_EXPORT bool getLocalVariables (std::vector< localVar * > &vars)
SYMTAB_EXPORT bool getParams (std::vector< localVar * > &params)
SYMTAB_EXPORT Serializableserialize_impl (SerializerBase *sb, const char *tag="Function") THROW_SPEC(SerializerError)
SYMTAB_EXPORT unsigned getSize ()
SYMTAB_EXPORT bool operator== (const Function &)
bool addLocalVar (localVar *)
bool addParam (localVar *)
bool setupParams ()
SYMTAB_EXPORT Offset getOffset () const
SYMTAB_EXPORT unsigned getSize () const
SYMTAB_EXPORT ModulegetModule () const
SYMTAB_EXPORT RegiongetRegion () const
SYMTAB_EXPORT bool addSymbol (Symbol *sym)
SYMTAB_EXPORT bool getSymbols (std::vector< Symbol * > &syms) const
SYMTAB_EXPORT SymbolgetFirstSymbol () const
SYMTAB_EXPORT const
std::vector< std::string > & 
getAllMangledNames ()
SYMTAB_EXPORT const
std::vector< std::string > & 
getAllPrettyNames ()
SYMTAB_EXPORT const
std::vector< std::string > & 
getAllTypedNames ()
virtual SYMTAB_EXPORT bool addMangledName (std::string name, bool isPrimary)
virtual SYMTAB_EXPORT bool addPrettyName (std::string name, bool isPrimary)
virtual SYMTAB_EXPORT bool addTypedName (std::string name, bool isPrimary)
SYMTAB_EXPORT bool setModule (Module *mod)
SYMTAB_EXPORT bool setSize (unsigned size)
SYMTAB_EXPORT bool setOffset (unsigned offset)
template<class T >
AN_INLINE bool addAnnotation (const T *a, AnnotationClass< T > &a_id)
bool operator== (AnnotatableSparse &cmp)
template<class T >
AN_INLINE bool getAnnotation (T *&a, AnnotationClass< T > &a_id) const
template<class T >
bool removeAnnotation (AnnotationClass< T > &a_id)
void serializeAnnotations (SerializerBase *sb, const char *)
void annotationsReport ()

Protected Member Functions

bool addMangledNameInt (std::string name, bool isPrimary)
bool addPrettyNameInt (std::string name, bool isPrimary)
bool addTypedNameInt (std::string name, bool isPrimary)
SYMTAB_EXPORT bool removeSymbolInt (Symbol *sym)
virtual SYMTAB_EXPORT bool changeSymbolOffset (Symbol *sym)
void restore_type_by_id (SerializerBase *, Type *&, unsigned) THROW_SPEC(SerializerError)
void restore_module_by_name (SerializerBase *, std::string &) THROW_SPEC(SerializerError)
void rebuild_symbol_vector (SerializerBase *, std::vector< Address > &) THROW_SPEC(SerializerError)
SYMTAB_EXPORT void serialize_aggregate (SerializerBase *, const char *="Aggregate") THROW_SPEC(SerializerError)

Protected Attributes

Modulemodule_
std::vector< Symbol * > symbols_
SymbolfirstSymbol
Offset offset_
std::vector< std::string > mangledNames_
std::vector< std::string > prettyNames_
std::vector< std::string > typedNames_

Private Member Functions

SYMTAB_EXPORT Function (Symbol *sym)
void expandLocation (const VariableLocation &loc, std::vector< VariableLocation > &ret)

Private Attributes

TyperetType_
int framePtrRegNum_
std::vector< VariableLocationframeBase_
bool frameBaseExpanded_
unsigned functionSize_

Friends

class Symtab
std::ostream & operator<< (std::ostream &os, const Dyninst::SymtabAPI::Function &)

Detailed Description

Definition at line 53 of file Function.h.


Member Typedef Documentation

typedef dyn_hash_map<void *, void *, void_ptr_hasher> Dyninst::AnnotatableSparse::annos_by_type_t [inherited]

Definition at line 505 of file Annotatable.h.

typedef std::vector<annos_by_type_t *> Dyninst::AnnotatableSparse::annos_t [inherited]

Definition at line 508 of file Annotatable.h.


Constructor & Destructor Documentation

Function::Function ( Symbol sym  )  [private]

Definition at line 58 of file Function.C.

Function::Function (  ) 

Definition at line 66 of file Function.C.

Function::~Function (  )  [virtual]

Member Function Documentation

template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::addAnnotation ( const T *  a,
AnnotationClass< T > &  a_id 
) [inline, inherited]
bool Function::addLocalVar ( localVar locVar  ) 
virtual SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::addMangledName ( std::string  name,
bool  isPrimary 
) [virtual, inherited]
bool Dyninst::SymtabAPI::Aggregate::addMangledNameInt ( std::string  name,
bool  isPrimary 
) [protected, inherited]
bool Function::addParam ( localVar param  ) 
virtual SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::addPrettyName ( std::string  name,
bool  isPrimary 
) [virtual, inherited]
bool Dyninst::SymtabAPI::Aggregate::addPrettyNameInt ( std::string  name,
bool  isPrimary 
) [protected, inherited]
bool Aggregate::addSymbol ( Symbol sym  )  [inherited]
virtual SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::addTypedName ( std::string  name,
bool  isPrimary 
) [virtual, inherited]
bool Dyninst::SymtabAPI::Aggregate::addTypedNameInt ( std::string  name,
bool  isPrimary 
) [protected, inherited]
void Dyninst::AnnotatableSparse::annotationsReport (  )  [inline, inherited]
bool Aggregate::changeSymbolOffset ( Symbol sym  )  [protected, virtual, inherited]
void Function::expandLocation ( const VariableLocation loc,
std::vector< VariableLocation > &  ret 
) [private]
bool Function::findLocalVariable ( std::vector< localVar * > &  vars,
std::string  name 
)
const vector< std::string > & Aggregate::getAllMangledNames (  )  [inherited]
const vector< std::string > & Aggregate::getAllPrettyNames (  )  [inherited]

Definition at line 107 of file Aggregate.C.

References Dyninst::SymtabAPI::Aggregate::prettyNames_.

Referenced by enumLocalSymbols().

const vector< std::string > & Aggregate::getAllTypedNames (  )  [inherited]

Definition at line 112 of file Aggregate.C.

References Dyninst::SymtabAPI::Aggregate::typedNames_.

template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::getAnnotation ( T *&  a,
AnnotationClass< T > &  a_id 
) const [inline, inherited]
Symbol * Aggregate::getFirstSymbol (  )  const [inherited]
std::vector< Dyninst::VariableLocation > & Function::getFramePtr (  ) 
std::vector< Dyninst::VariableLocation > & Function::getFramePtrRefForInit (  ) 

Definition at line 122 of file Function.C.

References frameBase_.

Referenced by Dyninst::SymtabAPI::DwarfWalker::getFrameBase().

int Function::getFramePtrRegnum (  )  const

Definition at line 85 of file Function.C.

References framePtrRegNum_.

Referenced by operator<<().

bool Function::getLocalVariables ( std::vector< localVar * > &  vars  ) 
SYMTAB_EXPORT Module* Dyninst::SymtabAPI::Aggregate::getModule (  )  const [inline, inherited]

Definition at line 73 of file Aggregate.h.

References Dyninst::SymtabAPI::Aggregate::module_.

Referenced by add_type_info(), enumLocalSymbols(), and findLocalVars().

Offset Aggregate::getOffset (  )  const [inherited]
bool Function::getParams ( std::vector< localVar * > &  params  ) 
Offset Function::getPtrOffset (  )  const

Definition at line 96 of file Function.C.

References Dyninst::SymtabAPI::Aggregate::symbols_.

Region * Aggregate::getRegion (  )  const [inherited]
Type * Function::getReturnType (  )  const

Definition at line 74 of file Function.C.

References retType_.

unsigned Aggregate::getSize (  )  const [inherited]
unsigned Function::getSize (  ) 
bool Aggregate::getSymbols ( std::vector< Symbol * > &  syms  )  const [inherited]
Offset Function::getTOCOffset (  )  const

Definition at line 109 of file Function.C.

References Dyninst::SymtabAPI::Aggregate::symbols_.

bool Dyninst::AnnotatableSparse::operator== ( AnnotatableSparse cmp  )  [inline, inherited]
bool Function::operator== ( const Function f  ) 

Reimplemented from Dyninst::SymtabAPI::Aggregate.

Definition at line 497 of file Function.C.

References frameBase_, framePtrRegNum_, Dyninst::SymtabAPI::Type::getID(), and retType_.

void Aggregate::rebuild_symbol_vector ( SerializerBase ,
std::vector< Address > &   
) [protected, inherited]

Definition at line 504 of file Aggregate.C.

template<class T >
bool Dyninst::AnnotatableSparse::removeAnnotation ( AnnotationClass< T > &  a_id  )  [inline, inherited]
bool Function::removeSymbol ( Symbol sym  )  [virtual]
bool Aggregate::removeSymbolInt ( Symbol sym  )  [protected, inherited]
void Aggregate::restore_module_by_name ( SerializerBase ,
std::string &   
) [protected, inherited]

Definition at line 425 of file Aggregate.C.

void Aggregate::restore_type_by_id ( SerializerBase ,
Type *&  ,
unsigned   
) [protected, inherited]

Definition at line 378 of file Aggregate.C.

void Aggregate::serialize_aggregate ( SerializerBase ,
const char *  = "Aggregate" 
) [protected, inherited]

Definition at line 593 of file Aggregate.C.

Serializable * Function::serialize_impl ( SerializerBase sb,
const char *  tag = "Function" 
)

Definition at line 440 of file Function.C.

void Dyninst::AnnotatableSparse::serializeAnnotations ( SerializerBase sb,
const char *   
) [inline, inherited]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Function::setFramePtr ( std::vector< VariableLocation > *  locs  ) 
bool Function::setFramePtrRegnum ( int  regnum  ) 

Definition at line 90 of file Function.C.

References framePtrRegNum_.

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::setModule ( Module mod  )  [inherited]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::setOffset ( unsigned  offset  )  [inherited]
bool Function::setReturnType ( Type newType  ) 

Definition at line 79 of file Function.C.

References retType_.

Referenced by Dyninst::SymtabAPI::parseStabString().

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Aggregate::setSize ( unsigned  size  )  [inherited]
bool Function::setupParams (  ) 

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Dyninst::SymtabAPI::Function  
) [friend]

Reimplemented from Dyninst::SymtabAPI::Aggregate.

friend class Symtab [friend]

Reimplemented from Dyninst::SymtabAPI::Aggregate.

Definition at line 55 of file Function.h.


Field Documentation

Definition at line 108 of file Function.h.

Referenced by getFramePtr(), getFramePtrRefForInit(), operator<<(), and operator==().

Definition at line 109 of file Function.h.

Referenced by getFramePtr().

Definition at line 107 of file Function.h.

Referenced by getFramePtrRegnum(), operator==(), and setFramePtrRegnum().

Definition at line 110 of file Function.h.

Referenced by getSize().

std::vector<std::string> Dyninst::SymtabAPI::Aggregate::mangledNames_ [protected, inherited]
std::vector<std::string> Dyninst::SymtabAPI::Aggregate::prettyNames_ [protected, inherited]

Definition at line 106 of file Function.h.

Referenced by getReturnType(), operator==(), and setReturnType().

std::vector<Symbol *> Dyninst::SymtabAPI::Aggregate::symbols_ [protected, inherited]
std::vector<std::string> Dyninst::SymtabAPI::Aggregate::typedNames_ [protected, inherited]

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