ROSE  0.11.2.0
StaticSemantics2.h
1 // Turn instruction semantics into part of the AST
2 #ifndef Rose_StaticSemantics2_H
3 #define Rose_StaticSemantics2_H
4 #include <rosePublicConfig.h>
5 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
6 
7 #include "Disassembler.h"
8 #include "NullSemantics2.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 protected:
76  SgAsmExpression *ast_;
77 
78 protected:
80  static uint64_t nVars = 0;
81  ast_ = SageBuilderAsm::buildRiscOperation(op, SageBuilderAsm::buildValueU64(nVars++));
82  }
83 
84  SValue(size_t nbits, uint64_t number): BaseSemantics::SValue(nbits) {
85  SgAsmType *type = SgAsmType::registerOrDelete(new SgAsmIntegerType(ByteOrder::ORDER_LSB, nbits,
86  false /*unsigned*/));
87  ast_ = SageBuilderAsm::buildValueInteger(number, type);
88  }
89 
90  SValue(const SValue &other): BaseSemantics::SValue(other) {
91  SgTreeCopy deep;
92  SgNode *copied = ast_->copy(deep);
93  ASSERT_require(isSgAsmExpression(copied));
94  ast_ = isSgAsmExpression(copied);
95  }
96 
97 public:
101  static SValuePtr instance() {
102  return SValuePtr(new SValue(1, SgAsmRiscOperation::OP_undefined));
103  }
104 
106  static SValuePtr instance_bottom(size_t nbits) {
107  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_bottom));
108  }
109 
115  static SValuePtr instance_undefined(size_t nbits) {
116  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_undefined));
117  }
118 
124  static SValuePtr instance_unspecified(size_t nbits) {
125  return SValuePtr(new SValue(nbits, SgAsmRiscOperation::OP_unspecified));
126  }
127 
129  static SValuePtr instance_integer(size_t nbits, uint64_t value) {
130  return SValuePtr(new SValue(nbits, value));
131  }
132 
133 public:
134  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
135  return instance_bottom(nbits);
136  }
137  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
138  return instance_undefined(nbits);
139  }
140  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
141  return instance_unspecified(nbits);
142  }
143  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE {
144  return instance_integer(nbits, value);
145  }
146  virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE {
147  return instance_integer(1, value ? 1 : 0);
148  }
149  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
150  SValuePtr retval(new SValue(*this));
151  if (new_width!=0 && new_width!=retval->get_width())
152  retval->set_width(new_width);
153  return retval;
154  }
157  const SmtSolverPtr&) const ROSE_OVERRIDE {
158  throw BaseSemantics::NotImplemented("StaticSemantics is not suitable for dataflow analysis", NULL);
159  }
160 
161 public:
163  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
164  SValuePtr retval = v.dynamicCast<SValue>();
165  ASSERT_not_null(retval);
166  return retval;
167  }
168 
169 public:
170  // These are not needed since this domain never tries to compare semantic values.
171  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
172  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
173  ASSERT_not_reachable("no implementation necessary");
174  }
175 
176  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
177  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
178  ASSERT_not_reachable("no implementation necessary");
179  }
180 
181  virtual void set_width(size_t nbits) ROSE_OVERRIDE {
182  ASSERT_not_reachable("no implementation necessary");
183  }
184 
185  virtual bool isBottom() const ROSE_OVERRIDE {
186  return false;
187  }
188 
189  virtual bool is_number() const ROSE_OVERRIDE {
190  return false;
191  }
192 
193  virtual uint64_t get_number() const ROSE_OVERRIDE {
194  ASSERT_not_reachable("no implementation necessary");
195  }
196 
197  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
198 
199 public:
203  virtual SgAsmExpression* ast() {
204  return ast_;
205  }
206  virtual void ast(SgAsmExpression *x) {
207  ASSERT_not_null(x);
208  ASSERT_require(x->get_parent() == NULL);
209  ast_ = x;
210  }
212 };
213 
215 // State
217 
218 // No state necessary for this domain. All instruction side effects are immediately attached to the SgAsmInstruction node
219 // rather than being stored in some state.
220 
221 typedef NullSemantics::RegisterState RegisterState;
222 typedef NullSemantics::RegisterStatePtr RegisterStatePtr;
223 
224 typedef NullSemantics::MemoryState MemoryState;
225 typedef NullSemantics::MemoryStatePtr MemoryStatePtr;
226 
227 typedef NullSemantics::State State;
228 typedef NullSemantics::StatePtr StatePtr;
229 
230 
232 // RiscOperators
234 
236 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
237 
248 protected:
250  : BaseSemantics::RiscOperators(protoval, solver) {
251  name("StaticSemantics");
252  (void) SValue::promote(protoval); // make sure its dynamic type is a StaticSemantics::SValue
253  }
254 
255  RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver)
256  : BaseSemantics::RiscOperators(state, solver) {
257  name("StaticSemantics");
258  (void) SValue::promote(state->protoval()); // values must have StaticSemantics::SValue dynamic type
259  }
260 
261 public:
264  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
266  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
267  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
268  BaseSemantics::StatePtr state = State::instance(registers, memory);
269  return RiscOperatorsPtr(new RiscOperators(state, solver));
270  }
271 
275  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
276  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
277  }
278 
281  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
282  return RiscOperatorsPtr(new RiscOperators(state, solver));
283  }
284 
286  // Virtual constructors
287 public:
289  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
290  return instance(protoval, solver);
291  }
292 
294  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
295  return instance(state, solver);
296  }
297 
299  // Dynamic pointer casts
300 public:
303  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
304  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
305  ASSERT_not_null(retval);
306  return retval;
307  }
308 
310  // Supporting functions
311 protected:
322  const BaseSemantics::SValuePtr &a);
324  const BaseSemantics::SValuePtr &a,
325  const BaseSemantics::SValuePtr &b);
327  const BaseSemantics::SValuePtr &a,
328  const BaseSemantics::SValuePtr &b,
329  const BaseSemantics::SValuePtr &c);
331  const BaseSemantics::SValuePtr &a,
332  const BaseSemantics::SValuePtr &b,
333  const BaseSemantics::SValuePtr &c,
334  const BaseSemantics::SValuePtr &d);
344 
346  // Override all operator methods from base class. These are the RISC operators that are invoked by a Dispatcher.
347 public:
348  virtual void startInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
349  virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
350  virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
351  virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
352  virtual void hlt() ROSE_OVERRIDE;
353  virtual void cpuid() ROSE_OVERRIDE;
354  virtual BaseSemantics::SValuePtr rdtsc() ROSE_OVERRIDE;
355  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
356  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
357  virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr &a_,
358  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
359  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
360  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
361  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
362  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
363  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
364  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
365  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
366  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
367  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
368  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
369  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
370  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
371  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
372  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
373  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
374  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
375  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
376  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
377  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
378  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
379  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
380  const BaseSemantics::SValuePtr &a_,
381  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
382  virtual BaseSemantics::SValuePtr isEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
383  virtual BaseSemantics::SValuePtr isNotEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
384  virtual BaseSemantics::SValuePtr isUnsignedLessThan(const BaseSemantics::SValuePtr&,
385  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
386  virtual BaseSemantics::SValuePtr isUnsignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
387  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
388  virtual BaseSemantics::SValuePtr isUnsignedGreaterThan(const BaseSemantics::SValuePtr&,
389  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
390  virtual BaseSemantics::SValuePtr isUnsignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
391  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
392  virtual BaseSemantics::SValuePtr isSignedLessThan(const BaseSemantics::SValuePtr&,
393  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
394  virtual BaseSemantics::SValuePtr isSignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
395  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
396  virtual BaseSemantics::SValuePtr isSignedGreaterThan(const BaseSemantics::SValuePtr&,
397  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
398  virtual BaseSemantics::SValuePtr isSignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
399  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
400  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
401  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
402  virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_,
403  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
404  virtual BaseSemantics::SValuePtr subtract(const BaseSemantics::SValuePtr &a_,
405  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
406  virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_,
407  const BaseSemantics::SValuePtr &b_,
408  const BaseSemantics::SValuePtr &c_,
409  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
410  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
411  virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_,
412  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
413  virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_,
414  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
415  virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_,
416  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
417  virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_,
418  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
419  virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_,
420  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
421  virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_,
422  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
423  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
424  virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg,
425  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
426  virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg,
427  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
428  virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
429  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg,
430  const BaseSemantics::SValuePtr &addr,
431  const BaseSemantics::SValuePtr &dflt,
432  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
433  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg,
434  const BaseSemantics::SValuePtr &addr,
435  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
436  virtual void writeMemory(RegisterDescriptor segreg,
437  const BaseSemantics::SValuePtr &addr,
438  const BaseSemantics::SValuePtr &data,
439  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
440 };
441 
442 
443 } // namespace
444 } // namespace
445 } // namespace
446 } // namespace
447 
448 #endif
449 #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
Determines if the value is a concrete number.
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
Returns true if two values could be equal.
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.
Sawyer::SharedPointer< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
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
Accessor for value width.
Describes (part of) a physical CPU register.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:9311
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.
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
Return the concrete number for this value.
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:9140
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.
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
Returns true if two values must be equal.
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:38
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.
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.