decompiler 1.0.0
Public Member Functions | List of all members
ParamListStandardOut Class Reference

A standard model for returning output parameters from a function. More...

#include <fspec.hh>

Inheritance diagram for ParamListStandardOut:
ParamListRegisterOut ParamListStandard ParamList

Public Member Functions

 ParamListStandardOut (void)
 Constructor for use with restoreXml()
 
 ParamListStandardOut (const ParamListStandardOut &op2)
 Copy constructor.
 
virtual uint4 getType (void) const
 Get the type of parameter list. More...
 
virtual void assignMap (const vector< Datatype * > &proto, TypeFactory &typefactory, vector< ParameterPieces > &res) const
 Given list of data-types, map the list positions to storage locations. More...
 
virtual void restoreXml (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, bool normalstack)
 Restore the model from an XML stream. More...
 
virtual ParamListclone (void) const
 Clone this parameter list model. More...
 
- Public Member Functions inherited from ParamListRegisterOut
 ParamListRegisterOut (void)
 Constructor.
 
 ParamListRegisterOut (const ParamListRegisterOut &op2)
 Copy constructor.
 
virtual uint4 getType (void) const
 Get the type of parameter list. More...
 
virtual void assignMap (const vector< Datatype * > &proto, TypeFactory &typefactory, vector< ParameterPieces > &res) const
 Given list of data-types, map the list positions to storage locations. More...
 
virtual void fillinMap (ParamActive *active) const
 Given an unordered list of storage locations, calculate a function prototype. More...
 
virtual bool possibleParam (const Address &loc, int4 size) const
 Does the given storage location make sense as a parameter. More...
 
virtual void restoreXml (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, bool normalstack)
 Restore the model from an XML stream. More...
 
virtual ParamListclone (void) const
 Clone this parameter list model. More...
 
- Public Member Functions inherited from ParamListStandard
 ParamListStandard (void)
 Construct for use with restoreXml()
 
 ParamListStandard (const ParamListStandard &op2)
 Copy constructor.
 
const list< ParamEntry > & getEntry (void) const
 Get the list of parameter entries.
 
virtual uint4 getType (void) const
 Get the type of parameter list. More...
 
virtual void assignMap (const vector< Datatype * > &proto, TypeFactory &typefactory, vector< ParameterPieces > &res) const
 Given list of data-types, map the list positions to storage locations. More...
 
virtual void fillinMap (ParamActive *active) const
 Given an unordered list of storage locations, calculate a function prototype. More...
 
virtual bool checkJoin (const Address &hiaddr, int4 hisize, const Address &loaddr, int4 losize) const
 Check if the given two storage locations can represent a single logical parameter. More...
 
virtual bool checkSplit (const Address &loc, int4 size, int4 splitpoint) const
 Check if it makes sense to split a single storage location into two parameters. More...
 
virtual int4 characterizeAsParam (const Address &loc, int4 size) const
 Characterize whether the given range overlaps parameter storage. More...
 
virtual bool possibleParam (const Address &loc, int4 size) const
 Does the given storage location make sense as a parameter. More...
 
virtual bool possibleParamWithSlot (const Address &loc, int4 size, int4 &slot, int4 &slotsize) const
 Pass-back the slot and slot size for the given storage location as a parameter. More...
 
virtual bool getBiggestContainedParam (const Address &loc, int4 size, VarnodeData &res) const
 Pass-back the biggest parameter contained within the given range. More...
 
virtual bool unjustifiedContainer (const Address &loc, int4 size, VarnodeData &res) const
 Check if the given storage location looks like an unjustified parameter. More...
 
virtual OpCode assumedExtension (const Address &addr, int4 size, VarnodeData &res) const
 Get the type of extension and containing parameter for the given storage. More...
 
virtual AddrSpacegetSpacebase (void) const
 Get the address space associated with any stack based parameters in this list. More...
 
virtual void getRangeList (AddrSpace *spc, RangeList &res) const
 For a given address space, collect all the parameter locations within that space. More...
 
virtual int4 getMaxDelay (void) const
 Return the maximum heritage delay across all possible parameters. More...
 
virtual void restoreXml (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, bool normalstack)
 Restore the model from an XML stream. More...
 
virtual ParamListclone (void) const
 Clone this parameter list model. More...
 
- Public Member Functions inherited from ParamList
virtual ~ParamList (void)
 Destructor.
 
virtual uint4 getType (void) const =0
 Get the type of parameter list. More...
 
virtual void assignMap (const vector< Datatype * > &proto, TypeFactory &typefactory, vector< ParameterPieces > &res) const =0
 Given list of data-types, map the list positions to storage locations. More...
 
virtual void fillinMap (ParamActive *active) const =0
 Given an unordered list of storage locations, calculate a function prototype. More...
 
virtual bool checkJoin (const Address &hiaddr, int4 hisize, const Address &loaddr, int4 losize) const =0
 Check if the given two storage locations can represent a single logical parameter. More...
 
virtual bool checkSplit (const Address &loc, int4 size, int4 splitpoint) const =0
 Check if it makes sense to split a single storage location into two parameters. More...
 
virtual int4 characterizeAsParam (const Address &loc, int4 size) const =0
 Characterize whether the given range overlaps parameter storage. More...
 
virtual bool possibleParam (const Address &loc, int4 size) const =0
 Does the given storage location make sense as a parameter. More...
 
virtual bool possibleParamWithSlot (const Address &loc, int4 size, int4 &slot, int4 &slotsize) const =0
 Pass-back the slot and slot size for the given storage location as a parameter. More...
 
virtual bool getBiggestContainedParam (const Address &loc, int4 size, VarnodeData &res) const =0
 Pass-back the biggest parameter contained within the given range. More...
 
