Dyninst::SymtabAPI::DwarfWalker Class Reference

#include <dwarfWalker.h>

Data Structures

struct  Contexts

Public Types

enum  Error { NoError }

Public Member Functions

 DwarfWalker (Symtab *symtab, Dwarf_Debug &dbg)
 ~DwarfWalker ()
bool parse ()

Private Types

typedef std::vector< std::pair
< Address, Address > > 
range_set_t
typedef boost::shared_ptr
< std::vector< std::pair
< Address, Address > > > 
range_set_ptr

Private Member Functions

bool setup (Dwarf_Die dieEntry, Dwarf_Off modOffset, Address lowpc)
bool parseModule (Module *&fixUnknownMod)
bool parse_int (Dwarf_Die entry, bool parseSiblings)
bool parseSubprogram ()
bool parseLexicalBlock ()
bool parseCommonBlock ()
bool parseConstant ()
bool parseVariable ()
bool parseFormalParam ()
bool parseBaseType ()
bool parseTypedef ()
bool parseArray ()
bool parseSubrange ()
bool parseEnum ()
bool parseInheritance ()
bool parseStructUnionClass ()
bool parseEnumEntry ()
bool parseMember ()
bool parseConstPackedVolatile ()
bool parseTypeReferences ()
FunctioncurFunc ()
typeCommoncurCommon ()
typeEnumcurEnum ()
fieldListTypecurEnclosure ()
void setFunc (Function *f)
void setCommon (typeCommon *c)
void setEnum (typeEnum *e)
void setEnclosure (fieldListType *f)
std::string & curName ()
bool nameDefined ()
Objectobj ()
Symtabsymtab ()
Modulemod ()
std::vector< std::string > & srcFiles ()
typeCollectiontc ()
Dwarf_Debug & dbg ()
bool parseSibling ()
bool parseChild ()
void setParseSibling (bool p)
void setParseChild (bool p)
Dwarf_Half tag ()
Dwarf_Off offset ()
Dwarf_Die entry ()
Dwarf_Die specEntry ()
Dwarf_Die abstractEntry ()
void clearRanges ()
bool hasRanges ()
range_set_t::iterator ranges_begin ()
range_set_t::iterator ranges_end ()
unsigned long id ()
void setEntry (Dwarf_Die entry)
void setSpecEntry (Dwarf_Die se)
void setAbstractEntry (Dwarf_Die se)
void setTag (Dwarf_Half tag)
void setOffset (Dwarf_Off offset)
void setRange (std::pair< Address, Address > range)
bool buildSrcFiles (Dwarf_Die entry)
bool hasDeclaration (bool &decl)
bool findTag ()
bool findOffset ()
bool handleAbstractOrigin (bool &isAbstractOrigin)
bool handleSpecification (bool &hasSpec)
bool findFuncName ()
bool findFunction (bool &found)
bool findBaseAddr ()
bool getFrameBase ()
bool getReturnType (bool hasSpecification, Type *&returnType)
bool addFuncToContainer (Type *returnType)
bool findType (Type *&, bool defaultToVoid)
bool getLineInformation (Dwarf_Unsigned &variableLineNo, bool &hasLineNumber, std::string &filename)
bool findName (std::string &)
void removeFortranUnderscore (std::string &)
bool findSize (unsigned &size)
bool findVisibility (visibility_t &visibility)
bool findValue (long &value, bool &valid)
bool fixName (std::string &name, Type *type)
bool fixBitFields (std::vector< VariableLocation > &locs, long &size)
bool findEntryToUse (Dwarf_Half attr, bool &found, Dwarf_Die &entry)
bool parseSubrangeAUX (Dwarf_Die entry, std::string &lobound, std::string &hibound)
bool decodeLocationList (Dwarf_Half attr, Address *initialVal, std::vector< VariableLocation > &locs)
bool checkForConstantOrExpr (Dwarf_Half attr, Dwarf_Attribute &locationAttribute, bool &constant, bool &expr, Dwarf_Half &form)
bool findConstant (Dwarf_Half attr, Address &value)
bool findConstantWithForm (Dwarf_Attribute &attr, Dwarf_Half form, Address &value)
bool decodeConstantLocation (Dwarf_Attribute &attr, Dwarf_Half form, std::vector< VariableLocation > &locs)
bool constructConstantVariableLocation (Address value, std::vector< VariableLocation > &locs)
typeArrayparseMultiDimensionalArray (Dwarf_Die firstRange, Type *elementType)
bool decipherBound (Dwarf_Attribute boundAttribute, std::string &name)
bool decodeExpression (Dwarf_Attribute &attr, std::vector< VariableLocation > &locs)
bool decodeLocationListForStaticOffsetOrAddress (Dwarf_Locdesc **locationList, Dwarf_Signed listLength, std::vector< VariableLocation > &locs, Address *initialStackValue=NULL)
void deallocateLocationList (Dwarf_Locdesc *locationList, Dwarf_Signed listLength)
void deallocateLocationList (Dwarf_Locdesc **locationList, Dwarf_Signed listLength)
void clearFunc ()

Private Attributes

std::map< Dwarf_Off,
fieldListType * > 
enclosureMap
std::set< Function * > parsedFuncs
Contexts contexts_
Dwarf_Debug & dbg_
Modulemod_
Symtabsymtab_
std::vector< std::string > srcFiles_
typeCollectiontc_
std::string name_
Address modLow
Address modHigh
Dwarf_Unsigned cu_header_length
Dwarf_Half version
Dwarf_Unsigned abbrev_offset
Dwarf_Half addr_size
Dwarf_Half offset_size
Dwarf_Half extension_size
Dwarf_Sig8 signature
Dwarf_Unsigned typeoffset
Dwarf_Unsigned next_cu_header
Dwarf_Off compile_offset

Detailed Description

Definition at line 31 of file dwarfWalker.h.


Member Typedef Documentation

typedef boost::shared_ptr<std::vector<std::pair<Address, Address> > > Dyninst::SymtabAPI::DwarfWalker::range_set_ptr [private]

Definition at line 33 of file dwarfWalker.h.

typedef std::vector<std::pair<Address, Address> > Dyninst::SymtabAPI::DwarfWalker::range_set_t [private]

Definition at line 32 of file dwarfWalker.h.


Member Enumeration Documentation

Enumerator:
NoError 

Definition at line 98 of file dwarfWalker.h.


Constructor & Destructor Documentation

DwarfWalker::DwarfWalker ( Symtab symtab,
Dwarf_Debug &  dbg 
)

Definition at line 42 of file dwarfWalker.C.

DwarfWalker::~DwarfWalker (  ) 

Definition at line 52 of file dwarfWalker.C.


Member Function Documentation

Dwarf_Die Dyninst::SymtabAPI::DwarfWalker::abstractEntry (  )  [inline, private]
bool DwarfWalker::addFuncToContainer ( Type returnType  )  [private]
bool DwarfWalker::buildSrcFiles ( Dwarf_Die  entry  )  [private]

Definition at line 190 of file dwarfWalker.C.

References dbg(), DWARF_ERROR_RET, and srcFiles_.

Referenced by parseModule().

bool DwarfWalker::checkForConstantOrExpr ( Dwarf_Half  attr,
Dwarf_Attribute &  locationAttribute,
bool &  constant,
bool &  expr,
Dwarf_Half &  form 
) [private]

Definition at line 1427 of file dwarfWalker.C.

References DWARF_FAIL_RET, dwarf_printf, offset_size, and version.

Referenced by decodeLocationList().

void Dyninst::SymtabAPI::DwarfWalker::clearFunc (  )  [inline, private]

Definition at line 252 of file dwarfWalker.h.

References Dyninst::SymtabAPI::DwarfWalker::Contexts::clearFunc(), and contexts_.

