Dyninst::SymtabAPI::Symbol Class Reference

#include <Symbol.h>

Inheritance diagram for Dyninst::SymtabAPI::Symbol:
Dyninst::Serializable Dyninst::AnnotatableSparse

Public Types

enum  SymbolType {
  ST_UNKNOWN, ST_FUNCTION, ST_OBJECT, ST_MODULE,
  ST_SECTION, ST_TLS, ST_DELETED, ST_INDIRECT,
  ST_NOTYPE
}
enum  SymbolLinkage { SL_UNKNOWN, SL_GLOBAL, SL_LOCAL, SL_WEAK }
enum  SymbolTag { TAG_UNKNOWN, TAG_USER, TAG_LIBRARY, TAG_INTERNAL }
enum  SymbolVisibility {
  SV_UNKNOWN, SV_DEFAULT, SV_INTERNAL, SV_HIDDEN,
  SV_PROTECTED
}
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 Symbol ()
SYMTAB_EXPORT Symbol (const std::string &name, SymbolType t, SymbolLinkage l, SymbolVisibility v, Offset o, Module *module=NULL, Region *r=NULL, unsigned s=0, bool d=false, bool a=false, int index=-1, int strindex=-1, bool cs=false)
SYMTAB_EXPORT ~Symbol ()
SYMTAB_EXPORT bool operator== (const Symbol &) const
SYMTAB_EXPORT const std::string & getMangledName () const
SYMTAB_EXPORT const std::string & getPrettyName () const
SYMTAB_EXPORT const std::string & getTypedName () const
SYMTAB_EXPORT ModulegetModule () const
SYMTAB_EXPORT SymtabgetSymtab () const
SYMTAB_EXPORT SymbolType getType () const
SYMTAB_EXPORT SymbolLinkage getLinkage () const
SYMTAB_EXPORT Offset getOffset () const
SYMTAB_EXPORT Offset getPtrOffset () const
SYMTAB_EXPORT Offset getLocalTOC () const
SYMTAB_EXPORT unsigned getSize () const
SYMTAB_EXPORT RegiongetRegion () const
SYMTAB_EXPORT bool isInDynSymtab () const
SYMTAB_EXPORT bool isInSymtab () const
SYMTAB_EXPORT bool isAbsolute () const
SYMTAB_EXPORT bool isCommonStorage () const
SYMTAB_EXPORT bool isFunction () const
SYMTAB_EXPORT bool setFunction (Function *func)
SYMTAB_EXPORT FunctiongetFunction () const
SYMTAB_EXPORT bool isVariable () const
SYMTAB_EXPORT bool setVariable (Variable *var)
SYMTAB_EXPORT VariablegetVariable () const
SYMTAB_EXPORT SymbolVisibility getVisibility () const
SYMTAB_EXPORT int getIndex () const
SYMTAB_EXPORT bool setIndex (int index)
SYMTAB_EXPORT int getStrIndex () const
SYMTAB_EXPORT bool setStrIndex (int strindex)
SYMTAB_EXPORT void setReferringSymbol (Symbol *referringSymbol)
SYMTAB_EXPORT SymbolgetReferringSymbol ()
SYMTAB_EXPORT bool setOffset (Offset newOffset)
SYMTAB_EXPORT bool setPtrOffset (Offset newOffset)
SYMTAB_EXPORT bool setLocalTOC (Offset localTOC)
SYMTAB_EXPORT bool setSize (unsigned ns)
SYMTAB_EXPORT bool setRegion (Region *r)
SYMTAB_EXPORT bool setModule (Module *mod)
SYMTAB_EXPORT bool setMangledName (std::string name)
SYMTAB_EXPORT bool setSymbolType (SymbolType sType)
SYMTAB_EXPORT SymbolTag tag () const
SYMTAB_EXPORT bool setDynamic (bool d)
SYMTAB_EXPORT bool setAbsolute (bool a)
SYMTAB_EXPORT bool setCommonStorage (bool cs)
SYMTAB_EXPORT bool setVersionFileName (std::string &fileName)
SYMTAB_EXPORT bool setVersions (std::vector< std::string > &vers)
SYMTAB_EXPORT bool setVersionNum (unsigned verNum)
SYMTAB_EXPORT void setVersionHidden ()
SYMTAB_EXPORT bool getVersionFileName (std::string &fileName)
SYMTAB_EXPORT bool getVersions (std::vector< std::string > *&vers)
SYMTAB_EXPORT bool getVersionNum (unsigned &verNum)
SYMTAB_EXPORT bool getVersionHidden ()
int getInternalType ()
void setInternalType (int i)
SYMTAB_EXPORT Serializableserialize_impl (SerializerBase *, const char *tag="Symbol") THROW_SPEC(SerializerError)
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 ()

