Ghidra Decompiler Analysis Engine
Public Types | Public Member Functions | List of all members
EffectRecord Class Reference

Description of the indirect effect a sub-function has on a memory range. More...

#include <fspec.hh>

Public Types

enum  { unaffected = 1, killedbycall = 2, return_address = 3, unknown_effect = 4 }
 

Public Member Functions

 EffectRecord (const Address &addr, int4 size)
 Construct a memory range with an unknown effect. More...
 
 EffectRecord (const ParamEntry &entry, uint4 t)
 Construct an effect on a parameter storage location. More...
 
 EffectRecord (const VarnodeData &addr, uint4 t)
 Construct an effect on a memory range. More...
 
bool operator< (const EffectRecord &op2) const
 Comparator for EffectRecords. More...
 
bool operator== (const EffectRecord &op2) const
 Equality operator.
 
bool operator!= (const EffectRecord &op2) const
 Inequality operator.
 
void saveXml (ostream &s) const
 Save the record to an XML stream. More...
 
void restoreXml (uint4 grouptype, const Element *el, const AddrSpaceManager *manage)
 Restore the record from an XML stream. More...
 

Detailed Description

Description of the indirect effect a sub-function has on a memory range.

This object applies only to the specific memory range, which is seen from the point of view of the calling function as a particular sub-function gets called. The main enumeration below lists the possible effects.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
unaffected 

The sub-function does not change the value at all.

killedbycall 

The memory is changed and is completely unrelated to its original value.

return_address 

The memory is being used to pass back a return value from the sub-function.

unknown_effect 

An unknown effect (indicates the absence of an EffectRecord)

Constructor & Destructor Documentation

◆ EffectRecord() [1/3]

EffectRecord::EffectRecord ( const Address addr,
int4  size 
)

Construct a memory range with an unknown effect.

The type is set to unknown_effect

Parameters
addris the start of the memory range
sizeis the number of bytes in the memory range

◆ EffectRecord() [2/3]

EffectRecord::EffectRecord ( const ParamEntry entry,
uint4  t 
)

Construct an effect on a parameter storage location.

Parameters
entryis a model of the parameter storage
tis the effect type

◆ EffectRecord() [3/3]

EffectRecord::EffectRecord ( const VarnodeData data,
uint4  t 
)

Construct an effect on a memory range.

Parameters
datais the memory range affected
tis the effect type

Member Function Documentation

◆ operator<()

bool EffectRecord::operator< ( const EffectRecord op2) const
inline

Comparator for EffectRecords.

Sort on the memory range, then the effect type

Parameters
op2is the other record to compare with this
Returns
true if this should be ordered before the other record

◆ restoreXml()

void EffectRecord::restoreXml ( uint4  grouptype,
const Element el,
const AddrSpaceManager manage 
)

Restore the record from an XML stream.

Reads an <addr> tag to get the memory range. The effect type is inherited from the parent.

Parameters
grouptypeis the effect inherited from the parent
elis address element
manageis a manager to resolve address space references

◆ saveXml()

void EffectRecord::saveXml ( ostream &  s) const

Save the record to an XML stream.

Writes just an <addr> tag. The effect type is indicated by the parent tag.

Parameters
sis the output stream

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