ROSE
0.11.87.0
|
Definition at line 303 of file NativeSemantics.h.
Public Types | |
using | Super = ConcreteSemantics::RiscOperators |
Base type. More... | |
using | Ptr = RiscOperatorsPtr |
Shared-ownership pointer. More... | |
![]() | |
using | Super = BaseSemantics::RiscOperators |
Base type. More... | |
using | Ptr = RiscOperatorsPtr |
Shared-ownership pointer. More... | |
![]() | |
using | Ptr = RiscOperatorsPtr |
Shared-ownership pointer for a RiscOperators object. More... | |
Public Member Functions | |
virtual BaseSemantics::RiscOperatorsPtr | create (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const override |
Virtual allocating constructor. More... | |
Debugger::Ptr | process () const |
Property: Process storing the state. More... | |
![]() | |
virtual BaseSemantics::RiscOperatorsPtr | create (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const override |
Virtual allocating constructor. More... | |
virtual void | interrupt (int majr, int minr) override |
Invoked for instructions that cause an interrupt. More... | |
virtual BaseSemantics::SValuePtr | and_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Computes bit-wise AND of two values. More... | |
virtual BaseSemantics::SValuePtr | or_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Computes bit-wise OR of two values. More... | |
virtual BaseSemantics::SValuePtr | xor_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Computes bit-wise XOR of two values. More... | |
virtual BaseSemantics::SValuePtr | invert (const BaseSemantics::SValuePtr &a_) override |
One's complement. More... | |
virtual BaseSemantics::SValuePtr | extract (const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) override |
Extracts bits from a value. More... | |
virtual BaseSemantics::SValuePtr | concat (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Concatenates the bits of two values. More... | |
virtual BaseSemantics::SValuePtr | leastSignificantSetBit (const BaseSemantics::SValuePtr &a_) override |
Returns position of least significant set bit; zero when no bits are set. More... | |
virtual BaseSemantics::SValuePtr | mostSignificantSetBit (const BaseSemantics::SValuePtr &a_) override |
Returns position of most significant set bit; zero when no bits are set. More... | |
virtual BaseSemantics::SValuePtr | rotateLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override |
Rotate bits to the left. More... | |
virtual BaseSemantics::SValuePtr | rotateRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override |
Rotate bits to the right. More... | |
virtual BaseSemantics::SValuePtr | shiftLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override |
Returns arg shifted left. More... | |
virtual BaseSemantics::SValuePtr | shiftRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override |
Returns arg shifted right logically (no sign bit). More... | |
virtual BaseSemantics::SValuePtr | shiftRightArithmetic (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) override |
Returns arg shifted right arithmetically (with sign bit). More... | |
virtual BaseSemantics::SValuePtr | equalToZero (const BaseSemantics::SValuePtr &a_) override |
Determines whether a value is equal to zero. More... | |
virtual BaseSemantics::SValuePtr | ite (const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
If-then-else. More... | |
virtual BaseSemantics::SValuePtr | unsignedExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) override |
Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits. More... | |
virtual BaseSemantics::SValuePtr | signExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) override |
Sign extends a value. More... | |
virtual BaseSemantics::SValuePtr | add (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Adds two integers of equal size. More... | |
virtual BaseSemantics::SValuePtr | addWithCarries (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) override |
Add two values of equal size and a carry bit. More... | |
virtual BaseSemantics::SValuePtr | negate (const BaseSemantics::SValuePtr &a_) override |
Two's complement. More... | |
virtual BaseSemantics::SValuePtr | signedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Divides two signed values. More... | |
virtual BaseSemantics::SValuePtr | signedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Calculates modulo with signed values. More... | |
virtual BaseSemantics::SValuePtr | signedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Multiplies two signed values. More... | |
virtual BaseSemantics::SValuePtr | unsignedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Divides two unsigned values. More... | |
virtual BaseSemantics::SValuePtr | unsignedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Calculates modulo with unsigned values. More... | |
virtual BaseSemantics::SValuePtr | unsignedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) override |
Multiply two unsigned values. More... | |
virtual BaseSemantics::SValuePtr | fpFromInteger (const BaseSemantics::SValuePtr &intValue, SgAsmFloatType *) override |
Construct a floating-point value from an integer value. More... | |
virtual BaseSemantics::SValuePtr | fpToInteger (const BaseSemantics::SValuePtr &fpValue, SgAsmFloatType *fpType, const BaseSemantics::SValuePtr &dflt) override |
Construct an integer value from a floating-point value. More... | |
virtual BaseSemantics::SValuePtr | fpAdd (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) override |
Add two floating-point values. More... | |
virtual BaseSemantics::SValuePtr | fpSubtract (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) override |
Subtract one floating-point value from another. More... | |
virtual BaseSemantics::SValuePtr | fpMultiply (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) override |
Multiply two floating-point values. More... | |
virtual BaseSemantics::SValuePtr | fpRoundTowardZero (const BaseSemantics::SValuePtr &a, SgAsmFloatType *) override |
Round toward zero. More... | |
virtual BaseSemantics::SValuePtr | readMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) override |
Reads a value from memory. More... | |
virtual BaseSemantics::SValuePtr | peekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) override |
Read memory without side effects. More... | |
virtual void | writeMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) override |
Writes a value to memory. More... | |
![]() | |
virtual SValuePtr | protoval () const |
Property: Prototypical semantic value. More... | |
virtual void | hash (Combinatorics::Hasher &) |
Compute hash of current state. More... | |
virtual void | startInstruction (SgAsmInstruction *insn) |
Called at the beginning of every instruction. More... | |
virtual void | finishInstruction (SgAsmInstruction *insn) |
Called at the end of every instruction. More... | |
virtual SValuePtr | number_ (size_t nbits, uint64_t value) |
Returns a number of the specified bit width. More... | |
virtual SValuePtr | boolean_ (bool value) |
Returns a Boolean value. More... | |
virtual SValuePtr | bottom_ (size_t nbits) |
Returns a data-flow bottom value. More... | |
virtual SValuePtr | filterCallTarget (const SValuePtr &a) |
Invoked to filter call targets. More... | |
virtual SValuePtr | filterReturnTarget (const SValuePtr &a) |
Invoked to filter return targets. More... | |
virtual SValuePtr | filterIndirectJumpTarget (const SValuePtr &a) |
Invoked to filter indirect jumps. More... | |
virtual void | hlt () |
Invoked for the x86 HLT instruction. More... | |
virtual void | cpuid () |
Invoked for the x86 CPUID instruction. More... | |
virtual SValuePtr | rdtsc () |
Invoked for the x86 RDTSC instruction. More... | |
virtual std::pair< SValuePtr, SValuePtr > | split (const SValuePtr &a, size_t splitPoint) |
Split a value into two narrower values. More... | |
virtual SValuePtr | countLeadingZeros (const SValuePtr &a) |
Count leading zero bits. More... | |
virtual SValuePtr | countLeadingOnes (const SValuePtr &a) |
Count leading one bits. More... | |
virtual SValuePtr | reverseElmts (const SValuePtr &a, size_t elmtNBits) |
Reverse parts of a value. More... | |
virtual SValuePtr | addCarry (const SValuePtr &a, const SValuePtr &b, SValuePtr &carryOut, SValuePtr &overflowed) |
Adds two integers of equal size and carry. More... | |
virtual SValuePtr | subtract (const SValuePtr &minuend, const SValuePtr &subtrahend) |
Subtract one value from another. More... | |
virtual SValuePtr | subtractCarry (const SValuePtr &minuend, const SValuePtr &subtrahend, SValuePtr &carryOut, SValuePtr &overflowed) |
Subtract one value from another and carry. More... | |
virtual void | interrupt (const SValuePtr &majr, const SValuePtr &minr, const SValuePtr &enabled) |
Invoked for instructions that cause an interrupt. More... | |
virtual SValuePtr | fpConvert (const SValuePtr &a, SgAsmFloatType *aType, SgAsmFloatType *retType) |
Convert from one floating-point type to another. More... | |
virtual SValuePtr | fpIsNan (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Whether a floating-point value is a special not-a-number bit pattern. More... | |
virtual SValuePtr | fpIsDenormalized (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Whether a floating-point value is denormalized. More... | |
virtual SValuePtr | fpIsZero (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Whether a floating-point value is equal to zero. More... | |
virtual SValuePtr | fpIsInfinity (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Whether a floating-point value is infinity. More... | |
virtual SValuePtr | fpSign (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Sign of floating-point value. More... | |
virtual SValuePtr | fpEffectiveExponent (const SValuePtr &fpValue, SgAsmFloatType *fpType) |
Exponent of floating-point value. More... | |
virtual SValuePtr | fpDivide (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType) |
Divide one floating-point value by another. More... | |
virtual SValuePtr | fpSquareRoot (const SValuePtr &a, SgAsmFloatType *fpType) |
Square root. More... | |
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... | |
virtual void | writeRegister (RegisterDescriptor reg, const SValuePtr &a) |
Writes a value to a register. More... | |
virtual SmtSolverPtr | solver () const |
Property: Satisfiability module theory (SMT) solver. More... | |
virtual void | solver (const SmtSolverPtr &s) |
Property: Satisfiability module theory (SMT) solver. More... | |
const HotPatch & | hotPatch () const |
Property: Post-instruction hot patches. More... | |
HotPatch & | hotPatch () |
Property: Post-instruction hot patches. More... | |
void | hotPatch (const HotPatch &hp) |
Property: Post-instruction hot patches. More... | |
virtual StatePtr | currentState () const |
Property: Current semantic state. More... | |
virtual void | currentState (const StatePtr &s) |
Property: Current semantic state. 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 void | print (std::ostream &stream, Formatter &fmt) const |
Print multi-line output for this object. | |
WithFormatter | with_format (Formatter &fmt) |
Used for printing RISC operators with formatting. More... | |
WithFormatter | operator+ (Formatter &fmt) |
Used for printing RISC operators with formatting. More... | |
WithFormatter | operator+ (const std::string &linePrefix) |
Used for printing RISC operators with formatting. More... | |
virtual size_t | nInsns () const |
Property: Number of instructions processed. More... | |
virtual void | nInsns (size_t n) |
Property: Number of instructions processed. More... | |
virtual SgAsmInstruction * | currentInstruction () const |
Property: Current instruction. More... | |
virtual void | currentInstruction (SgAsmInstruction *insn) |
Property: Current instruction. More... | |
virtual bool | isNoopRead () const |
Property: No-op read. More... | |
virtual void | isNoopRead (bool b) |
Property: No-op read. More... | |
virtual SValuePtr | undefined_ (size_t nbits) |
Returns a new undefined value. More... | |
virtual SValuePtr | unspecified_ (size_t nbits) |
Returns a new undefined value. More... | |
virtual SValuePtr | concatLoHi (const SValuePtr &lowBits, const SValuePtr &highBits) |
Aliases for concatenation. More... | |
virtual SValuePtr | concatHiLo (const SValuePtr &highBits, const SValuePtr &lowBits) |
Aliases for concatenation. More... | |
virtual SValuePtr | isEqual (const SValuePtr &a, const SValuePtr &b) |
Equality comparison. More... | |
virtual SValuePtr | isNotEqual (const SValuePtr &a, const SValuePtr &b) |
Equality comparison. More... | |
virtual SValuePtr | isUnsignedLessThan (const SValuePtr &a, const SValuePtr &b) |
Comparison for unsigned values. More... | |
virtual SValuePtr | isUnsignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b) |
Comparison for unsigned values. More... | |
virtual SValuePtr | isUnsignedGreaterThan (const SValuePtr &a, const SValuePtr &b) |
Comparison for unsigned values. More... | |
virtual SValuePtr | isUnsignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b) |
Comparison for unsigned values. More... | |
virtual SValuePtr | isSignedLessThan (const SValuePtr &a, const SValuePtr &b) |
Comparison for signed values. More... | |
virtual SValuePtr | isSignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b) |
Comparison for signed values. More... | |
virtual SValuePtr | isSignedGreaterThan (const SValuePtr &a, const SValuePtr &b) |
Comparison for signed values. More... | |
virtual SValuePtr | isSignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b) |
Comparison for signed values. More... | |
virtual SValuePtr | readRegister (RegisterDescriptor reg) |
Reads a value from a register. More... | |
virtual SValuePtr | readRegister (RegisterDescriptor reg, const SValuePtr &dflt) |
Reads a value from a register. More... | |
virtual SValuePtr | peekRegister (RegisterDescriptor, const SValuePtr &dflt) |
Obtain a register value without side effects. 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 Debugger::Ptr &process) |
Instantiate a new RiscOperators object. More... | |
static RiscOperatorsPtr | instance (const BaseSemantics::StatePtr &state) |
Instantiate a new RiscOperators object. More... | |
static RiscOperatorsPtr | promote (const BaseSemantics::RiscOperatorsPtr &x) |
Run-time promotion of a base object to a NativeSemantics RiscOperators. More... | |
![]() | |
static RiscOperatorsPtr | instance (const RegisterDictionary *regdict, const SmtSolverPtr &solver=SmtSolverPtr()) |
Instantiates a new RiscOperators object and configures it to use semantic values and states that are defaults for ConcreteSemantics. More... | |
static RiscOperatorsPtr | instance (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) |
Instantiates a new RiscOperators object with specified prototypical values. More... | |
static RiscOperatorsPtr | instance (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) |
Instantiates a new RiscOperators object with specified state. More... | |
static RiscOperatorsPtr | promote (const BaseSemantics::RiscOperatorsPtr &x) |
Run-time promotion of a base RiscOperators pointer to concrete operators. More... | |
![]() | |
static RiscOperatorsPtr | promote (const RiscOperatorsPtr &x) |
using Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RiscOperators::Super = ConcreteSemantics::RiscOperators |
Base type.
Definition at line 306 of file NativeSemantics.h.
using Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RiscOperators::Ptr = RiscOperatorsPtr |
Shared-ownership pointer.
Definition at line 309 of file NativeSemantics.h.
|
inlinestatic |
Instantiate a new RiscOperators object.
The register state, memory state, and combined state are instantiations of NativeSemantics RegisterState, MemoryState, and State, which point to the subordinate process and which are not copyable.
Definition at line 328 of file NativeSemantics.h.
References Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::RegisterState::instance(), and Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::MemoryState::instance().
|
inlinestatic |
Instantiate a new RiscOperators object.
The state (registers and memory) for this object is provided by the caller and must be an instance of the NativeSemantics State that points to NativeSemantics RegisterState and MemoryState. User-defined subclasses can also be used.
Definition at line 340 of file NativeSemantics.h.
|
inlineoverridevirtual |
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).
Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::ConcreteSemantics::RiscOperators.
Definition at line 349 of file NativeSemantics.h.
|
inlinestatic |
Run-time promotion of a base object to a NativeSemantics RiscOperators.
This is a checked conversion–it will fail if x
does not point to a NativeSemantics::RiscOperators object.
Definition at line 360 of file NativeSemantics.h.
Referenced by Rose::BinaryAnalysis::InstructionSemantics2::NativeSemantics::Dispatcher::instance().
|
inline |
Property: Process storing the state.
This is just a convenience function that queries the state for the information.
Definition at line 373 of file NativeSemantics.h.
References Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators::currentState().