Static Public Member Functions

static const char * symbolType2Str (SymbolType t)
static const char * symbolLinkage2Str (SymbolLinkage t)
static const char * symbolTag2Str (SymbolTag t)
static const char * symbolVisibility2Str (SymbolVisibility t)
static SYMTAB_EXPORT SymbolmagicEmitElfSymbol ()

Static Public Attributes

static std::string emptyString

Private Member Functions

void restore_module_and_region (SerializerBase *, std::string &, Offset) THROW_SPEC(SerializerError)

Private Attributes

Modulemodule_
SymbolType type_
int internal_type_
SymbolLinkage linkage_
SymbolVisibility visibility_
Offset offset_
Offset ptr_offset_
Offset localTOC_
Regionregion_
Symbolreferring_
unsigned size_
bool isDynamic_
bool isAbsolute_
Aggregateaggregate_
std::string mangledName_
std::string prettyName_
std::string typedName_
SymbolTag tag_
int index_
int strindex_
bool isCommonStorage_
std::vector< std::string > verNames_
bool versionHidden_

Friends

class typeCommon
class Symtab
class AObject
class Object
class Aggregate
class relocationEntry
std::string parseStabString (Module *, int linenum, char *, int, typeCommon *)
std::ostream & operator<< (std::ostream &os, const Symbol &s)

Detailed Description

Definition at line 71 of file Symbol.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.


Member Enumeration Documentation

Enumerator:
SL_UNKNOWN 
SL_GLOBAL 
SL_LOCAL 
SL_WEAK 

Definition at line 100 of file Symbol.h.

Enumerator:
TAG_UNKNOWN 
TAG_USER 
TAG_LIBRARY 
TAG_INTERNAL 

Definition at line 109 of file Symbol.h.

Enumerator:
ST_UNKNOWN 
ST_FUNCTION 
ST_OBJECT 
ST_MODULE 
ST_SECTION 
ST_TLS 
ST_DELETED 
ST_INDIRECT 
ST_NOTYPE 

Definition at line 86 of file Symbol.h.

Enumerator:
SV_UNKNOWN 
SV_DEFAULT 
SV_INTERNAL 
SV_HIDDEN 
SV_PROTECTED 

Definition at line 118 of file Symbol.h.


Constructor & Destructor Documentation

Symbol::Symbol (  ) 

Definition at line 476 of file Symbol.C.

Referenced by magicEmitElfSymbol().

Symbol::Symbol ( const std::string &  name,
SymbolType  t,
SymbolLinkage  l,
SymbolVisibility  v,
Offset  o,
Module module = NULL,
Region r = NULL,
unsigned  s = 0,
bool  d = false,
bool  a = false,
int  index = -1,
int  strindex = -1,
bool  cs = false 
)

Definition at line 502 of file Symbol.C.

Symbol::~Symbol (  ) 

Member Function Documentation

template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::addAnnotation ( const T *  a,
AnnotationClass< T > &  a_id 
) [inline, inherited]
void Dyninst::AnnotatableSparse::annotationsReport (  )  [inline, inherited]
template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::getAnnotation ( T *&  a,
AnnotationClass< T > &  a_id 
) const [inline, inherited]
SYMTAB_EXPORT Function * Symbol::getFunction (  )  const

