ROSE  0.10.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators Class Reference

Description

Wraps RISC operators so they can be traced.

Definition at line 93 of file TraceSemantics2.h.

#include <TraceSemantics2.h>

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators:
Collaboration graph
[legend]

Public Member Functions

virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::RiscOperatorsPtr &subdomain)
 Wraps a subdomain's RISC operators to add tracing. More...
 
virtual BaseSemantics::SValuePtr protoval () const ROSE_OVERRIDE
 Property: Prototypical semantic value. More...
 
virtual void solver (const SmtSolverPtr &) ROSE_OVERRIDE
 Property: Satisfiability module theory (SMT) solver. More...
 
virtual SmtSolverPtr solver () const ROSE_OVERRIDE
 Property: Satisfiability module theory (SMT) solver. More...
 
virtual BaseSemantics::StatePtr currentState () const ROSE_OVERRIDE
 Property: Current semantic state. More...
 
virtual void currentState (const BaseSemantics::StatePtr &) ROSE_OVERRIDE
 Property: Current semantic state. More...
 
virtual void print (std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
 Print multi-line output for this object.
 
virtual size_t nInsns () const ROSE_OVERRIDE
 
virtual void nInsns (size_t n) ROSE_OVERRIDE
 
virtual SgAsmInstructioncurrentInstruction () const ROSE_OVERRIDE
 
virtual void startInstruction (SgAsmInstruction *) ROSE_OVERRIDE
 
virtual void finishInstruction (SgAsmInstruction *) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr undefined_ (size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr unspecified_ (size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr number_ (size_t nbits, uint64_t value) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr boolean_ (bool value) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr bottom_ (size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr filterCallTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr filterReturnTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr filterIndirectJumpTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual void hlt () ROSE_OVERRIDE
 
virtual void cpuid () ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr rdtsc () ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr and_ (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr or_ (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr xor_ (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr invert (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr extract (const BaseSemantics::SValuePtr &, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr concat (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr leastSignificantSetBit (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr mostSignificantSetBit (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr rotateLeft (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr rotateRight (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftLeft (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftRight (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftRightArithmetic (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr equalToZero (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr ite (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr unsignedExtend (const BaseSemantics::SValuePtr &, size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr signExtend (const BaseSemantics::SValuePtr &, size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr add (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr addWithCarries (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Used for printing RISC operators with formatting. More...
 
virtual BaseSemantics::SValuePtr negate (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Two's complement. More...
 
virtual BaseSemantics::SValuePtr signedDivide (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Divides two signed values. More...
 
virtual BaseSemantics::SValuePtr signedModulo (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Calculates modulo with signed values. More...
 
virtual BaseSemantics::SValuePtr signedMultiply (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Multiplies two signed values. More...
 
virtual BaseSemantics::SValuePtr unsignedDivide (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Divides two unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedModulo (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Calculates modulo with unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedMultiply (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Multiply two unsigned values. More...
 
virtual void interrupt (int majr, int minr) ROSE_OVERRIDE
 Invoked for instructions that cause an interrupt. More...
 
virtual BaseSemantics::SValuePtr fpFromInteger (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Construct a floating-point value from an integer value. More...
 
virtual BaseSemantics::SValuePtr fpToInteger (const BaseSemantics::SValuePtr &, SgAsmFloatType *, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Construct an integer value from a floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpConvert (const BaseSemantics::SValuePtr &, SgAsmFloatType *, SgAsmFloatType *) ROSE_OVERRIDE
 Convert from one floating-point type to another. More...
 
virtual BaseSemantics::SValuePtr fpIsNan (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is a special not-a-number bit pattern. More...
 
virtual BaseSemantics::SValuePtr fpIsDenormalized (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is denormalized. More...
 
virtual BaseSemantics::SValuePtr fpIsZero (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is equal to zero. More...
 
virtual BaseSemantics::SValuePtr fpIsInfinity (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is infinity. More...
 
virtual BaseSemantics::SValuePtr fpSign (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Sign of floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpEffectiveExponent (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Exponent of floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpAdd (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Add two floating-point values. More...
 
virtual BaseSemantics::SValuePtr fpSubtract (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Subtract one floating-point value from another. More...
 
virtual BaseSemantics::SValuePtr fpMultiply (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Multiply two floating-point values. More...
 
virtual BaseSemantics::SValuePtr fpDivide (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Divide one floating-point value by another. More...
 
virtual BaseSemantics::SValuePtr fpSquareRoot (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Square root. More...
 
virtual BaseSemantics::SValuePtr fpRoundTowardZero (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Round toward zero. More...
 
virtual BaseSemantics::SValuePtr readRegister (RegisterDescriptor, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Reads a value from a register. More...
 
virtual BaseSemantics::SValuePtr peekRegister (RegisterDescriptor, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Obtain a register value without side effects. More...
 
virtual void writeRegister (RegisterDescriptor, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Writes a value to a register. More...
 
virtual BaseSemantics::SValuePtr readMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
 Reads a value from memory. More...
 
virtual BaseSemantics::SValuePtr peekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Read memory without side effects. More...
 
virtual void writeMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
 Writes a value to memory. More...
 
const BaseSemantics::RiscOperatorsPtrsubdomain () const
 Property: Subdomain to which operations are forwarded.
 
void subdomain (const BaseSemantics::RiscOperatorsPtr &subdomain)
 Property: Subdomain to which operations are forwarded.
 
void checkSubdomain () const
 Check that we have a valid subdomain. More...
 
Sawyer::Message::Streamstream ()
 Property: output stream to which tracing is emitted. More...
 
void stream (Sawyer::Message::Stream &s)
 Property: output stream to which tracing is emitted. More...
 
const std::string & indentation () const
 Property: Line prefix string. More...
 
void indentation (const std::string &s)
 Property: Line prefix string. More...
 
bool showingSubdomain () const
 Property: Show subdomain name in output. More...
 
void showingSubdomain (bool b)
 Property: Show subdomain name in output. More...
 
bool showingInstructionVa () const
 Property: Show instruction in output. More...
 
void showingInstructionVa (bool b)
 Property: Show instruction in output. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
virtual SValuePtr reinterpret (const SValuePtr &a, SgAsmType *retType)
 Reinterpret an expression as a different type. More...
 
virtual SValuePtr convert (const SValuePtr &a, SgAsmType *srcType, SgAsmType *dstType)
 Convert value from one type to another. More...
 
const HotPatchhotPatch () const
 Property: Post-instruction hot patches. More...
 
HotPatchhotPatch ()
 Property: Post-instruction hot patches. More...
 
void hotPatch (const HotPatch &hp)
 Property: Post-instruction hot patches. More...
 
virtual StatePtr initialState () const
 Property: Optional lazily updated initial state. More...
 
virtual void initialState (const StatePtr &s)
 Property: Optional lazily updated initial state. More...
 
virtual const std::string & name () const
 Property: Name used for debugging. More...
 
virtual void name (const std::string &s)
 Property: Name used for debugging. More...
 
void print (std::ostream &stream, const std::string prefix="") const
 Print multi-line output for this object.
 
virtual SValuePtr readRegister (RegisterDescriptor reg)
 Reads a value from a register. More...
 
SValuePtr peekRegister (RegisterDescriptor reg)
 Obtain a register value without side effects. More...
 

Static Public Member Functions

static RiscOperatorsPtr instance (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object. More...
 
static RiscOperatorsPtr instance (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object. More...
 
static RiscOperatorsPtr instance (const BaseSemantics::RiscOperatorsPtr &subdomain)
 Instantiate a new RiscOperators object. More...
 
static RiscOperatorsPtr promote (const BaseSemantics::RiscOperatorsPtr &x)
 Run-time promotion of a base RiscOperators pointer to trace operators. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
static RiscOperatorsPtr promote (const RiscOperatorsPtr &x)
 

Protected Member Functions

 RiscOperators (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const BaseSemantics::RiscOperatorsPtr &subdomain)
 
void linePrefix ()
 
std::string toString (const BaseSemantics::SValuePtr &)
 
std::string toString (SgAsmFloatType *)
 
void check_equal_widths (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
const BaseSemantics::SValuePtrcheck_width (const BaseSemantics::SValuePtr &a, size_t nbits, const std::string &what="result")
 
std::string register_name (RegisterDescriptor)
 
void before (const std::string &)
 
void before (const std::string &, RegisterDescriptor)
 
void before (const std::string &, RegisterDescriptor, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, RegisterDescriptor, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, RegisterDescriptor, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, size_t)
 
void before (const std::string &, RegisterDescriptor, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, SgAsmInstruction *, bool showAddress)
 
void before (const std::string &, size_t)
 
void before (const std::string &, size_t, uint64_t)
 
void before (const std::string &, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, size_t)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, size_t, size_t)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, SgAsmFloatType *)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, SgAsmFloatType *, const BaseSemantics::SValuePtr &)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, SgAsmFloatType *, SgAsmFloatType *)
 
void before (const std::string &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *)
 
void after ()
 
const BaseSemantics::SValuePtrafter (const BaseSemantics::SValuePtr &)
 
const BaseSemantics::SValuePtrafter (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &)
 
void after (const BaseSemantics::Exception &)
 
void after_exception ()
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
 RiscOperators (const SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 

Additional Inherited Members

- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
typedef RiscOperatorsPtr Ptr
 Shared-ownership pointer for a RiscOperators object. More...
 

Member Function Documentation

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::instance ( const BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
)
inlinestatic

Instantiates a new RiscOperators object.

This domain does not create any of its own values–it only wraps another domains RISC operators. Therefore, the supplied protoval and solver are not actually used. It is probably better to construct the TraceSemantics' RISC operators with the constructor that takes the subdomain's RISC operators.

Definition at line 136 of file TraceSemantics2.h.

References solver().

Referenced by create().

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::instance ( const BaseSemantics::StatePtr state,
const SmtSolverPtr solver = SmtSolverPtr() 
)
inlinestatic

Instantiates a new RiscOperators object.

This domain does not manage any state–it only wraps another domains RISC operators. Therefore, the supplied protoval and solver are not actually used. It is probably better to construct the TraceSemantics' RISC operators with the constructor that takes the subdomain's RISC operators.

Definition at line 143 of file TraceSemantics2.h.

References solver().

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::instance ( const BaseSemantics::RiscOperatorsPtr subdomain)
inlinestatic

Instantiate a new RiscOperators object.

The subdomain argument should be the RISC operators that we want to trace.

Definition at line 149 of file TraceSemantics2.h.

References subdomain().

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::create ( const BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
inlinevirtual

Virtual allocating constructor.

The protoval is a prototypical semantic value that is used as a factory to create additional values as necessary via its virtual constructors. The state upon which the RISC operations operate must be set by modifying the currentState property. An optional SMT solver may be specified (see solver).

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Definition at line 161 of file TraceSemantics2.h.

References instance(), and solver().

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::create ( const BaseSemantics::StatePtr state,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
inlinevirtual

Virtual allocating constructor.

The supplied state is that upon which the RISC operations operate and is also used to define the prototypical semantic value. Other states can be supplied by setting currentState. The prototypical semantic value is used as a factory to create additional values as necessary via its virtual constructors. An optional SMT solver may be specified (see solver).

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Definition at line 166 of file TraceSemantics2.h.

References instance(), and solver().

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::create ( const BaseSemantics::RiscOperatorsPtr subdomain)
inlinevirtual

Wraps a subdomain's RISC operators to add tracing.

Definition at line 172 of file TraceSemantics2.h.

References instance().

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::promote ( const BaseSemantics::RiscOperatorsPtr x)
inlinestatic

Run-time promotion of a base RiscOperators pointer to trace operators.

This is a checked conversion–it will fail if from does not point to a TraceSemantics::RiscOperators object.

Definition at line 181 of file TraceSemantics2.h.

void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::checkSubdomain ( ) const
inline

Check that we have a valid subdomain.

If the subdomain isn't value (hasn't been set) then throw an exception.

Definition at line 200 of file TraceSemantics2.h.

Sawyer::Message::Stream& Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::stream ( )
inline

Property: output stream to which tracing is emitted.

The default is the INFO stream of the Rose::BinaryAnalysis::InstructionSemantics2 message facility. Output will only show up when this stream is enabled.

Definition at line 210 of file TraceSemantics2.h.

void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::stream ( Sawyer::Message::Stream s)
inline

Property: output stream to which tracing is emitted.

The default is the INFO stream of the Rose::BinaryAnalysis::InstructionSemantics2 message facility. Output will only show up when this stream is enabled.

Definition at line 211 of file TraceSemantics2.h.

const std::string& Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::indentation ( ) const
inline

Property: Line prefix string.

This string will be printed at the start of each line of output. It's usually used for indentation.

Definition at line 219 of file TraceSemantics2.h.

void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::indentation ( const std::string &  s)
inline

Property: Line prefix string.

This string will be printed at the start of each line of output. It's usually used for indentation.

Definition at line 220 of file TraceSemantics2.h.

bool Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::showingSubdomain ( ) const
inline

Property: Show subdomain name in output.

If true, then the subdomain name and object address is printed for each line of output.

Definition at line 228 of file TraceSemantics2.h.

void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::showingSubdomain ( bool  b)
inline

Property: Show subdomain name in output.

If true, then the subdomain name and object address is printed for each line of output.

Definition at line 229 of file TraceSemantics2.h.

bool Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::showingInstructionVa ( ) const
inline

Property: Show instruction in output.

If true, then each line of output will contain the instruction virtual address.

Definition at line 237 of file TraceSemantics2.h.

void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::showingInstructionVa ( bool  b)
inline

Property: Show instruction in output.

If true, then each line of output will contain the instruction virtual address.

Definition at line 238 of file TraceSemantics2.h.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::protoval ( ) const
virtual

Property: Prototypical semantic value.

The protoval is used to construct other values via its virtual constructors.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::solver ( const SmtSolverPtr s)
virtual

Property: Satisfiability module theory (SMT) solver.

This property holds a pointer to the satisfiability modulo theory (SMT) solver to use for certain operations. An SMT solver is optional and not all semantic domains will make use of a solver. Domains that use a solver will fall back to naive implementations when a solver is not available (for instance, equality of two values might be checked by looking at whether the values are identical).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual SmtSolverPtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::solver ( ) const
virtual

Property: Satisfiability module theory (SMT) solver.

This property holds a pointer to the satisfiability modulo theory (SMT) solver to use for certain operations. An SMT solver is optional and not all semantic domains will make use of a solver. Domains that use a solver will fall back to naive implementations when a solver is not available (for instance, equality of two values might be checked by looking at whether the values are identical).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Referenced by create(), and instance().

virtual BaseSemantics::StatePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::currentState ( ) const
virtual

Property: Current semantic state.

This is the state upon which the RISC operations operate. The state need not be set until the first instruction is executed (and even then, some RISC operations don't need any machine state; typically, only register and memory read and write operators need state). Different state objects can be swapped in at pretty much any time. Modifying the state has no effect on this object's prototypical value which was initialized by the constructor; new states should have a prototyipcal value of the same dynamic type.

See also, initialState.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::currentState ( const BaseSemantics::StatePtr s)
virtual

Property: Current semantic state.

This is the state upon which the RISC operations operate. The state need not be set until the first instruction is executed (and even then, some RISC operations don't need any machine state; typically, only register and memory read and write operators need state). Different state objects can be swapped in at pretty much any time. Modifying the state has no effect on this object's prototypical value which was initialized by the constructor; new states should have a prototyipcal value of the same dynamic type.

See also, initialState.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::addWithCarries ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
const BaseSemantics::SValuePtr c,
BaseSemantics::SValuePtr carry_out 
)
virtual

Used for printing RISC operators with formatting.

The usual way to use this is:

RiscOperatorsPtr obj = ...;
Formatter fmt = ...;
std::cout <<"The value is: " <<(*obj+fmt) <<"\n";

Since specifying a line prefix string for indentation purposes is such a common use case, the indentation can be given instead of a format, as in the following code that indents the prefixes each line of the expression with four spaces.

std::cout <<"Machine state:\n" <<*(obj + " ");
@code
@{ */
WithFormatter with_format(Formatter &fmt) { return WithFormatter(shared_from_this(), fmt); }
WithFormatter operator+(Formatter &fmt) { return with_format(fmt); }
WithFormatter operator+(const std::string &linePrefix);
virtual size_t nInsns() const { return nInsns_; }
virtual void nInsns(size_t n) { nInsns_ = n; }
virtual SgAsmInstruction* currentInstruction() const {
return currentInsn_;
}
virtual void startInstruction(SgAsmInstruction *insn);
virtual void finishInstruction(SgAsmInstruction *insn);
// Value Construction Operations
// The trailing underscores are necessary for for undefined_() on some machines, so we just add one to the end of all the
// virtual constructors for consistency.
virtual SValuePtr undefined_(size_t nbits);
virtual SValuePtr unspecified_(size_t nbits);
virtual SValuePtr number_(size_t nbits, uint64_t value);
virtual SValuePtr boolean_(bool value);
virtual SValuePtr bottom_(size_t nbits);
// x86-specific Operations (FIXME)
virtual SValuePtr filterCallTarget(const SValuePtr &a);
virtual SValuePtr filterReturnTarget(const SValuePtr &a);
virtual SValuePtr filterIndirectJumpTarget(const SValuePtr &a);
virtual void hlt() {}
virtual void cpuid() {}
virtual SValuePtr rdtsc() { return unspecified_(64); }
// Boolean Operations
virtual SValuePtr and_(const SValuePtr &a, const SValuePtr &b) = 0;
virtual SValuePtr or_(const SValuePtr &a, const SValuePtr &b) = 0;
virtual SValuePtr xor_(const SValuePtr &a, const SValuePtr &b) = 0;
virtual SValuePtr invert(const SValuePtr &a) = 0;
virtual SValuePtr extract(const SValuePtr &a, size_t begin_bit, size_t end_bit) = 0;
virtual SValuePtr concat(const SValuePtr &lowBits, const SValuePtr &highBits) = 0;
virtual std::pair<SValuePtr /*low*/, SValuePtr /*high*/> split(const SValuePtr &a, size_t splitPoint);
virtual SValuePtr leastSignificantSetBit(const SValuePtr &a) = 0;
virtual SValuePtr mostSignificantSetBit(const SValuePtr &a) = 0;
virtual SValuePtr rotateLeft(const SValuePtr &a, const SValuePtr &nbits) = 0;
virtual SValuePtr rotateRight(const SValuePtr &a, const SValuePtr &nbits) = 0;
virtual SValuePtr shiftLeft(const SValuePtr &a, const SValuePtr &nbits) = 0;
virtual SValuePtr shiftRight(const SValuePtr &a, const SValuePtr &nbits) = 0;
virtual SValuePtr shiftRightArithmetic(const SValuePtr &a, const SValuePtr &nbits) = 0;
// Comparison Operations
virtual SValuePtr equalToZero(const SValuePtr &a) = 0;
virtual SValuePtr ite(const SValuePtr &cond, const SValuePtr &a, const SValuePtr &b) = 0;
virtual SValuePtr isEqual(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isNotEqual(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isUnsignedLessThan(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isUnsignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isUnsignedGreaterThan(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isUnsignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isSignedLessThan(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isSignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isSignedGreaterThan(const SValuePtr &a, const SValuePtr &b);
virtual SValuePtr isSignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b);
// Integer Arithmetic Operations
virtual SValuePtr unsignedExtend(const SValuePtr &a, size_t new_width);
virtual SValuePtr signExtend(const SValuePtr &a, size_t new_width) = 0;
virtual SValuePtr add(const SValuePtr &a, const SValuePtr &b) = 0;
virtual SValuePtr addCarry(const SValuePtr &a, const SValuePtr &b,
SValuePtr &carryOut /*out*/, SValuePtr &overflowed /*out*/);
virtual SValuePtr subtract(const SValuePtr &minuend, const SValuePtr &subtrahend);
virtual SValuePtr subtractCarry(const SValuePtr &minuend, const SValuePtr &subtrahend,
SValuePtr &carryOut /*out*/, SValuePtr &overflowed /*out*/);

The carry_out value is 11100100.

The width of a and b must be equal; c must have a width of one bit; the return value and carry_out will be the same width as a and b. The carry_out value is allocated herein.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::negate ( const BaseSemantics::SValuePtr a)
virtual

Two's complement.

The return value will have the same width as the operand.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::signedDivide ( const BaseSemantics::SValuePtr dividend,
const BaseSemantics::SValuePtr divisor 
)
virtual

Divides two signed values.

The width of the result will be the same as the width of the dividend.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::signedModulo ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Calculates modulo with signed values.

The width of the result will be the same as the width of operand b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::signedMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Multiplies two signed values.

The width of the result will be the sum of the widths of a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::unsignedDivide ( const BaseSemantics::SValuePtr dividend,
const BaseSemantics::SValuePtr divisor 
)
virtual

Divides two unsigned values.

The width of the result is the same as the width of the dividend.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::unsignedModulo ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Calculates modulo with unsigned values.

The width of the result is the same as the width of operand b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::unsignedMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Multiply two unsigned values.

The width of the result is the sum of the widths of a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::interrupt ( int  ,
int   
)
virtual

Invoked for instructions that cause an interrupt.

The major and minor numbers are architecture specific. For instance, an x86 INT instruction uses major number zero and the minor number is the interrupt number (e.g., 0x80 for Linux system calls), while an x86 SYSENTER instruction uses major number one. The minr operand for INT3 is -3 to distinguish it from the one-argument "INT 3" instruction which has slightly different semantics.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpFromInteger ( const BaseSemantics::SValuePtr intValue,
SgAsmFloatType fpType 
)
virtual

Construct a floating-point value from an integer value.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpToInteger ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType,
const BaseSemantics::SValuePtr dflt 
)
virtual

Construct an integer value from a floating-point value.

The bits of fpValue are interpreted according to the fpType and converted to a signed integer value that fits in integerWidth bits. This is done by truncating the fractional part of the floating point number, thus rounding toward zero. If fpValue is not a number then dflt is returned.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpConvert ( const BaseSemantics::SValuePtr a,
SgAsmFloatType aType,
SgAsmFloatType retType 
)
virtual

Convert from one floating-point type to another.

Converts the floating-point value a having type aType to the return value having retType.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpIsNan ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is a special not-a-number bit pattern.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpIsDenormalized ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is denormalized.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpIsZero ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is equal to zero.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpIsInfinity ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is infinity.

Returns true if the floating point value is plus or minus infinity. Querying the sign bit will return the sign of the infinity.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpSign ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Sign of floating-point value.

Returns the value of the floating-point sign bit.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpEffectiveExponent ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Exponent of floating-point value.

Returns the exponent of the floating point value. For normalized values this returns the stored exponent minus the exponent bias. For denormalized numbers this returns the stored exponent minus the exponent bias minus an additional amount to normalize the significand.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpAdd ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Add two floating-point values.

Adds two floating-point values that have the same type and returns the sum in the same type.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpSubtract ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Subtract one floating-point value from another.

Subtracts b from a and returns the difference. All three floating-point values have the same type. The default implementation is in terms of negate and add.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Multiply two floating-point values.

Multiplies two floating-point values and returns the product. All three values have the same type.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpDivide ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Divide one floating-point value by another.

Computes a divided by b and returns the result. All three floating-point values have the same type.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpSquareRoot ( const BaseSemantics::SValuePtr a,
SgAsmFloatType fpType 
)
virtual

Square root.

Computes and returns the square root of the specified floating-point value. Both values have the same type.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::fpRoundTowardZero ( const BaseSemantics::SValuePtr a,
SgAsmFloatType fpType 
)
virtual

Round toward zero.

Truncate the fractional part of the floating point number.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::readRegister ( RegisterDescriptor  reg,
const BaseSemantics::SValuePtr dflt 
)
virtual

Reads a value from a register.

The base implementation simply delegates to the current semantic State, which probably delegates to a register state, but subclasses are welcome to override this behavior at any level.

A register state will typically implement storage for hardware registers, but higher layers (the State, RiscOperators, Dispatcher, ...) should not be concerned about the size of the register they're trying to read. For example, a register state for a 32-bit x86 architecture will likely have a storage location for the 32-bit EAX register, but it should be possible to ask readRegister to return the value of AX (the low-order 16-bits). In order to accomplish this, some level of the readRegister delegations needs to invoke extract to obtain the low 16 bits. The RiscOperators object is passed along the delegation path for this purpose. The inverse concat operation will be needed at some level when we ask readRegister to return a value that comes from multiple storage locations in the register state (such as can happen if an x86 register state holds individual status flags and we ask for the 32-bit EFLAGS register).

If the register state can distinguish between a register that has never been accessed and a register that has only been read, then the dflt value is stored into the register the first time it's read. This ensures that reading the register a second time with no intervening write will return the same value as the first read. If a dflt is not provided then one is constructed by invoking undefined_.

There needs to be a certain level of cooperation between the RiscOperators, State, and register state classes to decide which layer should invoke the extract or concat (or whatever other RISC operations might be necessary).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::peekRegister ( RegisterDescriptor  ,
const BaseSemantics::SValuePtr dflt 
)
virtual

Obtain a register value without side effects.

This is a lower-level operation than readRegister in that it doesn't cause the register to be marked as having been read. It is typically used in situations where the register is being accessed for analysis purposes rather than as part of an instruction emulation.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::writeRegister ( RegisterDescriptor  reg,
const BaseSemantics::SValuePtr a 
)
virtual

Writes a value to a register.

The base implementation simply delegates to the current semantic State, which probably delegates to a register state, but subclasses are welcome to override this behavior at any level.

As with readRegister, writeRegister may need to perform various RISC operations in order to accomplish the task of writing a value to the specified register when the underlying register state doesn't actually store a value for that specific register. The RiscOperations object is passed along for that purpose. See readRegister for more details.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::readMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr dflt,
const BaseSemantics::SValuePtr cond 
)
virtual

Reads a value from memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's readMemory method.

A MemoryState will implement storage for memory locations and might impose certain restrictions, such as "all memory values must be eight bits". However, the readMemory should not have these constraints so that it can be called from a variety of Dispatcher subclass (e.g., the DispatcherX86 class assumes that readMemory is capable of reading 32-bit values from little-endian memory). The designers of the MemoryState, State, and RiscOperators should collaborate to decide which layer (RiscOperators, State, or MemoryState) is reponsible for combining individual memory locations into larger values. A RiscOperators object is passed along the chain of delegations for this purpose. The RiscOperators might also contain other data that's important during the process, such as an SMT solver.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true read operation. If cond can be proven to be false then the read is a no-op and returns an arbitrary value.

The dflt argument determines the size of the value to be read. This argument is also passed along to the lower layers so that they can, if they desire, use it to initialize memory that has never been read or written before.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::peekMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr dflt 
)
virtual

Read memory without side effects.

This is a lower-level operation than readMemory in that it doesn't cause any side effects in the memory state. In all other respects, it's similar to readMemory.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::TraceSemantics::RiscOperators::writeMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr data,
const BaseSemantics::SValuePtr cond 
)
virtual

Writes a value to memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's writeMemory method.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true write operation. If cond can be proved to be false then writeMemory is a no-op.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.


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