Referenced by parse_int().

void Dyninst::SymtabAPI::DwarfWalker::clearRanges (  )  [inline, private]
bool DwarfWalker::constructConstantVariableLocation ( Address  value,
std::vector< VariableLocation > &  locs 
) [private]
typeCommon* Dyninst::SymtabAPI::DwarfWalker::curCommon (  )  [inline, private]
fieldListType* Dyninst::SymtabAPI::DwarfWalker::curEnclosure (  )  [inline, private]
typeEnum* Dyninst::SymtabAPI::DwarfWalker::curEnum (  )  [inline, private]

Definition at line 143 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::curEnum().

Referenced by parseEnumEntry().

Function* Dyninst::SymtabAPI::DwarfWalker::curFunc (  )  [inline, private]
std::string& Dyninst::SymtabAPI::DwarfWalker::curName (  )  [inline, private]
Dwarf_Debug& Dyninst::SymtabAPI::DwarfWalker::dbg (  )  [inline, private]
void DwarfWalker::deallocateLocationList ( Dwarf_Locdesc **  locationList,
Dwarf_Signed  listLength 
) [private]

Definition at line 2029 of file dwarfWalker.C.

References dbg().

void DwarfWalker::deallocateLocationList ( Dwarf_Locdesc *  locationList,
Dwarf_Signed  listLength 
) [private]

Definition at line 2020 of file dwarfWalker.C.

References dbg().

Referenced by decodeLocationList().

bool DwarfWalker::decipherBound ( Dwarf_Attribute  boundAttribute,
std::string &  name 
) [private]

Definition at line 1792 of file dwarfWalker.C.

References dbg(), DWARF_CHECK_RET, DWARF_FAIL_RET, and dwarf_printf.

Referenced by parseSubrangeAUX().

bool DwarfWalker::decodeConstantLocation ( Dwarf_Attribute &  attr,
Dwarf_Half  form,
std::vector< VariableLocation > &  locs 
) [private]

Definition at line 1499 of file dwarfWalker.C.

References constructConstantVariableLocation(), and findConstantWithForm().

Referenced by decodeLocationList().

bool DwarfWalker::decodeExpression ( Dwarf_Attribute &  attr,
std::vector< VariableLocation > &  locs 
) [private]
bool DwarfWalker::decodeLocationList ( Dwarf_Half  attr,
Address initialVal,
std::vector< VariableLocation > &  locs 
) [private]
bool DwarfWalker::decodeLocationListForStaticOffsetOrAddress ( Dwarf_Locdesc **  locationList,
Dwarf_Signed  listLength,
std::vector< VariableLocation > &  locs,
Address initialStackValue = NULL 
) [private]
Dwarf_Die Dyninst::SymtabAPI::DwarfWalker::entry (  )  [inline, private]
bool Dyninst::SymtabAPI::DwarfWalker::findBaseAddr (  )  [private]
bool DwarfWalker::findConstant ( Dwarf_Half  attr,
Address value 
) [private]

Definition at line 1449 of file dwarfWalker.C.

References DWARF_FAIL_RET, entry(), and findConstantWithForm().

Referenced by parseLexicalBlock(), and parseModule().

bool DwarfWalker::findConstantWithForm ( Dwarf_Attribute &  attr,
Dwarf_Half  form,
Address value 
) [private]

Definition at line 1466 of file dwarfWalker.C.

References DWARF_FAIL_RET, and dwarf_printf.

Referenced by decodeConstantLocation(), and findConstant().

bool DwarfWalker::findEntryToUse ( Dwarf_Half  attr,
bool &  found,
Dwarf_Die &  entry 
) [private]

Definition at line 1056 of file dwarfWalker.C.

References abstractEntry(), DWARF_FAIL_RET, entry(), and specEntry().

bool DwarfWalker::findFuncName (  )  [private]

Definition at line 1166 of file dwarfWalker.C.