Definition at line 229 of file Symbol.C.

References aggregate_.

Referenced by Dyninst::SymtabAPI::Symtab::createFunction(), and isFunction().

SYMTAB_EXPORT int Dyninst::SymtabAPI::Symbol::getIndex (  )  const [inline]

Definition at line 180 of file Symbol.h.

References index_.

Referenced by sortByIndex::operator()().

int Dyninst::SymtabAPI::Symbol::getInternalType (  )  [inline]

Definition at line 219 of file Symbol.h.

References internal_type_.

Referenced by elfSymType().

SYMTAB_EXPORT SymbolLinkage Dyninst::SymtabAPI::Symbol::getLinkage (  )  const [inline]
SYMTAB_EXPORT Offset Dyninst::SymtabAPI::Symbol::getLocalTOC (  )  const [inline]

Definition at line 161 of file Symbol.h.

References localTOC_.

SYMTAB_EXPORT const string & Symbol::getMangledName (  )  const
SYMTAB_EXPORT Module* Dyninst::SymtabAPI::Symbol::getModule (  )  const [inline]
SYMTAB_EXPORT Offset Dyninst::SymtabAPI::Symbol::getOffset (  )  const [inline]
SYMTAB_EXPORT const string & Symbol::getPrettyName (  )  const
SYMTAB_EXPORT Offset Dyninst::SymtabAPI::Symbol::getPtrOffset (  )  const [inline]

Definition at line 160 of file Symbol.h.

References ptr_offset_.

Referenced by Dyninst::SymtabAPI::emitElf64::createElfSymbol().

Symbol * Symbol::getReferringSymbol (  ) 
SYMTAB_EXPORT Region* Dyninst::SymtabAPI::Symbol::getRegion (  )  const [inline]
SYMTAB_EXPORT unsigned Dyninst::SymtabAPI::Symbol::getSize (  )  const [inline]
SYMTAB_EXPORT int Dyninst::SymtabAPI::Symbol::getStrIndex (  )  const [inline]

Definition at line 182 of file Symbol.h.

References strindex_.

Symtab * Symbol::getSymtab (  )  const
SYMTAB_EXPORT SymbolType Dyninst::SymtabAPI::Symbol::getType (  )  const [inline]
SYMTAB_EXPORT const string & Symbol::getTypedName (  )  const
SYMTAB_EXPORT Variable * Symbol::getVariable (  )  const

Definition at line 247 of file Symbol.C.

References aggregate_.

Referenced by Dyninst::SymtabAPI::Symtab::createVariable(), and isVariable().

SYMTAB_EXPORT bool Symbol::getVersionFileName ( std::string &  fileName  ) 
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::getVersionHidden (  )  [inline]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::getVersionNum ( unsigned &  verNum  ) 
SYMTAB_EXPORT bool Symbol::getVersions ( std::vector< std::string > *&  vers  ) 
SYMTAB_EXPORT SymbolVisibility Dyninst::SymtabAPI::Symbol::getVisibility (  )  const [inline]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::isAbsolute (  )  const [inline]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::isCommonStorage (  )  const [inline]
SYMTAB_EXPORT bool Symbol::isFunction (  )  const

Definition at line 218 of file Symbol.C.

References getFunction().

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::isInDynSymtab (  )  const [inline]

Definition at line 165 of file Symbol.h.

References isDynamic_, ST_DELETED, and type_.

Referenced by Dyninst::SymtabAPI::Symtab::addSymbol(), and print_symbols().

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::isInSymtab (  )  const [inline]

Definition at line 166 of file Symbol.h.

References isDynamic_, ST_DELETED, and type_.

Referenced by print_symbols().

SYMTAB_EXPORT bool Symbol::isVariable (  )  const

Definition at line 236 of file Symbol.C.

References getVariable().

