ROSE 0.11.145.147
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State Class Reference

Description

Represents the entire state of the machine.

This state expects to use a subclass of BaseSemantics::MemoryCellList as its memory state, and does not expect that MemoryCellList to be byte-restricted.

Definition at line 194 of file PartialSymbolicSemantics.h.

#include <Rose/BinaryAnalysis/InstructionSemantics/PartialSymbolicSemantics.h>

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State:
Collaboration graph
[legend]

Public Types

using Super = BaseSemantics::State
 Base type.
 
using Ptr = StatePtr
 Shared-ownership pointer.
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
using Ptr = StatePtr
 Shared-ownership pointer.
 

Public Member Functions

virtual BaseSemantics::StatePtr create (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory) const override
 Virtual constructor.
 
virtual BaseSemantics::StatePtr clone () const override
 Virtual copy constructor.
 
virtual void print_diff_registers (std::ostream &, const StatePtr &other_state, Formatter &) const
 Print info about how registers differ.
 
virtual bool equal_registers (const StatePtr &other) const
 Tests registers of two states for equality.
 
virtual void discard_popped_memory ()
 Removes from memory those values at addresses below the current stack pointer.
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
SValuePtr protoval () const
 Return the protoval.
 
virtual void clear ()
 Initialize state.
 
void zeroRegisters ()
 Initialize all registers to zero.
 
void clearMemory ()
 Clear all memory locations.
 
RegisterStatePtr registerState () const
 Property: Register state.
 
MemoryStatePtr memoryState () const
 Property: Memory state.
 
bool hasInterruptState () const
 Tests whether an interrupt state is present.
 
virtual SValuePtr readRegister (RegisterDescriptor desc, const SValuePtr &dflt, RiscOperators *ops)
 Read a value from a register.
 
virtual SValuePtr peekRegister (RegisterDescriptor desc, const SValuePtr &dflt, RiscOperators *ops)
 Read register without side effects.
 
virtual void writeRegister (RegisterDescriptor desc, const SValuePtr &value, RiscOperators *ops)
 Write a value to a register.
 
virtual SValuePtr readMemory (const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps)
 Read a value from memory.
 
virtual SValuePtr peekMemory (const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps)
 Read from memory without side effects.
 
virtual void writeMemory (const SValuePtr &addr, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps)
 Write a value to memory.
 
virtual SValuePtr readInterrupt (unsigned major, unsigned minor, const SValuePtr &dflt, RiscOperators *valOps)
 Read an interrupt state.
 
virtual SValuePtr peekInterrupt (unsigned major, unsigned minor, const SValuePtr &dflt, RiscOperators *valOps)
 Read an interrupt state without side effects.
 
virtual bool writeInterrupt (unsigned major, unsigned minor, const SValuePtr &value, RiscOperators *valOps)
 Write an interrupt state.
 
SValuePtr raiseInterrupt (unsigned major, unsigned minor, RiscOperators *valOps)
 Raise an interrupt.
 
SValuePtr clearInterrupt (unsigned major, unsigned minor, RiscOperators *valOps)
 Clear an interrupt.
 
bool isInterruptDefinitelyRaised (unsigned major, unsigned minor, RiscOperators *valOps)
 Test an interrupt.
 
bool isInterruptDefinitelyClear (unsigned major, unsigned minor, RiscOperators *valOps)
 Test an interrupt.
 
virtual void hash (Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const
 Compute a hash of the state.
 
std::string toString () const
 Convert the state to a string for debugging.
 
virtual bool merge (const StatePtr &other, RiscOperators *ops)
 Merge operation for data flow analysis.
 
RegisterStatePtr interruptState () const
 Property: Interrupt state.
 
void interruptState (const RegisterStatePtr &)
 Property: Interrupt state.
 
void printRegisters (std::ostream &stream, const std::string &prefix="")
 Print the register contents.
 
virtual void printRegisters (std::ostream &stream, Formatter &fmt) const
 Print the register contents.
 
void printMemory (std::ostream &stream, const std::string &prefix="") const
 Print memory contents.
 
virtual void printMemory (std::ostream &stream, Formatter &fmt) const
 Print memory contents.
 
void printInterrupts (std::ostream &, const std::string &prefix="")
 Print interrupt states.
 
virtual void printInterrupts (std::ostream &stream, Formatter &fmt) const
 Print interrupt states.
 
void print (std::ostream &stream, const std::string &prefix="") const
 Print the state.
 
virtual void print (std::ostream &, Formatter &) const
 Print the state.
 
WithFormatter with_format (Formatter &fmt)
 Used for printing states with formatting.
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing states with formatting.
 
WithFormatter operator+ (const std::string &linePrefix)
 Used for printing states with formatting.
 

Static Public Member Functions

static StatePtr instance (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory)
 Instantiates a new instance of memory state with specified register and memory states.
 
static StatePtr instance (const StatePtr &other)
 Instantiates a new copy of an existing state.
 
static StatePtr promote (const BaseSemantics::StatePtr &)
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
static StatePtr instance (const RegisterStatePtr &registers, const MemoryStatePtr &memory, const RegisterStatePtr &interrupts)
 Instantiate a new state object with specified register, memory, and interrupt states.
 
static StatePtr instance (const RegisterStatePtr &registers, const MemoryStatePtr &memory)
 Instantiate a new state object with specified register and memory states.
 
static StatePtr instance (const StatePtr &other)
 Instantiate a new copy of an existing state.
 
static StatePtr promote (const StatePtr &)
 

Protected Member Functions

 State (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory)
 
 State (const State &other)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
 State (const RegisterStatePtr &registers, const MemoryStatePtr &memory, const RegisterStatePtr &interrupts)
 
 State (const RegisterStatePtr &registers, const MemoryStatePtr &memory)
 
 State (const State &other)
 

Member Typedef Documentation

◆ Super

Base type.

Definition at line 197 of file PartialSymbolicSemantics.h.

◆ Ptr

Shared-ownership pointer.

Definition at line 200 of file PartialSymbolicSemantics.h.

Member Function Documentation

◆ create()

virtual BaseSemantics::StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::create ( const BaseSemantics::RegisterStatePtr registers,
const BaseSemantics::MemoryStatePtr memory 
) const
overridevirtual

Virtual constructor.

The interruptState property will always be null.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State.

◆ clone()

virtual BaseSemantics::StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::clone ( ) const
overridevirtual

Virtual copy constructor.

Allocates a new state object which is a deep copy of this state. States must be copyable objects because many analyses depend on being able to make a copy of the entire semantic state at each machine instruction, at each CFG vertex, etc.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State.

◆ print_diff_registers()

virtual void Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::print_diff_registers ( std::ostream &  ,
const StatePtr other_state,
Formatter  
) const
virtual

Print info about how registers differ.

If a RenameMap is specified then named values will be renamed to have a shorter name.

◆ discard_popped_memory()

virtual void Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::discard_popped_memory ( )
virtual

Removes from memory those values at addresses below the current stack pointer.

This is automatically called after each instruction if the policy's p_discard_popped_memory property is set.


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