References curName(), dbg(), DWARF_CHECK_RET, DWARF_FAIL_RET, dwarf_printf, findName(), and specEntry().

Referenced by parseSubprogram().

bool DwarfWalker::findFunction ( bool &  found  )  [private]
bool DwarfWalker::findName ( std::string &  name  )  [private]
bool DwarfWalker::findOffset (  )  [private]

Definition at line 1048 of file dwarfWalker.C.

References DWARF_FAIL_RET, entry(), and setOffset().

Referenced by parse_int().

bool DwarfWalker::findSize ( unsigned &  size  )  [private]

Definition at line 1533 of file dwarfWalker.C.

References dbg(), DWARF_FAIL_RET, entry(), and specEntry().

Referenced by parseBaseType(), and parseStructUnionClass().

bool DwarfWalker::findTag (  )  [private]

Definition at line 1040 of file dwarfWalker.C.

References DWARF_FAIL_RET, entry(), and setTag().

Referenced by parse_int().

bool DwarfWalker::findType ( Type *&  type,
bool  defaultToVoid 
) [private]
bool DwarfWalker::findValue ( long &  value,
bool &  valid 
) [private]

Definition at line 1577 of file dwarfWalker.C.

References dbg(), DWARF_CHECK_RET, DWARF_FAIL_RET, and entry().

Referenced by parseEnumEntry().

bool DwarfWalker::findVisibility ( visibility_t visibility  )  [private]
bool DwarfWalker::fixBitFields ( std::vector< VariableLocation > &  locs,
long &  size 
) [private]

Definition at line 1598 of file dwarfWalker.C.

References dbg(), DWARF_CHECK_RET, DWARF_FAIL_RET, and entry().

Referenced by parseMember().

bool DwarfWalker::fixName ( std::string &  name,
Type type 
) [private]

Definition at line 1633 of file dwarfWalker.C.

References Dyninst::SymtabAPI::Type::getName(), and tag().

Referenced by parseConstPackedVolatile(), and parseTypedef().

bool DwarfWalker::getFrameBase (  )  [private]
bool DwarfWalker::getLineInformation ( Dwarf_Unsigned &  variableLineNo,
bool &  hasLineNumber,
std::string &  filename 
) [private]

Definition at line 1332 of file dwarfWalker.C.

References dbg(), DWARF_CHECK_RET, DWARF_FAIL_RET, specEntry(), and srcFiles().

Referenced by parseFormalParam(), and parseVariable().

bool DwarfWalker::getReturnType ( bool  hasSpecification,
Type *&  returnType 
) [private]
bool DwarfWalker::handleAbstractOrigin ( bool &  isAbstractOrigin  )  [private]

Definition at line 1088 of file dwarfWalker.C.

References dbg(), DWARF_FAIL_RET, dwarf_printf, entry(), and setAbstractEntry().

Referenced by parseFormalParam(), and parseSubprogram().

bool DwarfWalker::handleSpecification ( bool &  hasSpec  )  [private]

Definition at line 1120 of file dwarfWalker.C.

References dbg(), DWARF_FAIL_RET, dwarf_printf, entry(), and setSpecEntry().

Referenced by parseSubprogram(), and parseVariable().

bool DwarfWalker::hasDeclaration ( bool &  decl  )  [private]

Definition at line 1031 of file dwarfWalker.C.

References DWARF_FAIL_RET, and entry().

Referenced by parseStructUnionClass().

bool Dyninst::SymtabAPI::DwarfWalker::hasRanges (  )  [inline, private]
unsigned long Dyninst::SymtabAPI::DwarfWalker::id (  )  [inline, private]

Definition at line 182 of file dwarfWalker.h.

References compile_offset, and offset().

Module* Dyninst::SymtabAPI::DwarfWalker::mod (  )  [inline, private]

Definition at line 157 of file dwarfWalker.h.

References mod_.

