decompiler  1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FunctionSymbol Class Reference

A Symbol representing an executable function. More...

#include <database.hh>

Inheritance diagram for FunctionSymbol:
Symbol

Public Member Functions

 FunctionSymbol (Scope *sc, const string &nm, int4 size)
 Construct given the name. More...
 
 FunctionSymbol (Scope *sc, int4 size)
 Constructor for use with restoreXml.
 
FuncdatagetFunction (void)
 Get the underlying Funcdata object.
 
virtual void saveXml (ostream &s) const
 Save this Symbol to an XML stream. More...
 
virtual void restoreXml (const Element *el)
 Restore this Symbol from an XML stream. More...
 
- Public Member Functions inherited from Symbol
 Symbol (Scope *sc, const string &nm, Datatype *ct)
 Construct given a name and data-type.
 
 Symbol (Scope *sc)
 Construct for use with restoreXml()
 
const string & getName (void) const
 Get the local name of the symbol.
 
DatatypegetType (void) const
 Get the data-type.
 
uint4 getId (void) const
 Get a unique id for the symbol.
 
uint4 getFlags (void) const
 Get the boolean properties of the Symbol.
 
uint4 getDisplayFormat (void) const
 Get the format to display the Symbol in.
 
int2 getCategory (void) const
 Get the Symbol category.
 
uint2 getCategoryIndex (void) const
 Get the position of the Symbol within its category.
 
bool isTypeLocked (void) const
 Is the Symbol type-locked.
 
bool isNameLocked (void) const
 Is the Symbol name-locked.
 
bool isSizeTypeLocked (void) const
 Is the Symbol size type-locked.
 
bool isIndirectStorage (void) const
 Is storage really a pointer to the true Symbol.
 
bool isHiddenReturn (void) const
 Is this a reference to the function return value.
 
bool isNameUndefined (void) const
 Does this have an undefined name. More...
 
ScopegetScope (void) const
 Get the scope owning this Symbol.
 
SymbolEntrygetFirstWholeMap (void) const
 Get the first entire mapping of the symbol. More...
 
SymbolEntrygetMapEntry (const Address &addr) const
 Get first mapping of the symbol that contains the given Address. More...
 
void saveXmlHeader (ostream &s) const
 Save basic Symbol properties as XML attributes. More...
 
void restoreXmlHeader (const Element *el)
 Restore basic Symbol properties from XML. More...
 
void saveXmlBody (ostream &s) const
 Save details of the Symbol to XML. More...
 
void restoreXmlBody (List::const_iterator iter)
 Restore details of the Symbol from XML. More...
 

Private Member Functions

void buildType (int4 size)
 Build the data-type associated with this Symbol.
 

Private Attributes

Funcdatafd
 The underlying meta-data object for the function.
 

Additional Inherited Members

- Public Types inherited from Symbol
enum  {
  force_hex = 1, force_dec = 2, force_oct = 3, force_bin = 4,
  force_char = 5, size_typelock = 8
}
 Possible display (dispflag) properties for a Symbol. More...
 
- Protected Member Functions inherited from Symbol
virtual ~Symbol (void)
 Destructor.
 
void setDisplayFormat (uint4 val)
 Set the display format for this Symbol. More...
 
void checkSizeTypeLock (void)
 Calculate if size_typelock property is on. More...
 
- Protected Attributes inherited from Symbol
Scopescope
 The scope that owns this symbol.
 
string name
 The local name of the symbol.
 
uint4 nameDedup
 id to distinguish symbols with the same name
 
Datatypetype
 The symbol's data-type.
 
uint4 flags
 Varnode-like properties of the symbol.
 
uint4 dispflags
 Flags affecting the display of this symbol.
 
int2 category
 Special category (-1==none 0=parameter 1=equate)
 
uint2 catindex
 Index within category.
 
vector< list< SymbolEntry >::iterator > mapentry
 List of storage locations labeled with this Symbol.
 

Detailed Description

A Symbol representing an executable function.

This Symbol owns the Funcdata object for the function it represents. The formal Symbol is thus associated with all the meta-data about the function.

Constructor & Destructor Documentation

◆ FunctionSymbol()

FunctionSymbol::FunctionSymbol ( Scope sc,
const string &  nm,
int4  size 
)

Construct given the name.

Build a function shell, made up of just the name of the function and a placeholder data-type, without the underlying Funcdata object.

Parameters
scis the Scope that will contain the new Symbol
nmis the name of the new Symbol
sizeis the number of bytes the Symbol should consume

References buildType(), fd, and Symbol::name.

Member Function Documentation

◆ restoreXml()

void FunctionSymbol::restoreXml ( const Element el)
virtual

Restore this Symbol from an XML stream.

Parameters
elis the root XML tag of the symbol

Reimplemented from Symbol.

References buildType(), fd, Funcdata::getName(), Datatype::getSize(), Funcdata::getSize(), Symbol::name, Funcdata::restoreXml(), Symbol::scope, and Symbol::type.

◆ saveXml()

void FunctionSymbol::saveXml ( ostream &  s) const
virtual

Save this Symbol to an XML stream.

Parameters
sis the output stream

Reimplemented from Symbol.

References fd, Symbol::name, and Funcdata::saveXml().


The documentation for this class was generated from the following files: