ROSE  0.11.50.0
StaticSemantics.h
1 // Turn instruction semantics into part of the AST
2 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_StaticSemantics_H
3 #define ROSE_BinaryAnalysis_InstructionSemantics2_StaticSemantics_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 
7 #include <Rose/BinaryAnalysis/Disassembler.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics2/NullSemantics.h>
9 #include "SageBuilderAsm.h"
10 
11 namespace Rose {
12 namespace BinaryAnalysis { // documented elsewhere
13 namespace InstructionSemantics2 { // documented elsewhere
14 
39 namespace StaticSemantics {
40 
42 // Free functions
44 
60 // Value type
63 
66 
75 public:
78 
80  using Ptr = SValuePtr;
81 
82 protected:
83  SgAsmExpression *ast_;
84 
85 protected:
86  SValue(size_t nbits, SgAsmRiscOperation::RiscOperator op): BaseSemantics::SValue(nbits) {
87  static uint64_t nVars = 0;
88  ast_ = SageBuilderAsm::buildRiscOperation(op, SageBuilderAsm::buildValueU64(nVars++));
89  }
90 
91  SValue(size_t nbits, uint64_t number): BaseSemantics::SValue(nbits) {
92  SgAsmType *type = SgAsmType::registerOrDelete(new SgAsmIntegerType(ByteOrder::ORDER_LSB, nbits,
93  false /*unsigned*/));
94  ast_ = SageBuilderAsm::buildValueInteger(number, type);
95  }
96 
97  SValue(const SValue &other): BaseSemantics::SValue(other) {
98  SgTreeCopy deep;
99  SgNode *copied = ast_->copy(deep);
100  ASSERT_require(isSgAsmExpression(copied));
101  ast_ = isSgAsmExpression(copied);
102  }
103 
104 public:
108  static SValuePtr instance() {
109  return SValuePtr(new SValue(1, SgAsmRiscOperation::OP_undefined));
110  }
111 
113  static SValuePtr instance_bottom(size_t nbits) {
114  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_bottom));
115  }
116 
122  static SValuePtr instance_undefined(size_t nbits) {
123  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_undefined));
124  }
125 
131  static SValuePtr instance_unspecified(size_t nbits) {
132  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_unspecified));
133  }
134 
136  static SValuePtr instance_integer(size_t nbits, uint64_t value) {
137  return SValuePtr(new SValue(nbits, value));
138  }
139 
140 public:
141  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
142  return instance_bottom(nbits);
143  }
144  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
145  return instance_undefined(nbits);
146  }
147  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
148  return instance_unspecified(nbits);
149  }
150  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE {
151  return instance_integer(nbits, value);
152  }
153  virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE {
154  return instance_integer(1, value ? 1 : 0);
155  }
156  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
157  SValuePtr retval(new SValue(*this));
158  if (new_width!=0 && new_width!=retval->nBits())
159  retval->set_width(new_width);
160  return retval;
161  }
164  const SmtSolverPtr&) const ROSE_OVERRIDE {
165  throw BaseSemantics::NotImplemented("StaticSemantics is not suitable for dataflow analysis", NULL);
166  }
167 
168 public:
170  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
171  SValuePtr retval = v.dynamicCast<SValue>();
172  ASSERT_not_null(retval);
173  return retval;
174  }
175 
176 public:
177  // These are not needed since this domain never tries to compare semantic values.
178  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
179  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
180  ASSERT_not_reachable("no implementation necessary");
181  }
182 
183  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
184  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
185  ASSERT_not_reachable("no implementation necessary");
186  }
187 
188  virtual void set_width(size_t nbits) ROSE_OVERRIDE {
189  ASSERT_not_reachable("no implementation necessary");
190  }
191 
192  virtual bool isBottom() const ROSE_OVERRIDE {
193  return false;
194  }
195 
196  virtual bool is_number() const ROSE_OVERRIDE {
197  return false;
198  }
199 
200  virtual uint64_t get_number() const ROSE_OVERRIDE {
201  ASSERT_not_reachable("no implementation necessary");
202  }
203 
204  virtual void hash(Combinatorics::Hasher&) const override {
205  ASSERT_not_reachable("no implementation necessary");
206  }
207 
208  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
209 
210 public:
214  virtual SgAsmExpression* ast() {
215  return ast_;
216  }
217  virtual void ast(SgAsmExpression *x) {
218  ASSERT_not_null(x);
219  ASSERT_require(x->get_parent() == NULL);
220  ast_ = x;
221  }
223 };
224 
226 // State
228 
229 // No state necessary for this domain. All instruction side effects are immediately attached to the SgAsmInstruction node
230 // rather than being stored in some state.
231 
232 typedef NullSemantics::RegisterState RegisterState;
233 typedef NullSemantics::RegisterStatePtr RegisterStatePtr;
234 
235 typedef NullSemantics::MemoryState MemoryState;
236 typedef NullSemantics::MemoryStatePtr MemoryStatePtr;
237 
238 typedef NullSemantics::State State;
239 typedef NullSemantics::StatePtr StatePtr;
240 
241 
243 // RiscOperators
245 
247 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
248 
259 public:
262 
265 
266 protected:
268  : BaseSemantics::RiscOperators(protoval, solver) {
269  name("StaticSemantics");
270  (void) SValue::promote(protoval); // make sure its dynamic type is a StaticSemantics::SValue
271  }
272 
274  : BaseSemantics::RiscOperators(state, solver) {
275  name("StaticSemantics");
276  (void) SValue::promote(state->protoval()); // values must have StaticSemantics::SValue dynamic type
277  }
278 
279 public:
282  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
284  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
285  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
286  BaseSemantics::StatePtr state = State::instance(registers, memory);
287  return RiscOperatorsPtr(new RiscOperators(state, solver));
288  }
289 
293  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
294  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
295  }
296 
299  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
300  return RiscOperatorsPtr(new RiscOperators(state, solver));
301  }
302 
304  // Virtual constructors
305 public:
307  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
308  return instance(protoval, solver);
309  }
310 
312  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
313  return instance(state, solver);
314  }
315 
317  // Dynamic pointer casts
318 public:
321  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
322  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
323  ASSERT_not_null(retval);
324  return retval;
325  }
326 
328  // Supporting functions
329 protected:
340  const BaseSemantics::SValuePtr &a);
342  const BaseSemantics::SValuePtr &a,
343  const BaseSemantics::SValuePtr &b);
345  const BaseSemantics::SValuePtr &a,
346  const BaseSemantics::SValuePtr &b,
347  const BaseSemantics::SValuePtr &c);
349  const BaseSemantics::SValuePtr &a,
350  const BaseSemantics::SValuePtr &b,
351  const BaseSemantics::SValuePtr &c,
352  const BaseSemantics::SValuePtr &d);
362 
364  // Override all operator methods from base class. These are the RISC operators that are invoked by a Dispatcher.
365 public:
366  virtual void startInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
367  virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
368  virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
369  virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
370  virtual void hlt() ROSE_OVERRIDE;
371  virtual void cpuid() ROSE_OVERRIDE;
372  virtual BaseSemantics::SValuePtr rdtsc() ROSE_OVERRIDE;
373  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
374  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
375  virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr &a_,
376  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
377  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
378  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
379  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
380  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
381  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
382  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
383  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
384  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
385  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
386  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
387  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
388  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
389  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
390  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
391  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
392  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
393  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
394  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
395  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
396  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
397  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
398  const BaseSemantics::SValuePtr &a_,
399  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
400  virtual BaseSemantics::SValuePtr isEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
401  virtual BaseSemantics::SValuePtr isNotEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
402  virtual BaseSemantics::SValuePtr isUnsignedLessThan(const BaseSemantics::SValuePtr&,
403  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
404  virtual BaseSemantics::SValuePtr isUnsignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
405  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
406  virtual BaseSemantics::SValuePtr isUnsignedGreaterThan(const BaseSemantics::SValuePtr&,
407  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
408  virtual BaseSemantics::SValuePtr isUnsignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
409  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
410  virtual BaseSemantics::SValuePtr isSignedLessThan(const BaseSemantics::SValuePtr&,
411  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
412  virtual BaseSemantics::SValuePtr isSignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
413  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
414  virtual BaseSemantics::SValuePtr isSignedGreaterThan(const BaseSemantics::SValuePtr&,
415  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
416  virtual BaseSemantics::SValuePtr isSignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
417  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
418  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
419  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
420  virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_,
421  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
422  virtual BaseSemantics::SValuePtr subtract(const BaseSemantics::SValuePtr &a_,
423  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
424  virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_,
425  const BaseSemantics::SValuePtr &b_,
426  const BaseSemantics::SValuePtr &c_,
427  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
428  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
429  virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_,
430  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
431  virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_,
432  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
433  virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_,
434  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
435  virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_,
436  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
437  virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_,
438  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
439  virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_,
440  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
441  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
442  virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg,
443  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
444  virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg,
445  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
446  virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
447  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg,
448  const BaseSemantics::SValuePtr &addr,
449  const BaseSemantics::SValuePtr &dflt,
450  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
451  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg,
452  const BaseSemantics::SValuePtr &addr,
453  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
454  virtual void writeMemory(RegisterDescriptor segreg,
455  const BaseSemantics::SValuePtr &addr,
456  const BaseSemantics::SValuePtr &data,
457  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
458 };
459 
460 
461 } // namespace
462 } // namespace
463 } // namespace
464 } // namespace
465 
466 #endif
467 #endif
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE
Writes a value to a register.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual bool is_number() const ROSE_OVERRIDE
Virtual API.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
Base class for machine instructions.
static SValuePtr instance_undefined(size_t nbits)
Instantiate an undefined value.
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 ...
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
RiscOperator
One enum per RISC operator.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
void attachInstructionSemantics(SgNode *ast, Disassembler *)
Build and attach static semantics to all instructions.
Holds a value or nothing.
Definition: Optional.h:49
virtual void interrupt(int majr, int minr) ROSE_OVERRIDE
Invoked for instructions that cause an interrupt.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to null register state.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
Main namespace for the ROSE library.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
virtual void ast(SgAsmExpression *x)
Property: Abstract syntax tree.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical values.
Semantic values for generating static semantic ASTs.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a static semantics value.
boost::shared_ptr< class RegisterState > RegisterStatePtr
Shared-ownership pointer to null register state.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Reads a value from a register.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
static Type * registerOrDelete(Type *toInsert)
Registers a type with the type system.
static SValuePtr instance_bottom(size_t nbits)
Instantiate a data-flow bottom value.
virtual void set_width(size_t nbits) ROSE_OVERRIDE
Virtual API.
Describes (part of) a physical CPU register.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:9555
virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE
Create a new, Boolean value.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer for basic semantic operations.
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
Definition: RiscOperators.h:48
Base class for expressions.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
virtual uint64_t get_number() const ROSE_OVERRIDE
Virtual API.
static SValuePtr instance_unspecified(size_t nbits)
Instantiate an unspecified value.
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified state.
virtual SgNode * copy(SgCopyHelp &help) const
This function clones the current IR node object recursively or not, depending on the argument...
Supporting class for "Deep" copies of the AST.
Definition: Cxx_Grammar.h:9384
Base class for binary types.
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer for a static-semantics value.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to static operators.
virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) ROSE_OVERRIDE
Used for printing RISC operators with formatting.
virtual void hash(Combinatorics::Hasher &) const override
Hash this semantic value.
SgNode * get_parent() const
Access function for parent node.
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE
Create a new value from an existing value, changing the width if new_width is non-zero.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Obtain a register value without side effects.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
static SValuePtr instance_integer(size_t nbits, uint64_t value)
Instantiate an integer constant.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE
Create a new concrete semantic value.
Defines registers available for a particular architecture.
Definition: Registers.h:37
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
virtual const std::string & name() const
Property: Name used for debugging.
Integer types.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE
Create a new undefined semantic value.
static SValuePtr instance()
Instantiate a prototypical SValue.
Virtual base class for instruction disassemblers.
Definition: Disassembler.h:50
virtual Sawyer::Optional< BaseSemantics::SValuePtr > createOptionalMerge(const BaseSemantics::SValuePtr &, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const ROSE_OVERRIDE
Possibly create a new value by merging two existing values.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE
Data-flow bottom value.
BaseSemantics::SValuePtr makeSValue(size_t nbits, SgAsmExpression *)
Create a new SValue.
boost::shared_ptr< RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
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.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
Definition: SmtSolver.h:25
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
void saveSemanticEffect(const BaseSemantics::SValuePtr &)
Save instruction side effect.