Referenced by parseSubrangeAUX(), and removeFortranUnderscore().

bool Dyninst::SymtabAPI::DwarfWalker::nameDefined (  )  [inline, private]
Object * DwarfWalker::obj (  )  [private]
Dwarf_Off Dyninst::SymtabAPI::DwarfWalker::offset (  )  [inline, private]
bool DwarfWalker::parse (  ) 
bool DwarfWalker::parse_int ( Dwarf_Die  entry,
bool  parseSiblings 
) [private]
bool DwarfWalker::parseArray (  )  [private]
bool DwarfWalker::parseBaseType (  )  [private]
bool Dyninst::SymtabAPI::DwarfWalker::parseChild (  )  [inline, private]

Definition at line 163 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::parseChild().

Referenced by parse_int().

bool DwarfWalker::parseCommonBlock (  )  [private]
bool DwarfWalker::parseConstant (  )  [private]

Definition at line 543 of file dwarfWalker.C.

References dwarf_printf.

Referenced by parse_int().

bool DwarfWalker::parseConstPackedVolatile (  )  [private]
bool DwarfWalker::parseEnum (  )  [private]
bool DwarfWalker::parseEnumEntry (  )  [private]
bool DwarfWalker::parseFormalParam (  )  [private]
bool DwarfWalker::parseInheritance (  )  [private]
bool DwarfWalker::parseLexicalBlock (  )  [private]
bool DwarfWalker::parseMember (  )  [private]
bool DwarfWalker::parseModule ( Module *&  fixUnknownMod  )  [private]
typeArray * DwarfWalker::parseMultiDimensionalArray ( Dwarf_Die  firstRange,
Type elementType 
) [private]
bool Dyninst::SymtabAPI::DwarfWalker::parseSibling (  )  [inline, private]

Definition at line 162 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::parseSibling().

Referenced by parse_int().

bool DwarfWalker::parseStructUnionClass (  )  [private]
bool DwarfWalker::parseSubprogram (  )  [private]
bool DwarfWalker::parseSubrange (  )  [private]

Definition at line 848 of file dwarfWalker.C.

References dwarf_printf, entry(), and parseSubrangeAUX().

Referenced by parse_int().

bool DwarfWalker::parseSubrangeAUX ( Dwarf_Die  entry,
std::string &  lobound,
std::string &  hibound 
) [private]
bool DwarfWalker::parseTypedef (  )  [private]
bool DwarfWalker::parseTypeReferences (  )  [private]
bool DwarfWalker::parseVariable (  )  [private]
range_set_t::iterator Dyninst::SymtabAPI::DwarfWalker::ranges_begin (  )  [inline, private]
range_set_t::iterator Dyninst::SymtabAPI::DwarfWalker::ranges_end (  )  [inline, private]
void DwarfWalker::removeFortranUnderscore ( std::string &  name  )  [private]
void Dyninst::SymtabAPI::DwarfWalker::setAbstractEntry ( Dwarf_Die  se  )  [inline, private]
void Dyninst::SymtabAPI::DwarfWalker::setCommon ( typeCommon c  )  [inline, private]

Definition at line 147 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setCommon().

Referenced by parseCommonBlock().

void Dyninst::SymtabAPI::DwarfWalker::setEnclosure ( fieldListType f  )  [inline, private]
void DwarfWalker::setEntry ( Dwarf_Die  entry  )  [private]
void Dyninst::SymtabAPI::DwarfWalker::setEnum ( typeEnum e  )  [inline, private]

Definition at line 148 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setEnum().

Referenced by parseEnum().

void Dyninst::SymtabAPI::DwarfWalker::setFunc ( Function f  )  [inline, private]

Definition at line 146 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setFunc().

Referenced by findFunction().

void Dyninst::SymtabAPI::DwarfWalker::setOffset ( Dwarf_Off  offset  )  [inline, private]

Definition at line 188 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setOffset().

Referenced by findOffset().

