ROSE  0.11.2.0
TraceSemantics2.h
1 #ifndef Rose_TraceSemantics2_H
2 #define Rose_TraceSemantics2_H
3 #include <rosePublicConfig.h>
4 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
5 
6 #include "BaseSemantics2.h"
7 #include "Diagnostics.h"
8 
9 namespace Rose {
10 namespace BinaryAnalysis { // documented elsewhere
11 namespace InstructionSemantics2 { // documented elsewhere
12 
52 namespace TraceSemantics {
53 
54 
56 // Semantic values
58 
59 typedef void SValue;
60 
62 typedef boost::shared_ptr<void> SValuePtr;
63 
64 
66 // Register state
68 
69 typedef void RegisterState;
70 
72 typedef boost::shared_ptr<void> RegisterStatePtr;
73 
74 
76 // Memory state
78 
79 typedef void MemoryState;
80 
82 typedef boost::shared_ptr<void> MemoryStatePtr;
83 
84 
86 // RISC operators
88 
90 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
91 
94  BaseSemantics::RiscOperatorsPtr subdomain_; // Domain to which all our RISC operators chain
95  Sawyer::Message::Stream stream_; // stream to which output is emitted
96  std::string indentation_; // string to print at start of each line
97  bool showingSubdomain_; // show subdomain name and address on each line of output?
98  bool showingInstructionVa_; // show instruction VA on each line of output?
99 
101  // Real constructors.
102 protected:
103  // use the version that takes a subdomain instead of this c'tor
105  : BaseSemantics::RiscOperators(protoval, solver), stream_(mlog[Diagnostics::INFO]), showingSubdomain_(true),
106  showingInstructionVa_(true) {
107  name("Trace");
108  }
109 
110  // use the version that takes a subdomain instead of this c'tor.
111  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
112  : BaseSemantics::RiscOperators(state, solver), stream_(mlog[Diagnostics::INFO]), showingSubdomain_(true),
113  showingInstructionVa_(true) {
114  name("Trace");
115  }
116 
118  : BaseSemantics::RiscOperators(subdomain->currentState(), subdomain->solver()),
119  subdomain_(subdomain), stream_(mlog[Diagnostics::INFO]), showingSubdomain_(true),
120  showingInstructionVa_(true) {
121  name("Trace");
122  }
123 
124 public:
125  virtual ~RiscOperators() {
126  linePrefix();
127  stream_ <<"operators destroyed\n";
128  }
129 
131  // Static allocating constructors.
132 public:
136  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
137  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
138  }
139 
143  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
144  return RiscOperatorsPtr(new RiscOperators(state, solver));
145  }
146 
149  static RiscOperatorsPtr instance(const BaseSemantics::RiscOperatorsPtr &subdomain) {
150  ASSERT_not_null(subdomain);
151  RiscOperatorsPtr self = subdomain->currentState()!=NULL ?
152  RiscOperatorsPtr(new RiscOperators(subdomain->currentState(), subdomain->solver())) :
153  RiscOperatorsPtr(new RiscOperators(subdomain->protoval(), subdomain->solver()));
154  self->subdomain_ = subdomain;
155  return self;
156  }
157 
159  // Virtual constructors
160 public:
162  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
163  return instance(protoval, solver);
164  }
165 
167  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
168  return instance(state, solver);
169  }
170 
173  return instance(subdomain);
174  }
175 
177  // Dynamic pointer casts
178 public:
181  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
182  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
183  ASSERT_not_null(retval);
184  return retval;
185  }
186 
188  // Methods first defined at this level of the class hierarchy
189 public:
193  const BaseSemantics::RiscOperatorsPtr& subdomain() const { return subdomain_; }
194  void subdomain(const BaseSemantics::RiscOperatorsPtr &subdomain) { subdomain_ = subdomain; }
200  void checkSubdomain() const {
201  if (subdomain_==NULL)
202  throw BaseSemantics::Exception("subdomain is not set; nothing to trace", NULL);
203  }
210  Sawyer::Message::Stream& stream() { return stream_; }
211  void stream(Sawyer::Message::Stream &s) { stream_ = s; }
219  const std::string& indentation() const { return indentation_; }
220  void indentation(const std::string &s) { indentation_ = s; }
228  bool showingSubdomain() const { return showingSubdomain_; }
229  void showingSubdomain(bool b) { showingSubdomain_ = b; }
237  bool showingInstructionVa() const { return showingInstructionVa_; }
238  void showingInstructionVa(bool b) { showingInstructionVa_ = b; }
241 protected:
242  void linePrefix();
243  std::string toString(const BaseSemantics::SValuePtr&);
244  std::string toString(SgAsmFloatType*);
245  void check_equal_widths(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
246  const BaseSemantics::SValuePtr &check_width(const BaseSemantics::SValuePtr &a, size_t nbits,
247  const std::string &what="result");
248  std::string register_name(RegisterDescriptor);
249 
250  void before(const std::string&);
251  void before(const std::string&, RegisterDescriptor);
252  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&);
253  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
254  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
255  size_t);
256  void before(const std::string&, RegisterDescriptor, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
257  const BaseSemantics::SValuePtr&);
258  void before(const std::string&, SgAsmInstruction*, bool showAddress);
259  void before(const std::string&, size_t);
260  void before(const std::string&, size_t, uint64_t);
261  void before(const std::string&, const BaseSemantics::SValuePtr&);
262  void before(const std::string&, const BaseSemantics::SValuePtr&, size_t);
263  void before(const std::string&, const BaseSemantics::SValuePtr&, size_t, size_t);
264  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&);
265  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
266  const BaseSemantics::SValuePtr&);
267  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*);
268  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*, const BaseSemantics::SValuePtr&);
269  void before(const std::string&, const BaseSemantics::SValuePtr&, SgAsmFloatType*, SgAsmFloatType*);
270  void before(const std::string&, const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&, SgAsmFloatType*);
271 
272  void after();
275  void after(const BaseSemantics::Exception&);
276  void after_exception();
277 
279  // Methods we override from our super class
280 public:
281  virtual BaseSemantics::SValuePtr protoval() const ROSE_OVERRIDE;
282  virtual void solver(const SmtSolverPtr&) ROSE_OVERRIDE;
283  virtual SmtSolverPtr solver() const ROSE_OVERRIDE;
284  virtual BaseSemantics::StatePtr currentState() const ROSE_OVERRIDE;
285  virtual void currentState(const BaseSemantics::StatePtr&) ROSE_OVERRIDE;
286  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
287  virtual size_t nInsns() const ROSE_OVERRIDE;
288  virtual void nInsns(size_t n) ROSE_OVERRIDE;
289  virtual SgAsmInstruction* currentInstruction() const ROSE_OVERRIDE;
290  virtual void startInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
291  virtual void finishInstruction(SgAsmInstruction*) ROSE_OVERRIDE;
292 
293  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) ROSE_OVERRIDE;
294  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) ROSE_OVERRIDE;
295  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) ROSE_OVERRIDE;
296  virtual BaseSemantics::SValuePtr boolean_(bool value) ROSE_OVERRIDE;
297  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) ROSE_OVERRIDE;
298 
299  virtual BaseSemantics::SValuePtr filterCallTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
300  virtual BaseSemantics::SValuePtr filterReturnTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
301  virtual BaseSemantics::SValuePtr filterIndirectJumpTarget(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
302  virtual void hlt() ROSE_OVERRIDE;
303  virtual void cpuid() ROSE_OVERRIDE;
304  virtual BaseSemantics::SValuePtr rdtsc() ROSE_OVERRIDE;
305 
306  // The actual RISC operators. These are pure virtual in the base class
307  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
308  virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
309  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
310  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
311  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr&, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
312  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
313  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
314  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
315  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
316  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
317  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
318  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
319  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr&,
320  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
321  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
322  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
323  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
324  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr&, size_t nbits) ROSE_OVERRIDE;
325  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr&, size_t nbits) ROSE_OVERRIDE;
326  virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
327  virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
328  const BaseSemantics::SValuePtr&,
329  BaseSemantics::SValuePtr&/*out*/) ROSE_OVERRIDE;
330  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
331  virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
332  virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
333  virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr&,
334  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
335  virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr&,
336  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
337  virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr&,
338  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
339  virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr&,
340  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
341 
342  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
343 
344  virtual BaseSemantics::SValuePtr fpFromInteger(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
345  virtual BaseSemantics::SValuePtr fpToInteger(const BaseSemantics::SValuePtr&, SgAsmFloatType*,
346  const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
347  virtual BaseSemantics::SValuePtr fpConvert(const BaseSemantics::SValuePtr&, SgAsmFloatType*, SgAsmFloatType*) ROSE_OVERRIDE;
348  virtual BaseSemantics::SValuePtr fpIsNan(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
349  virtual BaseSemantics::SValuePtr fpIsDenormalized(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
350  virtual BaseSemantics::SValuePtr fpIsZero(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
351  virtual BaseSemantics::SValuePtr fpIsInfinity(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
352  virtual BaseSemantics::SValuePtr fpSign(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
353  virtual BaseSemantics::SValuePtr fpEffectiveExponent(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
354  virtual BaseSemantics::SValuePtr fpAdd(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
355  SgAsmFloatType*) ROSE_OVERRIDE;
356  virtual BaseSemantics::SValuePtr fpSubtract(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
357  SgAsmFloatType*) ROSE_OVERRIDE;
358  virtual BaseSemantics::SValuePtr fpMultiply(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
359  SgAsmFloatType*) ROSE_OVERRIDE;
360  virtual BaseSemantics::SValuePtr fpDivide(const BaseSemantics::SValuePtr&, const BaseSemantics::SValuePtr&,
361  SgAsmFloatType*) ROSE_OVERRIDE;
362  virtual BaseSemantics::SValuePtr fpSquareRoot(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
363  virtual BaseSemantics::SValuePtr fpRoundTowardZero(const BaseSemantics::SValuePtr&, SgAsmFloatType*) ROSE_OVERRIDE;
364 
365  virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor,
366  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
367  virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor,
368  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
369  virtual void writeRegister(RegisterDescriptor, const BaseSemantics::SValuePtr&) ROSE_OVERRIDE;
370  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
371  const BaseSemantics::SValuePtr &dflt,
372  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
373  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
374  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
375  virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr,
376  const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
377 };
378 
379 } // namespace
380 } // namespace
381 } // namespace
382 } // namespace
383 
384 #endif
385 #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.
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.
Sawyer::SharedPointer< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
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.
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.
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.
Base class for exceptions thrown by instruction semantics.
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.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Reads a value from a register.