ROSE  0.11.50.0
TraceSemantics.h
1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_TraceSemantics_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics2_TraceSemantics_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics.h>
7 #include <Rose/BinaryAnalysis/InstructionSemantics2/Util.h>
8 #include <Rose/Diagnostics.h>
9 
10 namespace Rose {
11 namespace BinaryAnalysis { // documented elsewhere
12 namespace InstructionSemantics2 { // documented elsewhere
13 
53 namespace TraceSemantics {
54 
55 
57 // Semantic values
59 
60 typedef void SValue;
61 
63 typedef boost::shared_ptr<void> SValuePtr;
64 
65 
67 // Register state
69 
70 typedef void RegisterState;
71 
73 typedef boost::shared_ptr<void> RegisterStatePtr;
74 
75 
77 // Memory state
79 
80 typedef void MemoryState;
81 
83 typedef boost::shared_ptr<void> MemoryStatePtr;
84 
85 
87 // RISC operators
89 
91 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
92 
95 public:
98 
101 
102 private:
103  BaseSemantics::RiscOperatorsPtr subdomain_; // Domain to which all our RISC operators chain
104  Sawyer::Message::Stream stream_; // stream to which output is emitted
105  std::string indentation_; // string to print at start of each line
106  bool showingSubdomain_ = true; // show subdomain name and address on each line of output?
107  bool showingInstructionVa_ = true; // show instruction VA on each line of output?
108  bool onlyInstructions_ = true; // trace only operations associated with an instruction.
109 
111  // Real constructors.
112 protected:
113  // use the version that takes a subdomain instead of this c'tor
115  : BaseSemantics::RiscOperators(protoval, solver), stream_(mlog[Diagnostics::INFO]) {
116  name("Trace");
117  }
118 
119  // use the version that takes a subdomain instead of this c'tor.
120  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
121  : BaseSemantics::RiscOperators(state, solver), stream_(mlog[Diagnostics::INFO]) {
122  name("Trace");
123  }
124 
125  explicit RiscOperators(const BaseSemantics::RiscOperatorsPtr &subdomain)
126  : BaseSemantics::RiscOperators(subdomain->currentState(), subdomain->solver()),
127  subdomain_(subdomain), stream_(mlog[Diagnostics::INFO]) {
128  name("Trace");
129  }
130 
131 public:
132  virtual ~RiscOperators() {
133  linePrefix();
134  stream_ <<"operators destroyed\n";
135  }
136 
138  // Static allocating constructors.
139 public:
143  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
144  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
145  }
146 
150  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
151  return RiscOperatorsPtr(new RiscOperators(state, solver));
152  }
153 
156  static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &subdomain) {
157  ASSERT_not_null(subdomain);
158  RiscOperatorsPtr self = subdomain->currentState()!=NULL ?
159  RiscOperatorsPtr(new RiscOperators(subdomain->currentState(), subdomain->solver())) :
160  RiscOperatorsPtr(new RiscOperators(subdomain->protoval(), subdomain->solver()));
161  self->subdomain_ = subdomain;
162  return self;
163  }
164 
166  // Virtual constructors
167 public:
169  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
170  return instance(protoval, solver);
171  }
172 
174  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
175  return instance(state, solver);
176  }
177 
180  return instance(subdomain);
181  }
182 
184  // Dynamic pointer casts
185 public:
188  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
189  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
190  ASSERT_not_null(retval);
191  return retval;
192  }
193 
195  // Methods first defined at this level of the class hierarchy
196 public:
200  const BaseSemantics::RiscOperatorsPtr& subdomain() const { return subdomain_; }
207  void checkSubdomain() const {
208  if (subdomain_==NULL)
209  throw BaseSemantics::Exception("subdomain is not set; nothing to trace", NULL);
210  }
217  Sawyer::Message::Stream& stream() { return stream_; }
218  void stream(Sawyer::Message::Stream &s) { stream_ = s; }
226  const std::string& indentation() const { return indentation_; }
227  void indentation(const std::string &s) { indentation_ = s; }
235  bool showingSubdomain() const { return showingSubdomain_; }
236  void showingSubdomain(bool b) { showingSubdomain_ = b; }
244  bool showingInstructionVa() const { return showingInstructionVa_; }
245  void showingInstructionVa(bool b) { showingInstructionVa_ = b; }
256  bool onlyInstructions() const { return onlyInstructions_; }
257  void onlyInstructions(bool b) { onlyInstructions_ = b; }
260 protected:
261  void linePrefix();
262  std::string toString(const BaseSemantics::SValuePtr&);
263  std::string toString(SgAsmFloatType*);
264  void check_equal_widths(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
265  const BaseSemantics::SValuePtr &check_width(const BaseSemantics::SValuePtr &a, size_t nbits,
266  const std::string &what="result");
267  std::string register_name(RegisterDescriptor);
268 
269  bool shouldPrint() const;
270  bool shouldPrint(SgAsmInstruction*) const;
271 
272  void before(const std::string&);
273  void before(const std::string&, RegisterDescriptor);
274  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&);
275  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
276  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
277  size_t);
278  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
279  const BaseSemantics::SValuePtr&);
280  void before(const std::string&, SgAsmInstruction*, bool showAddress);
281  void before(const std::string&, size_t);
282  void before(const std::string&, size_t, uint64_t);
283  void before(const std::string&, const BaseSemantics::SValuePtr&);
284  void before(const std::string&, const BaseSemantics::SValuePtr&, size_t);
285  void before(const std::string&, const BaseSemantics::SValuePtr&, size_t, size_t);
286  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
287  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
288  const BaseSemantics::SValuePtr&);
289  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*);
290  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*, const BaseSemantics::SValuePtr&);
291  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*, SgAsmFloatType*);
292  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&, SgAsmFloatType*);
293 
294  void after();
295  void after(SgAsmInstruction*);
298  void after(const BaseSemantics::Exception&);
299  void after(const BaseSemantics::Exception&, SgAsmInstruction*);
300  void after_exception();
301  void after_exception(SgAsmInstruction*);
302 
304  // Methods we override from our super class
305 public:
306  virtual BaseSemantics::SValuePtr protoval() const ROSE_OVERRIDE;
307  virtual void solver(const SmtSolverPtr&) ROSE_OVERRIDE;
308  virtual SmtSolverPtr solver() const ROSE_OVERRIDE;
309  virtual BaseSemantics::StatePtr currentState() const ROSE_OVERRIDE;
310  virtual void currentState(const BaseSemantics::StatePtr&) ROSE_OVERRIDE;
311  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
312  virtual size_t nInsns() const ROSE_OVERRIDE;
313  virtual void nInsns(size_t n) ROSE_OVERRIDE;
314  virtual SgAsmInstruction* currentInstruction() const ROSE_OVERRIDE;
315  virtual void startInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
316  virtual void finishInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
317 
318  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) ROSE_OVERRIDE;
319  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) ROSE_OVERRIDE;
320  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) ROSE_OVERRIDE;
321  virtual BaseSemantics::SValuePtr boolean_(bool value) ROSE_OVERRIDE;
322  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) ROSE_OVERRIDE;
323 
324  virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
325  virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
326  virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
327  virtual void hlt() ROSE_OVERRIDE;
328  virtual void cpuid() ROSE_OVERRIDE;
329  virtual BaseSemantics::SValuePtr rdtsc() ROSE_OVERRIDE;
330 
331  // The actual RISC operators. These are pure virtual in the base class
332  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
333  virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
334  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
335  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
336  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr&, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
337  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
338  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
339  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
340  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
341  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
342  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
343  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
344  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr&,
345  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
346  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
347  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
348  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
349  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr&, size_t nbits) ROSE_OVERRIDE;
350  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr&, size_t nbits) ROSE_OVERRIDE;
351  virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
352  virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
353  const BaseSemantics::SValuePtr&,
354  BaseSemantics::SValuePtr&/*out*/) ROSE_OVERRIDE;
355  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
356  virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
357  virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
358  virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr&,
359  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
360  virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr&,
361  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
362  virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr&,
363  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
364  virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr&,
365  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
366 
367  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
368 
369  virtual BaseSemantics::SValuePtr fpFromInteger(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
370  virtual BaseSemantics::SValuePtr fpToInteger(const BaseSemantics::SValuePtr&, SgAsmFloatType*,
371  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
372  virtual BaseSemantics::SValuePtr fpConvert(const BaseSemantics::SValuePtr&, SgAsmFloatType*, SgAsmFloatType*) ROSE_OVERRIDE;
373  virtual BaseSemantics::SValuePtr fpIsNan(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
374  virtual BaseSemantics::SValuePtr fpIsDenormalized(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
375  virtual BaseSemantics::SValuePtr fpIsZero(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
376  virtual BaseSemantics::SValuePtr fpIsInfinity(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
377  virtual BaseSemantics::SValuePtr fpSign(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
378  virtual BaseSemantics::SValuePtr fpEffectiveExponent(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
379  virtual BaseSemantics::SValuePtr fpAdd(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
380  SgAsmFloatType*) ROSE_OVERRIDE;
381  virtual BaseSemantics::SValuePtr fpSubtract(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
382  SgAsmFloatType*) ROSE_OVERRIDE;
383  virtual BaseSemantics::SValuePtr fpMultiply(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
384  SgAsmFloatType*) ROSE_OVERRIDE;
385  virtual BaseSemantics::SValuePtr fpDivide(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
386  SgAsmFloatType*) ROSE_OVERRIDE;
387  virtual BaseSemantics::SValuePtr fpSquareRoot(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
388  virtual BaseSemantics::SValuePtr fpRoundTowardZero(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
389 
390  virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor,
391  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
392  virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor,
393  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
394  virtual void writeRegister(RegisterDescriptor, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
395  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
396  const BaseSemantics::SValuePtr &dflt,
397  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
398  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
399  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
400  virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
401  const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
402 };
403 
404 } // namespace
405 } // namespace
406 } // namespace
407 } // namespace
408 
409 #endif
410 #endif
virtual BaseSemantics::SValuePtr fpMultiply(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Multiply two floating-point values.
virtual BaseSemantics::SValuePtr fpSubtract(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Subtract one floating-point value from another.
boost::shared_ptr< void > RegisterStatePtr
Shared-ownership pointer to trace-semantics register state.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Obtain a register value without side effects.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::RiscOperatorsPtr &subdomain)
Wraps a subdomain's RISC operators to add tracing.
virtual SmtSolverPtr solver() const ROSE_OVERRIDE
Property: Satisfiability module theory (SMT) solver.
virtual BaseSemantics::SValuePtr fpDivide(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Divide one floating-point value by another.
virtual BaseSemantics::SValuePtr fpSign(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Sign of floating-point value.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Divides two signed values.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
void subdomain(const BaseSemantics::RiscOperatorsPtr &subdomain)
Property: Subdomain to which operations are forwarded.
bool onlyInstructions() const
Property: Show only operations for instructions.
Base class for machine instructions.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object.
virtual BaseSemantics::SValuePtr fpAdd(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Add two floating-point values.
STL namespace.
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Calculates modulo with signed values.
virtual BaseSemantics::SValuePtr fpEffectiveExponent(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Exponent of floating-point value.
virtual BaseSemantics::SValuePtr fpIsNan(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Whether a floating-point value is a special not-a-number bit pattern.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to trace-semantics RISC operations.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Divides two unsigned values.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Two's complement.
void showingInstructionVa(bool b)
Property: Show instruction in output.
void showingSubdomain(bool b)
Property: Show subdomain name in output.
virtual BaseSemantics::SValuePtr fpIsInfinity(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Whether a floating-point value is infinity.
Main namespace for the ROSE library.
virtual void interrupt(int majr, int minr) ROSE_OVERRIDE
Invoked for instructions that cause an interrupt.
virtual BaseSemantics::SValuePtr fpToInteger(const BaseSemantics::SValuePtr &, SgAsmFloatType *, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Construct an integer value from a floating-point value.
boost::shared_ptr< void > MemoryStatePtr
Shared-ownership pointer to trace-semantics memory state.
bool showingSubdomain() const
Property: Show subdomain name in output.
void stream(Sawyer::Message::Stream &s)
Property: output stream to which tracing is emitted.
virtual BaseSemantics::SValuePtr protoval() const ROSE_OVERRIDE
Property: Prototypical semantic value.
Sawyer::Message::Stream & stream()
Property: output stream to which tracing is emitted.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Multiplies two signed values.
void onlyInstructions(bool b)
Property: Show only operations for instructions.
virtual BaseSemantics::SValuePtr fpSquareRoot(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Square root.
Describes (part of) a physical CPU register.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to trace operators.
Sawyer::Message::Facility mlog
Diagnostics logging facility for instruction semantics.
void indentation(const std::string &s)
Property: Line prefix string.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print multi-line output for this object.
virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Used for printing RISC operators with formatting.
virtual void writeRegister(RegisterDescriptor, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Writes a value to a register.
Base class for most instruction semantics RISC operators.
Definition: RiscOperators.h:48
virtual BaseSemantics::SValuePtr fpConvert(const BaseSemantics::SValuePtr &, SgAsmFloatType *, SgAsmFloatType *) ROSE_OVERRIDE
Convert from one floating-point type to another.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object.
virtual BaseSemantics::StatePtr currentState() const ROSE_OVERRIDE
Property: Current semantic state.
const std::string & indentation() const
Property: Line prefix string.
virtual BaseSemantics::SValuePtr fpIsZero(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Whether a floating-point value is equal to zero.
const BaseSemantics::RiscOperatorsPtr & subdomain() const
Property: Subdomain to which operations are forwarded.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Calculates modulo with unsigned values.
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.
Converts text to messages.
Definition: Message.h:1396
virtual const std::string & name() const
Property: Name used for debugging.
virtual BaseSemantics::SValuePtr fpRoundTowardZero(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Round toward zero.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
void checkSubdomain() const
Check that we have a valid subdomain.
boost::shared_ptr< void > SValuePtr
Shared-ownership pointer to trace-semantics values.
static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &subdomain)
Instantiate a new RiscOperators object.
Floating point types.
virtual BaseSemantics::SValuePtr fpFromInteger(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Construct a floating-point value from an integer value.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
Multiply two unsigned values.
bool showingInstructionVa() const
Property: Show instruction in output.
virtual BaseSemantics::SValuePtr fpIsDenormalized(const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
Whether a floating-point value is denormalized.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
Definition: SmtSolver.h:25
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Reads a value from a register.