void Dyninst::SymtabAPI::DwarfWalker::setParseChild ( bool  p  )  [inline, private]
void Dyninst::SymtabAPI::DwarfWalker::setParseSibling ( bool  p  )  [inline, private]

Definition at line 164 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setParseSibling().

Referenced by parse_int().

void Dyninst::SymtabAPI::DwarfWalker::setRange ( std::pair< Address, Address range  )  [inline, private]

Definition at line 189 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setRange().

Referenced by parseLexicalBlock().

void Dyninst::SymtabAPI::DwarfWalker::setSpecEntry ( Dwarf_Die  se  )  [inline, private]
void Dyninst::SymtabAPI::DwarfWalker::setTag ( Dwarf_Half  tag  )  [inline, private]

Definition at line 187 of file dwarfWalker.h.

References contexts_, and Dyninst::SymtabAPI::DwarfWalker::Contexts::setTag().

Referenced by findTag().

bool Dyninst::SymtabAPI::DwarfWalker::setup ( Dwarf_Die  dieEntry,
Dwarf_Off  modOffset,
Address  lowpc 
) [private]
Dwarf_Die Dyninst::SymtabAPI::DwarfWalker::specEntry (  )  [inline, private]
std::vector<std::string>& Dyninst::SymtabAPI::DwarfWalker::srcFiles (  )  [inline, private]

Definition at line 158 of file dwarfWalker.h.

References srcFiles_.

Referenced by getLineInformation().

Symtab* Dyninst::SymtabAPI::DwarfWalker::symtab (  )  [inline, private]
Dwarf_Half Dyninst::SymtabAPI::DwarfWalker::tag (  )  [inline, private]
typeCollection* Dyninst::SymtabAPI::DwarfWalker::tc (  )  [inline, private]

Field Documentation

Definition at line 275 of file dwarfWalker.h.

Referenced by parse().

Definition at line 276 of file dwarfWalker.h.

Referenced by decodeExpression(), and parse().

Definition at line 285 of file dwarfWalker.h.

Referenced by id(), and parseModule().

Definition at line 273 of file dwarfWalker.h.

Referenced by parse().

Dwarf_Debug& Dyninst::SymtabAPI::DwarfWalker::dbg_ [private]

Definition at line 262 of file dwarfWalker.h.

Referenced by dbg().

Definition at line 256 of file dwarfWalker.h.

Referenced by parse_int(), and parseModule().

Definition at line 278 of file dwarfWalker.h.

Referenced by parse().

Definition at line 263 of file dwarfWalker.h.

Referenced by mod(), parse(), and parseModule().

Definition at line 272 of file dwarfWalker.h.

Referenced by decodeLocationListForStaticOffsetOrAddress(), and parseModule().

Definition at line 271 of file dwarfWalker.h.

Referenced by decodeLocationListForStaticOffsetOrAddress(), and parseModule().

Definition at line 268 of file dwarfWalker.h.

Referenced by curName(), and nameDefined().

Definition at line 281 of file dwarfWalker.h.

Referenced by parse().

Definition at line 277 of file dwarfWalker.h.

Referenced by checkForConstantOrExpr(), and parse().

Definition at line 258 of file dwarfWalker.h.

Referenced by parseSubprogram().

Definition at line 279 of file dwarfWalker.h.

Referenced by parse().

std::vector<std::string> Dyninst::SymtabAPI::DwarfWalker::srcFiles_ [private]

Definition at line 265 of file dwarfWalker.h.

Referenced by buildSrcFiles(), and srcFiles().

Definition at line 264 of file dwarfWalker.h.

Referenced by obj(), parse(), and symtab().

Definition at line 266 of file dwarfWalker.h.

Referenced by parseModule(), and tc().

Definition at line 280 of file dwarfWalker.h.

Referenced by parse().

Definition at line 274 of file dwarfWalker.h.

Referenced by checkForConstantOrExpr(), and parse().


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