ROSE
0.11.87.0
|
Collection of registers.
Since the running specimen is the machine state, RegisterState objects in this semantic domain are not copyable.
Definition at line 42 of file NativeSemantics.h.
#include <Rose/BinaryAnalysis/InstructionSemantics2/NativeSemantics.h>
Public Types | |
using | Super = BaseSemantics::RegisterState |
Base type. More... | |
using | Ptr = RegisterStatePtr |
Shared-ownership pointer. More... | |
![]() | |
using | Ptr = RegisterStatePtr |
Shared-ownership pointer for a RegisterState object. More... | |
Public Member Functions | |
virtual BaseSemantics::RegisterStatePtr | create (const BaseSemantics::SValuePtr &protoval, const RegisterDictionary *regdict) const override |
Virtual constructor. More... | |
virtual BaseSemantics::RegisterStatePtr | clone () const override |
Make a copy of this register state. More... | |
Debugger::Ptr | process () const |
Property: Subordinate process storing the registers. More... | |
virtual void | clear () override |
Removes stored values from the register state. More... | |
virtual void | zero () override |
Set all registers to the zero. More... | |
virtual bool | merge (const BaseSemantics::RegisterStatePtr &other, BaseSemantics::RiscOperators *ops) override |
Merge register states for data flow analysis. More... | |
virtual BaseSemantics::SValuePtr | readRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *ops) override |
Read a value from a register. More... | |
virtual BaseSemantics::SValuePtr | peekRegister (RegisterDescriptor, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *) override |
Read a register without side effects. More... | |
virtual void | writeRegister (RegisterDescriptor, const BaseSemantics::SValuePtr &value, BaseSemantics::RiscOperators *) override |
Write a value to a register. More... | |
virtual void | hash (Combinatorics::Hasher &, BaseSemantics::RiscOperators *) const override |
Hash the register state. More... | |
virtual void | print (std::ostream &, Formatter &) const override |
Print the register contents. More... | |
![]() | |
SValuePtr | protoval () const |
Return the protoval. More... | |
const RegisterDictionary * | get_register_dictionary () const ROSE_DEPRECATED("use registerDictionary property") |
void | set_register_dictionary (const RegisterDictionary *rd) ROSE_DEPRECATED("use registerDictionary property") |
MergerPtr | merger () const |
Property: Merger. More... | |
void | merger (const MergerPtr &m) |
Property: Merger. More... | |
const RegisterDictionary * | registerDictionary () const |
Property: Register dictionary. More... | |
void | registerDictionary (const RegisterDictionary *rd) |
Property: Register dictionary. More... | |
void | print (std::ostream &stream, const std::string prefix="") const |
Print the register contents. More... | |
WithFormatter | with_format (Formatter &fmt) |
Used for printing register states with formatting. More... | |
WithFormatter | operator+ (Formatter &fmt) |
Used for printing register states with formatting. More... | |
WithFormatter | operator+ (const std::string &linePrefix) |
Used for printing register states with formatting. More... | |
Static Public Member Functions | |
static RegisterStatePtr | instance () |
Construct a state not attached to any subordinate process. More... | |
static RegisterStatePtr | instance (const BaseSemantics::SValuePtr &protoval, const Debugger::Ptr &process) |
Construct a state attached to the specified process. More... | |
static RegisterStatePtr | promote (const BaseSemantics::RegisterStatePtr &x) |
![]() | |
static RegisterStatePtr | promote (const RegisterStatePtr &x) |
Protected Member Functions | |
RegisterState (const BaseSemantics::SValuePtr &protoval, const Debugger::Ptr &process) | |
![]() | |
RegisterState (const SValuePtr &protoval, const RegisterDictionary *regdict) | |
Additional Inherited Members | |
![]() | |
const RegisterDictionary * | regdict |
Registers that are able to be stored by this state. More... | |
using Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RegisterState::Super = BaseSemantics::RegisterState |
Base type.
Definition at line 45 of file NativeSemantics.h.
using Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RegisterState::Ptr = RegisterStatePtr |
Shared-ownership pointer.
Definition at line 48 of file NativeSemantics.h.
|
inlinestatic |
Construct a state not attached to any subordinate process.
Definition at line 69 of file NativeSemantics.h.
Referenced by Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RiscOperators::instance().
|
inlinestatic |
Construct a state attached to the specified process.
Definition at line 74 of file NativeSemantics.h.
References Rose::BinaryAnalysis::InstructionSemantics2::ConcreteSemantics::SValue::promote().
|
inlineoverridevirtual |
Virtual constructor.
The protoval
argument must be a non-null pointer to a semantic value which will be used only to create additional instances of the value via its virtual constructors. The prototypical value is normally of the same type for all parts of a semantic analysis. The register state must be compatible with the rest of the binary analysis objects in use.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 84 of file NativeSemantics.h.
|
inlineoverridevirtual |
Make a copy of this register state.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 89 of file NativeSemantics.h.
|
inline |
Property: Subordinate process storing the registers.
Definition at line 108 of file NativeSemantics.h.
|
inlineoverridevirtual |
Removes stored values from the register state.
Depending on the register state implementation, this could either store new, distinct undefined values in each register, or it could simply erase all information about stored values leaving the register state truly empty. For instance RegisterStateGeneric, which uses variable length arrays to store information about a dynamically changing set of registers, clears its arrays to zero length.
Register states can also be initialized by clearing them or by explicitly writing new values into each desired register (or both). See RegisterStateGeneric::initialize_nonoverlapping for one way to initialize that register state.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 116 of file NativeSemantics.h.
|
inlineoverridevirtual |
Set all registers to the zero.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 118 of file NativeSemantics.h.
|
inlineoverridevirtual |
Merge register states for data flow analysis.
Merges the other
state into this state, returning true if this state changed.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 122 of file NativeSemantics.h.
|
inlineoverridevirtual |
Read a value from a register.
The register descriptor, reg
, not only describes which register, but also which bits of that register (e.g., "al", "ah", "ax", "eax", and "rax" are all the same hardware register on an amd64, but refer to different parts of that register). The RISC operations are provided so that they can be used to extract the correct bits from a wider hardware register if necessary.
The dflt
value is written into the register state if the register was not defined in the state. By doing this, a subsequent read of the same register will return the same value. Some register states cannot distinguish between a register that was never accessed and a register that was only read, in which case dflt
is not used since all registers are already initialized.
See RiscOperators::readRegister for more details.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Definition at line 126 of file NativeSemantics.h.
References peekRegister().
|
overridevirtual |
Read a register without side effects.
This is similar to readRegister except it doesn't modify the register state in any way.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
Referenced by readRegister().
|
overridevirtual |
Write a value to a register.
The register descriptor, reg
, not only describes which register, but also which bits of that register (e.g., "al", "ah", "ax", "eax", and "rax" are all the same hardware register on an amd64, but refer to different parts of that register). The RISC operations are provided so that they can be used to insert the value
bits into a wider the hardware register if necessary. See RiscOperators::readRegister for more details.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
|
overridevirtual |
Hash the register state.
Hashes the register state by appending its data to the specified hasher.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.
|
overridevirtual |
Print the register contents.
This emits one line per register and contains the register name and its value.
Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RegisterState.