ROSE 0.11.145.192
|
Description of a local stack variable within a function.
Definition at line 20 of file StackVariable.h.
#include <Rose/BinaryAnalysis/Variables/StackVariable.h>
Classes | |
struct | Boundary |
Boundary between stack variables. More... | |
Public Types | |
enum class | Purpose { RETURN_ADDRESS , FRAME_POINTER , STACK_POINTER , SPILL_AREA , NORMAL , UNKNOWN , OTHER } |
Purpose of variable. More... | |
using | Boundaries = std::vector< Boundary > |
List of boundaries. | |
Public Member Functions | |
StackVariable () | |
Default constructor. | |
StackVariable (const Partitioner2::FunctionPtr &, int64_t stackOffset, rose_addr_t maxSizeBytes, Purpose, const std::vector< InstructionAccess > &definingInstructions=std::vector< InstructionAccess >(), const std::string &name="") | |
Construct a variable descriptor. | |
StackVariable (const StackVariable &) | |
const std::string & | setDefaultName () |
Give variable a defult name. | |
OffsetInterval | interval () const |
Location of variable w.r.t. | |
operator bool () const | |
Predicate to test whether variable is valid. | |
bool | operator! () const |
Predicate to test whether variable is invalid. | |
Partitioner2::FunctionPtr | function () const |
Property: Function owning the variable. | |
void | function (const Partitioner2::FunctionPtr &) |
Property: Function owning the variable. | |
int64_t | stackOffset () const |
Property: Stack offset. | |
void | stackOffset (int64_t offset) |
Property: Stack offset. | |
Purpose | purpose () const |
Property: Purpose. | |
void | purpose (Purpose p) |
Property: Purpose. | |
bool | operator== (const StackVariable &other) const |
Compare two local variables. | |
bool | operator!= (const StackVariable &other) const |
Compare two local variables. | |
void | print (std::ostream &) const |
Printing local variable. | |
std::string | toString () const |
Printing local variable. | |
Public Member Functions inherited from Rose::BinaryAnalysis::Variables::BaseVariable | |
BaseVariable (const BaseVariable &) | |
AccessFlags | accessFlags () const |
Read/write status. | |
InstructionSemantics::BaseSemantics::InputOutputPropertySet | ioProperties () const |
Property: I/O properties. | |
void | insertAccess (Address insnAddr, AccessFlags) |
Insert information about how an instruction accesses this variable. | |
rose_addr_t | maxSizeBytes () const |
Property: Maximum variable size in bytes. | |
void | maxSizeBytes (rose_addr_t size) |
Property: Maximum variable size in bytes. | |
const std::vector< InstructionAccess > & | instructionsAccessing () const |
Property: Defining instructions. | |
void | instructionsAccessing (const std::vector< InstructionAccess > &) |
Property: Defining instructions. | |
const std::string & | name () const |
Property: Optional variable name. | |
void | name (const std::string &s) |
Property: Optional variable name. | |
Static Public Member Functions | |
static void | printBoundary (std::ostream &, const Boundary &, const std::string &prefix="") |
Print information about a boundary. | |
static Boundary & | insertBoundary (Boundaries &, int64_t stackOffset, const InstructionAccess &) |
Insert a new boundary or adjust an existing boundary. | |
static Boundary & | insertBoundaryImplied (Boundaries &, int64_t stackOffset) |
Insert a new boundary or adjust an existing boundary. | |
Additional Inherited Members | |
Protected Member Functions inherited from Rose::BinaryAnalysis::Variables::BaseVariable | |
BaseVariable () | |
Default constructor. | |
BaseVariable (size_t maxSizeBytes, const std::vector< InstructionAccess > &definingInstructions, const std::string &name) | |
Construct a variable with a given maximum size. | |
using Rose::BinaryAnalysis::Variables::StackVariable::Boundaries = std::vector<Boundary> |
List of boundaries.
Definition at line 44 of file StackVariable.h.
|
strong |
Purpose of variable.
Definition at line 23 of file StackVariable.h.
Rose::BinaryAnalysis::Variables::StackVariable::StackVariable | ( | ) |
Default constructor.
Creates an invalid (zero-sized) variable descriptor.
Partitioner2::FunctionPtr Rose::BinaryAnalysis::Variables::StackVariable::function | ( | ) | const |
Property: Function owning the variable.
A default constructed object will have a null function pointer. All other objects have a valid function pointer.
void Rose::BinaryAnalysis::Variables::StackVariable::function | ( | const Partitioner2::FunctionPtr & | ) |
Property: Function owning the variable.
A default constructed object will have a null function pointer. All other objects have a valid function pointer.
int64_t Rose::BinaryAnalysis::Variables::StackVariable::stackOffset | ( | ) | const |
Property: Stack offset.
This is the address of the variable relative to the function's initial stack pointer. For multi-byte variables, this is the lowest address of the variable. Depending on the architecture, this offset might be positive or negative.
void Rose::BinaryAnalysis::Variables::StackVariable::stackOffset | ( | int64_t | offset | ) |
Property: Stack offset.
This is the address of the variable relative to the function's initial stack pointer. For multi-byte variables, this is the lowest address of the variable. Depending on the architecture, this offset might be positive or negative.
Purpose Rose::BinaryAnalysis::Variables::StackVariable::purpose | ( | ) | const |
Property: Purpose.
Areas of a stack frame serve different purposes. This property describes the purpose.
void Rose::BinaryAnalysis::Variables::StackVariable::purpose | ( | Purpose | p | ) |
Property: Purpose.
Areas of a stack frame serve different purposes. This property describes the purpose.
const std::string & Rose::BinaryAnalysis::Variables::StackVariable::setDefaultName | ( | ) |
Give variable a defult name.
This variable's name is replaced by a generated name and the name is returned.
bool Rose::BinaryAnalysis::Variables::StackVariable::operator== | ( | const StackVariable & | other | ) | const |
Compare two local variables.
Local variables are equal if and only if they belong to the same function, have the same stack offset, and have the same maximum size or both are default constructed.
bool Rose::BinaryAnalysis::Variables::StackVariable::operator!= | ( | const StackVariable & | other | ) | const |
Compare two local variables.
Local variables are equal if and only if they belong to the same function, have the same stack offset, and have the same maximum size or both are default constructed.
OffsetInterval Rose::BinaryAnalysis::Variables::StackVariable::interval | ( | ) | const |
Location of variable w.r.t.
function's stack.
Returns the concrete location of this local stack variable w.r.t. this function's initial stack pointer.
Referenced by operator bool(), and operator!().
|
static |
Insert a new boundary or adjust an existing boundary.
The boundaries are assumed to be unsorted, and if a new boundary is inserted it is inserted at the end of the list.
|
static |
Insert a new boundary or adjust an existing boundary.
The boundaries are assumed to be unsorted, and if a new boundary is inserted it is inserted at the end of the list.
|
inlineexplicit |
Predicate to test whether variable is valid.
Returns true if the variable is valid, i.e., if it has a non-zero size. Default constructed variables have a zero size.
Definition at line 150 of file StackVariable.h.
References interval(), and Sawyer::Container::Interval< T >::isEmpty().
|
inline |
Predicate to test whether variable is invalid.
Returns true if the variable is invalid, i.e., if it has a zero size.
Definition at line 157 of file StackVariable.h.
References interval(), and Sawyer::Container::Interval< T >::isEmpty().