virtual bool unjustifiedContainer (const Address &loc, int4 size, VarnodeData &res) const =0
 Check if the given storage location looks like an unjustified parameter. More...
 
virtual OpCode assumedExtension (const Address &addr, int4 size, VarnodeData &res) const =0
 Get the type of extension and containing parameter for the given storage. More...
 
virtual AddrSpacegetSpacebase (void) const =0
 Get the address space associated with any stack based parameters in this list. More...
 
virtual void getRangeList (AddrSpace *spc, RangeList &res) const =0
 For a given address space, collect all the parameter locations within that space. More...
 
virtual int4 getMaxDelay (void) const =0
 Return the maximum heritage delay across all possible parameters. More...
 
virtual void restoreXml (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, bool normalstack)=0
 Restore the model from an XML stream. More...
 
virtual ParamListclone (void) const =0
 Clone this parameter list model. More...
 

Additional Inherited Members

- Public Types inherited from ParamList
enum  {
  p_standard , p_standard_out , p_register , p_register_out ,
  p_merged
}
 
- Protected Member Functions inherited from ParamListStandard
const ParamEntryfindEntry (const Address &loc, int4 size) const
 Given storage location find matching ParamEntry. More...
 
Address assignAddress (const Datatype *tp, vector< int4 > &status) const
 Assign storage for given parameter data-type. More...
 
void buildTrialMap (ParamActive *active) const
 Build map from parameter trials to model ParamEntrys. More...
 
void separateSections (ParamActive *active, int4 &oneStart, int4 &oneStop, int4 &twoStart, int4 &twoStop) const
 Calculate the range of trials in each of the two resource sections. More...
 
void forceExclusionGroup (ParamActive *active) const
 Enforce exclusion rules for the given set of parameter trials. More...
 
void forceNoUse (ParamActive *active, int4 start, int4 stop) const
 Mark every trial above the first "definitely not used" as inactive. More...
 
void forceInactiveChain (ParamActive *active, int4 maxchain, int4 start, int4 stop, int4 groupstart) const
 Enforce rules about chains of inactive slots. More...
 
void calcDelay (void)
 Calculate the maximum heritage delay for any potential parameter in this list.
 
void populateResolver (void)
 Build the ParamEntry resolver maps. More...
 
void parsePentry (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, int4 groupid, bool normalstack, bool autokill, bool splitFloat, bool grouped)
 Read a <pentry> tag and add it to this list. More...
 
void parseGroup (const Element *el, const AddrSpaceManager *manage, vector< EffectRecord > &effectlist, int4 groupid, bool normalstack, bool autokill, bool splitFloat)
 Read a group of <pentry> tags that are allocated as a group. More...
 
- Protected Attributes inherited from ParamListStandard
int4 numgroup
 Number of groups in this parameter convention.
 
int4 maxdelay
 Maximum heritage delay across all parameters.
 
int4 pointermax
 If non-zero, maximum size of a data-type before converting to a pointer.
 
bool thisbeforeret
 Does a this parameter come before a hidden return parameter.
 
int4 resourceTwoStart
 If there are two resource sections, the group of the first entry in the second section.
 
list< ParamEntryentry
 The ordered list of parameter entries.
 
vector< ParamEntryResolver * > resolverMap
 Map from space id to resolver.
 
AddrSpacespacebase
 Address space containing relative offset parameters.
 

Detailed Description

A standard model for returning output parameters from a function.

This has a more involved assignment strategy than its parent class. Entries in the resource list are treated as a group, meaning that only one can fit the desired storage size and type attributes of the return value. If no entry fits, the return value is converted to a pointer data-type, storage allocation is attempted again, and the return value is marked as a hidden return parameter to inform the input model.

Member Function Documentation

◆ assignMap()

void ParamListStandardOut::assignMap ( const vector< Datatype * > &  proto,
TypeFactory typefactory,
vector< ParameterPieces > &  res 
) const
virtual

Given list of data-types, map the list positions to storage locations.

If we know the function prototype, recover how parameters are actually stored using the model.

Parameters
protois the ordered list of data-types
typefactoryis the TypeFactory (for constructing pointers)
reswill contain the storage locations corresponding to the datatypes

Reimplemented from ParamListRegisterOut.

References ParamListStandard::assignAddress(), Datatype::flags, AddrSpace::getAddrSize(), TypeFactory::getArch(), AddrSpaceManager::getDefaultDataSpace(), TypeFactory::getTypePointer(), AddrSpace::getWordSize(), ParameterPieces::hiddenretparm, ParameterPieces::indirectstorage, ParamListStandard::numgroup, ParamListStandard::spacebase, and TYPE_VOID.

◆ clone()

ParamList * ParamListStandardOut::clone ( void  ) const
virtual

Clone this parameter list model.

Reimplemented from ParamListRegisterOut.

References ParamListStandardOut().

◆ getType()

virtual uint4 ParamListStandardOut::getType ( void  ) const
inlinevirtual

Get the type of parameter list.

Reimplemented from ParamListRegisterOut.

References ParamList::p_standard_out.

◆ restoreXml()

void ParamListStandardOut::restoreXml ( const Element el,
const AddrSpaceManager manage,
vector< EffectRecord > &  effectlist,
bool  normalstack 
)
virtual

Restore the model from an XML stream.

Parameters
elis the root <input> or <output> element
manageis used to resolve references to address spaces
effectlistis a container collecting EffectRecords across all parameters
normalstackis true if parameters are pushed on the stack in the normal order

Reimplemented from ParamListRegisterOut.

References ParamListStandard::entry, ParamEntry::orderWithinGroup(), and ParamListRegisterOut::restoreXml().


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