ROSE
0.11.90.0
|
Abstract parameter location.
This class is used to describe the location of a parameter or return value location in a calling convention definition outside any analysis (locations resulting from an analysis often contain more information). The location can be a register, a memory location at a constant address (e.g., global variable), or a memory location relative to some register (e.g., on a stack). Location descriptors are immutable.
The same type is used for input parameters, output parameters, and in-out parameters. Return values are a kind of output parameter, although the API usually does not include the return value when it talks about "parameters".
Definition at line 86 of file CallingConvention.h.
#include <Rose/BinaryAnalysis/CallingConvention.h>
Public Types | |
enum | Type { NO_LOCATION, REGISTER, STACK, ABSOLUTE } |
Type of location. More... | |
Public Member Functions | |
ParameterLocation () | |
Default constructed no-location. More... | |
ParameterLocation (RegisterDescriptor reg) | |
Constructs a parameter in a register location. More... | |
ParameterLocation (RegisterDescriptor reg, int64_t offset) | |
Constructs a parameter at a register-relative memory address. More... | |
ParameterLocation (rose_addr_t va) | |
Constructs a parameter at a fixed memory address. More... | |
Type | type () const |
Type of parameter location. More... | |
bool | isValid () const |
Predicate to determine if location is valid. More... | |
RegisterDescriptor | reg () const |
Register part of location. More... | |
int64_t | offset () const |
Offset part of location. More... | |
rose_addr_t | address () const |
Fixed address location. More... | |
bool | operator== (const ParameterLocation &other) const |
Equality. More... | |
bool | operator!= (const ParameterLocation &other) const |
Inequality. More... | |
std::string | toString (const RegisterDictionary *regdict) const |
String representation. More... | |
void | print (std::ostream &out, const RegisterDictionary *regdict) const |
Print location. | |
void | print (std::ostream &out, const RegisterNames ®names) const |
Print location. | |
Type of location.
Definition at line 89 of file CallingConvention.h.
|
inline |
Default constructed no-location.
This default constructor is useful for indicating no location or for using an STL container, such as std::vector
, that requires a default constructor. The isValid predicate will return false for default-constructed locations.
Definition at line 126 of file CallingConvention.h.
|
inlineexplicit |
Constructs a parameter in a register location.
Definition at line 130 of file CallingConvention.h.
|
inline |
Constructs a parameter at a register-relative memory address.
Definition at line 134 of file CallingConvention.h.
|
inlineexplicit |
Constructs a parameter at a fixed memory address.
Definition at line 138 of file CallingConvention.h.
|
inline |
Type of parameter location.
Definition at line 142 of file CallingConvention.h.
Referenced by isValid().
|
inline |
Predicate to determine if location is valid.
Returns false for default-constructed locations, true for all others.
Definition at line 147 of file CallingConvention.h.
References NO_LOCATION, and type().
|
inline |
Register part of location.
Returns the register where the parameter is stored (for register parameters) or the register holding the base address for register-relative memory parameters. Returns an invalid (default constructed) register descriptor when invoked on a default constructed location or a fixed memory addresses.
Definition at line 156 of file CallingConvention.h.
|
inline |
Offset part of location.
Returns the signed byte offset from the base register for register-relative memory parameters. The memory address of the parameter is the contents of the base register plus this byte offset. Returns zero for register parameters, parameters stored at fixed memory addresses, and default constructed locations.
Definition at line 165 of file CallingConvention.h.
References STACK.
|
inline |
Fixed address location.
Returns the address for a parameter stored at a fixed memory address. Returns zero for register parameters, register-relative (stack) parameters, and default constructed locations.
Definition at line 173 of file CallingConvention.h.
References ABSOLUTE.
|
inline |
Equality.
Two locations are equal if they are the same type and register, offset, and/or address as appropriate to the type.
Definition at line 180 of file CallingConvention.h.
|
inline |
Inequality.
Two locations are unequal if they have different types, registers, offsets, or addresses.
Definition at line 187 of file CallingConvention.h.
|
inline |