Symbol * Symbol::magicEmitElfSymbol (  )  [static]
bool Dyninst::AnnotatableSparse::operator== ( AnnotatableSparse cmp  )  [inline, inherited]
bool Symbol::operator== ( const Symbol s  )  const
template<class T >
bool Dyninst::AnnotatableSparse::removeAnnotation ( AnnotationClass< T > &  a_id  )  [inline, inherited]
void Symbol::restore_module_and_region ( SerializerBase ,
std::string &  ,
Offset   
) [private]

Definition at line 395 of file Symbol.C.

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

Definition at line 390 of file Symbol.C.

void Dyninst::AnnotatableSparse::serializeAnnotations ( SerializerBase sb,
const char *   
) [inline, inherited]
SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setAbsolute ( bool  a  )  [inline]

Definition at line 201 of file Symbol.h.

References isAbsolute_.

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setCommonStorage ( bool  cs  )  [inline]

Definition at line 202 of file Symbol.h.

References isCommonStorage_.

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setDynamic ( bool  d  )  [inline]

Definition at line 200 of file Symbol.h.

References isDynamic_.

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

SYMTAB_EXPORT bool Symbol::setFunction ( Function func  ) 

Definition at line 223 of file Symbol.C.

References aggregate_.

Referenced by Dyninst::SymtabAPI::Symtab::addSymbolToAggregates().

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setIndex ( int  index  )  [inline]

Definition at line 181 of file Symbol.h.

References index_.

void Dyninst::SymtabAPI::Symbol::setInternalType ( int  i  )  [inline]

Definition at line 220 of file Symbol.h.

References internal_type_.

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

bool Symbol::setLocalTOC ( Offset  localTOC  ) 

Definition at line 206 of file Symbol.C.

References localTOC_.

SYMTAB_EXPORT bool Symbol::setMangledName ( std::string  name  ) 

Definition at line 384 of file Symbol.C.

References mangledName_, and setStrIndex().

SYMTAB_EXPORT bool Symbol::setModule ( Module mod  ) 
bool Symbol::setOffset ( Offset  newOffset  ) 

Definition at line 194 of file Symbol.C.

References offset_.

Referenced by Dyninst::SymtabAPI::Symtab::fixup_SymbolAddr().

bool Symbol::setPtrOffset ( Offset  newOffset  ) 

Definition at line 200 of file Symbol.C.

References ptr_offset_.

void Symbol::setReferringSymbol ( Symbol referringSymbol  ) 

Definition at line 555 of file Symbol.C.

References referring_.

Referenced by Dyninst::SymtabAPI::Symtab::addSymbol().

SYMTAB_EXPORT bool Symbol::setRegion ( Region r  ) 

Definition at line 258 of file Symbol.C.

References region_.

Referenced by Dyninst::SymtabAPI::Symtab::fixSymRegion().

SYMTAB_EXPORT bool Symbol::setSize ( unsigned  ns  ) 

Definition at line 252 of file Symbol.C.

References size_.

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setStrIndex ( int  strindex  )  [inline]

Definition at line 183 of file Symbol.h.

References strindex_.

Referenced by setMangledName().

SYMTAB_EXPORT bool Symbol::setSymbolType ( SymbolType  sType  ) 
SYMTAB_EXPORT bool Symbol::setVariable ( Variable var  ) 

Definition at line 241 of file Symbol.C.

References aggregate_.

Referenced by Dyninst::SymtabAPI::Symtab::addSymbolToAggregates().

SYMTAB_EXPORT bool Symbol::setVersionFileName ( std::string &  fileName  ) 
SYMTAB_EXPORT void Dyninst::SymtabAPI::Symbol::setVersionHidden (  )  [inline]

Definition at line 207 of file Symbol.h.

References versionHidden_.

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

SYMTAB_EXPORT bool Dyninst::SymtabAPI::Symbol::setVersionNum ( unsigned  verNum  ) 
SYMTAB_EXPORT bool Symbol::setVersions ( std::vector< std::string > &  vers  ) 
const char * Symbol::symbolLinkage2Str ( SymbolLinkage  t  )  [static]

Definition at line 3526 of file Symtab.C.

References CASE_RETURN_STR, SL_GLOBAL, SL_LOCAL, SL_UNKNOWN, and SL_WEAK.

