ROSE  0.11.31.0
StaticSemantics2.h
1 // Turn instruction semantics into part of the AST
2 #ifndef Rose_StaticSemantics2_H
3 #define Rose_StaticSemantics2_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
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->nBits())
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 hash(Combinatorics::Hasher&) const override {
198  ASSERT_not_reachable("no implementation necessary");
199  }
200 
201  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
202 
203 public:
207  virtual SgAsmExpression* ast() {
208  return ast_;
209  }
210  virtual void ast(SgAsmExpression *x) {
211  ASSERT_not_null(x);
212  ASSERT_require(x->get_parent() == NULL);
213  ast_ = x;
214  }
216 };
217 
219 // State
221 
222 // No state necessary for this domain. All instruction side effects are immediately attached to the SgAsmInstruction node
223 // rather than being stored in some state.
224 
225 typedef NullSemantics::RegisterState RegisterState;
226 typedef NullSemantics::RegisterStatePtr RegisterStatePtr;
227 
228 typedef NullSemantics::MemoryState MemoryState;
229 typedef NullSemantics::MemoryStatePtr MemoryStatePtr;
230 
231 typedef NullSemantics::State State;
232 typedef NullSemantics::StatePtr StatePtr;
233 
234 
236 // RiscOperators
238 
240 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
241 
252 protected:
254  : BaseSemantics::RiscOperators(protoval, solver) {
255  name("StaticSemantics");
256  (void) SValue::promote(protoval); // make sure its dynamic type is a StaticSemantics::SValue
257  }
258 
259  RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver)
260  : BaseSemantics::RiscOperators(state, solver) {
261  name("StaticSemantics");
262  (void) SValue::promote(state->protoval()); // values must have StaticSemantics::SValue dynamic type
263  }
264 
265 public:
268  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
270  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
271  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
272  BaseSemantics::StatePtr state = State::instance(registers, memory);
273  return RiscOperatorsPtr(new RiscOperators(state, solver));
274  }
275 
279  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
280  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
281  }
282 
285  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
286  return RiscOperatorsPtr(new RiscOperators(state, solver));
287  }
288 
290  // Virtual constructors
291 public:
293  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
294  return instance(protoval, solver);
295  }
296 
298  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
299  return instance(state, solver);
300  }
301 
303  // Dynamic pointer casts
304 public:
307  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
308  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
309  ASSERT_not_null(retval);
310  return retval;
311  }
312 
314  // Supporting functions
315 protected:
326  const BaseSemantics::SValuePtr &a);
328  const BaseSemantics::SValuePtr &a,
329  const BaseSemantics::SValuePtr &b);
331  const BaseSemantics::SValuePtr &a,
332  const BaseSemantics::SValuePtr &b,
333  const BaseSemantics::SValuePtr &c);
335  const BaseSemantics::SValuePtr &a,
336  const BaseSemantics::SValuePtr &b,
337  const BaseSemantics::SValuePtr &c,
338  const BaseSemantics::SValuePtr &d);
348 
350  // Override all operator methods from base class. These are the RISC operators that are invoked by a Dispatcher.
351 public:
352  virtual void startInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
353  virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
354  virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
355  virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
356  virtual void hlt() ROSE_OVERRIDE;
357  virtual void cpuid() ROSE_OVERRIDE;
358  virtual BaseSemantics::SValuePtr rdtsc() ROSE_OVERRIDE;
359  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
360  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
361  virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr &a_,
362  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
363  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
364  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
365  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
366  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
367  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
368  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
369  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
370  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
371  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
372  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
373  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
374  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
375  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
376  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
377  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
378  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
379  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
380  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
381  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
382  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
383  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
384  const BaseSemantics::SValuePtr &a_,
385  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
386  virtual BaseSemantics::SValuePtr isEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
387  virtual BaseSemantics::SValuePtr isNotEqual(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
388  virtual BaseSemantics::SValuePtr isUnsignedLessThan(const BaseSemantics::SValuePtr&,
389  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
390  virtual BaseSemantics::SValuePtr isUnsignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
391  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
392  virtual BaseSemantics::SValuePtr isUnsignedGreaterThan(const BaseSemantics::SValuePtr&,
393  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
394  virtual BaseSemantics::SValuePtr isUnsignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
395  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
396  virtual BaseSemantics::SValuePtr isSignedLessThan(const BaseSemantics::SValuePtr&,
397  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
398  virtual BaseSemantics::SValuePtr isSignedLessThanOrEqual(const BaseSemantics::SValuePtr&,
399  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
400  virtual BaseSemantics::SValuePtr isSignedGreaterThan(const BaseSemantics::SValuePtr&,
401  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
402  virtual BaseSemantics::SValuePtr isSignedGreaterThanOrEqual(const BaseSemantics::SValuePtr&,
403  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
404  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
405  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
406  virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_,
407  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
408  virtual BaseSemantics::SValuePtr subtract(const BaseSemantics::SValuePtr &a_,
409  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
410  virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_,
411  const BaseSemantics::SValuePtr &b_,
412  const BaseSemantics::SValuePtr &c_,
413  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
414  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
415  virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_,
416  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
417  virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_,
418  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
419  virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_,
420  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
421  virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_,
422  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
423  virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_,
424  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
425  virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_,
426  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
427  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
428  virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg,
429  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
430  virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg,
431  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
432  virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE;
433  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg,
434  const BaseSemantics::SValuePtr &addr,
435  const BaseSemantics::SValuePtr &dflt,
436  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
437  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg,
438  const BaseSemantics::SValuePtr &addr,
439  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
440  virtual void writeMemory(RegisterDescriptor segreg,
441  const BaseSemantics::SValuePtr &addr,
442  const BaseSemantics::SValuePtr &data,
443  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
444 };
445 
446 
447 } // namespace
448 } // namespace
449 } // namespace
450 } // namespace
451 
452 #endif
453 #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:9451
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
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:9280
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: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.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
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.