const char * Symbol::symbolTag2Str ( SymbolTag  t  )  [static]

Definition at line 3539 of file Symtab.C.

References CASE_RETURN_STR, TAG_INTERNAL, TAG_LIBRARY, TAG_UNKNOWN, and TAG_USER.

const char * Symbol::symbolType2Str ( SymbolType  t  )  [static]
const char * Symbol::symbolVisibility2Str ( SymbolVisibility  t  )  [static]

Definition at line 3552 of file Symtab.C.

References CASE_RETURN_STR, SV_DEFAULT, SV_HIDDEN, SV_INTERNAL, SV_PROTECTED, and SV_UNKNOWN.

SYMTAB_EXPORT Symbol::SymbolTag Symbol::tag (  )  const

Definition at line 264 of file Symbol.C.

References tag_.


Friends And Related Function Documentation

friend class Aggregate [friend]

Definition at line 78 of file Symbol.h.

friend class AObject [friend]

Definition at line 76 of file Symbol.h.

friend class Object [friend]

Definition at line 77 of file Symbol.h.

std::ostream& operator<< ( std::ostream &  os,
const Symbol s 
) [friend]
std::string parseStabString ( Module ,
int  linenum,
char *  ,
int  ,
typeCommon  
) [friend]
friend class relocationEntry [friend]

Definition at line 79 of file Symbol.h.

friend class Symtab [friend]

Definition at line 75 of file Symbol.h.

friend class typeCommon [friend]

Definition at line 74 of file Symbol.h.


Field Documentation

string Symbol::emptyString [static]

Definition at line 218 of file Symbol.h.

Definition at line 246 of file Symbol.h.

Referenced by getIndex(), and setIndex().

Definition at line 226 of file Symbol.h.

Referenced by getInternalType(), and setInternalType().

Definition at line 237 of file Symbol.h.

Referenced by isAbsolute(), operator==(), and setAbsolute().

Definition at line 249 of file Symbol.h.

Referenced by isCommonStorage(), operator==(), and setCommonStorage().

Definition at line 236 of file Symbol.h.

Referenced by isInDynSymtab(), isInSymtab(), operator==(), and setDynamic().

Definition at line 227 of file Symbol.h.

Referenced by getLinkage(), and operator==().

Definition at line 231 of file Symbol.h.

Referenced by getLocalTOC(), and setLocalTOC().

Definition at line 241 of file Symbol.h.

Referenced by getMangledName(), operator==(), and setMangledName().

Definition at line 224 of file Symbol.h.

Referenced by getModule(), getSymtab(), operator==(), setModule(), and setSymbolType().

Definition at line 242 of file Symbol.h.

Referenced by Dyninst::SymtabAPI::Symtab::demangleSymbol(), getPrettyName(), and operator==().

Definition at line 230 of file Symbol.h.

Referenced by getPtrOffset(), and setPtrOffset().

Definition at line 233 of file Symbol.h.

Referenced by getReferringSymbol(), and setReferringSymbol().

Definition at line 232 of file Symbol.h.

Referenced by getRegion(), operator==(), and setRegion().

Definition at line 234 of file Symbol.h.

Referenced by getSize(), operator==(), and setSize().

Definition at line 247 of file Symbol.h.

Referenced by getStrIndex(), and setStrIndex().

Definition at line 245 of file Symbol.h.

Referenced by tag().

Definition at line 225 of file Symbol.h.

Referenced by getType(), isInDynSymtab(), isInSymtab(), operator==(), and setSymbolType().

Definition at line 243 of file Symbol.h.

Referenced by Dyninst::SymtabAPI::Symtab::demangleSymbol(), getTypedName(), and operator==().

std::vector<std::string> Dyninst::SymtabAPI::Symbol::verNames_ [private]

Definition at line 251 of file Symbol.h.

Definition at line 253 of file Symbol.h.

Referenced by getVersionHidden(), operator==(), and setVersionHidden().

Definition at line 228 of file Symbol.h.

Referenced by getVisibility().


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