ROSE  0.9.10.89
SymbolicSemantics2.h
1 #ifndef Rose_SymbolicSemantics2_H
2 #define Rose_SymbolicSemantics2_H
3 
4 #ifndef __STDC_FORMAT_MACROS
5 #define __STDC_FORMAT_MACROS
6 #endif
7 #include <inttypes.h>
8 
9 #include "BaseSemantics2.h"
10 #include "Cxx_GrammarSerialization.h"
11 #include "BinarySmtSolver.h"
12 #include "BinarySymbolicExpr.h"
13 #include "RegisterStateGeneric.h"
14 #include "MemoryCellList.h"
15 #include "MemoryCellMap.h"
16 
17 #include <boost/serialization/access.hpp>
18 #include <boost/serialization/base_object.hpp>
19 #include <boost/serialization/export.hpp>
20 #include <boost/serialization/set.hpp>
21 
22 #include <map>
23 #include <vector>
24 
25 namespace Rose {
26 namespace BinaryAnalysis { // documented elsewhere
27 namespace InstructionSemantics2 { // documented elsewhere
28 
47 namespace SymbolicSemantics {
48 
55 typedef std::set<SgAsmInstruction*> InsnSet;
56 
57 
58 
60 // Merging symbolic values
62 
65 
68  size_t setSizeLimit_;
69 protected:
70  Merger(): BaseSemantics::Merger(), setSizeLimit_(1) {}
71 
72 public:
74  typedef MergerPtr Ptr;
75 
77  static Ptr instance() {
78  return Ptr(new Merger);
79  }
80 
82  static Ptr instance(size_t n) {
83  Ptr retval = Ptr(new Merger);
84  retval->setSizeLimit(n);
85  return retval;
86  }
87 
99  size_t setSizeLimit() const { return setSizeLimit_; }
100  void setSizeLimit(size_t n) { setSizeLimit_ = n; }
102 };
103 
104 
105 
107 // Semantic values
109 
112 
115 public:
116  SymbolicExpr::Formatter expr_formatter;
117 };
118 
188 public:
190 
191 protected:
193  ExprPtr expr;
194 
197  InsnSet defs;
198 
200  // Serialization
201 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
202 private:
203  friend class boost::serialization::access;
204 
205  template<class S>
206  void serialize(S &s, const unsigned /*version*/) {
207  roseAstSerializationRegistration(s); // "defs" has SgAsmInstruction ASTs
208  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
209  s & BOOST_SERIALIZATION_NVP(expr);
210  s & BOOST_SERIALIZATION_NVP(defs);
211  }
212 #endif
213 
215  // Real constructors
216 protected:
217  SValue() {} // needed for serialization
218  explicit SValue(size_t nbits): BaseSemantics::SValue(nbits) {
219  expr = SymbolicExpr::makeVariable(nbits);
220  }
221  SValue(size_t nbits, uint64_t number): BaseSemantics::SValue(nbits) {
222  expr = SymbolicExpr::makeInteger(nbits, number);
223  }
224  SValue(ExprPtr expr): BaseSemantics::SValue(expr->nBits()) {
225  this->expr = expr;
226  }
227 
229  // Static allocating constructors
230 public:
232  static SValuePtr instance() {
234  }
235 
237  static SValuePtr instance_bottom(size_t nbits) {
239  }
240 
242  static SValuePtr instance_undefined(size_t nbits) {
243  return SValuePtr(new SValue(SymbolicExpr::makeVariable(nbits)));
244  }
245 
247  static SValuePtr instance_unspecified(size_t nbits) {
249  }
250 
252  static SValuePtr instance_integer(size_t nbits, uint64_t value) {
253  return SValuePtr(new SValue(SymbolicExpr::makeInteger(nbits, value)));
254  }
255 
257  // Virtual allocating constructors
258 public:
259  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
260  return instance_bottom(nbits);
261  }
262  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
263  return instance_undefined(nbits);
264  }
265  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
266  return instance_unspecified(nbits);
267  }
268  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE {
269  return instance_integer(nbits, value);
270  }
271  virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE {
272  return instance_integer(1, value?1:0);
273  }
274  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
275  SValuePtr retval(new SValue(*this));
276  if (new_width!=0 && new_width!=retval->get_width())
277  retval->set_width(new_width);
278  return retval;
279  }
282  const SmtSolverPtr&) const ROSE_OVERRIDE;
283 
285  // Dynamic pointer casts
286 public:
288  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
289  SValuePtr retval = v.dynamicCast<SValue>();
290  ASSERT_not_null(retval);
291  return retval;
292  }
293 
295  // Override virtual methods...
296 public:
297  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
298  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
299  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
300  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
301 
302  // It's not possible to change the size of a symbolic expression in place. That would require that we recursively change
303  // the size of the SymbolicExpr, which might be shared with many unrelated values whose size we don't want to affect.
304  virtual void set_width(size_t nbits) ROSE_OVERRIDE {
305  ASSERT_require(nbits==get_width());
306  }
307 
308  virtual bool isBottom() const ROSE_OVERRIDE;
309 
310  virtual bool is_number() const ROSE_OVERRIDE {
311  return expr->isNumber();
312  }
313 
314  virtual uint64_t get_number() const ROSE_OVERRIDE;
315 
316  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
317 
318  virtual std::string get_comment() const ROSE_OVERRIDE;
319  virtual void set_comment(const std::string&) const ROSE_OVERRIDE;
320 
322  // Additional methods first declared in this class...
323 public:
331  virtual SValuePtr substitute(const SValuePtr &from, const SValuePtr &to, const SmtSolverPtr &solver) const;
332 
339  virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1, const InsnSet &set2, const InsnSet &set3) {
341  defined_by(insn, set1, set2);
342  }
343  virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1, const InsnSet &set2) {
345  defined_by(insn, set1);
346  }
347  virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1) {
349  defined_by(insn);
350  }
351  virtual void defined_by(SgAsmInstruction *insn) {
353  }
359  virtual const ExprPtr& get_expression() const {
360  return expr;
361  }
362 
365  virtual void set_expression(const ExprPtr &new_expr) {
366  ASSERT_not_null(new_expr);
367  expr = new_expr;
368  width = new_expr->nBits();
369  }
370  virtual void set_expression(const SValuePtr &source) {
371  set_expression(source->get_expression());
372  }
389  virtual const InsnSet& get_defining_instructions() const {
390  return defs;
391  }
392 
398  virtual size_t add_defining_instructions(const InsnSet &to_add);
399  virtual size_t add_defining_instructions(const SValuePtr &source) {
400  return add_defining_instructions(source->get_defining_instructions());
401  }
402  virtual size_t add_defining_instructions(SgAsmInstruction *insn);
410  virtual void set_defining_instructions(const InsnSet &new_defs) {
411  defs = new_defs;
412  }
413  virtual void set_defining_instructions(const SValuePtr &source) {
414  set_defining_instructions(source->get_defining_instructions());
415  }
416  virtual void set_defining_instructions(SgAsmInstruction *insn);
418 };
419 
420 
422 // Register state
424 
425 typedef BaseSemantics::RegisterStateGeneric RegisterState;
426 typedef BaseSemantics::RegisterStateGenericPtr RegisterStatePtr;
427 
428 
430 // List-based Memory state
432 
434 typedef boost::shared_ptr<class MemoryListState> MemoryListStatePtr;
435 
453 public:
454  typedef BaseSemantics::MemoryCellList Super;
455 
457  struct CellCompressor {
458  virtual ~CellCompressor() {}
459  virtual SValuePtr operator()(const SValuePtr &address, const BaseSemantics::SValuePtr &dflt,
461  const MemoryCellList::CellList &cells) = 0;
462  };
463 
478  virtual SValuePtr operator()(const SValuePtr &address, const BaseSemantics::SValuePtr &dflt,
480  const CellList &cells) ROSE_OVERRIDE;
481  };
482 
485  virtual SValuePtr operator()(const SValuePtr &address, const BaseSemantics::SValuePtr &dflt,
487  const CellList &cells) ROSE_OVERRIDE;
488  };
489 
494  CellCompressorMcCarthy cc_mccarthy;
495  CellCompressorSimple cc_simple;
496  virtual SValuePtr operator()(const SValuePtr &address, const BaseSemantics::SValuePtr &dflt,
498  const CellList &cells) ROSE_OVERRIDE;
499  };
500 
501 protected:
505  // Serialization
507 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
508 private:
509  friend class boost::serialization::access;
510 
511  template<class S>
512  void serialize(S &s, const unsigned /*version*/) {
513  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
514  }
515 #endif
516 
517 
519  // Real constructors
520 protected:
521  MemoryListState() // for serialization
522  : cell_compressor(&cc_choice) {}
523 
524  explicit MemoryListState(const BaseSemantics::MemoryCellPtr &protocell)
525  : BaseSemantics::MemoryCellList(protocell), cell_compressor(&cc_choice) {}
526 
527  MemoryListState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
528  : BaseSemantics::MemoryCellList(addrProtoval, valProtoval), cell_compressor(&cc_choice) {}
529 
530  MemoryListState(const MemoryListState &other)
531  : BaseSemantics::MemoryCellList(other), cell_compressor(other.cell_compressor) {}
532 
534  // Static allocating constructors
535 public:
537  static MemoryListStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell) {
538  return MemoryListStatePtr(new MemoryListState(protocell));
539  }
540 
543  static MemoryListStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval,
544  const BaseSemantics::SValuePtr &valProtoval) {
545  return MemoryListStatePtr(new MemoryListState(addrProtoval, valProtoval));
546  }
547 
549  static MemoryListStatePtr instance(const MemoryListStatePtr &other) {
550  return MemoryListStatePtr(new MemoryListState(*other));
551  }
552 
554  // Virtual constructors
555 public:
559  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
560  return instance(addrProtoval, valProtoval);
561  }
562 
564  virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const ROSE_OVERRIDE {
565  return instance(protocell);
566  }
567 
569  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
571  }
572 
574  // Dynamic pointer casts
575 public:
578  static MemoryListStatePtr promote(const BaseSemantics::MemoryStatePtr &x) {
579  MemoryListStatePtr retval = boost::dynamic_pointer_cast<MemoryListState>(x);
580  ASSERT_not_null(retval);
581  return retval;
582  }
583 
585  // Methods we inherited
586 public:
592  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
593 
599  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
600 
604  virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value,
605  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
606 
607 protected:
608  virtual BaseSemantics::SValuePtr readOrPeekMemory(const BaseSemantics::SValuePtr &address,
609  const BaseSemantics::SValuePtr &dflt,
612  bool allowSideEffects);
613 
615  // Methods first declared in this class
616 public:
621  void set_cell_compressor(CellCompressor *cc) { cell_compressor = cc; }
623 };
624 
625 
627 // Map-based Memory state
629 
631 typedef boost::shared_ptr<class MemoryMapState> MemoryMapStatePtr;
632 
651 public:
652  typedef BaseSemantics::MemoryCellMap Super;
653 
655  // Serialization
656 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
657 private:
658  friend class boost::serialization::access;
659 
660  template<class S>
661  void serialize(S &s, const unsigned /*version*/) {
662  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
663  }
664 #endif
665 
667  // Real constructors
668 protected:
669  MemoryMapState() {} // for serialization
670 
671  explicit MemoryMapState(const BaseSemantics::MemoryCellPtr &protocell)
672  : BaseSemantics::MemoryCellMap(protocell) {}
673 
674  MemoryMapState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
675  : BaseSemantics::MemoryCellMap(addrProtoval, valProtoval) {}
676 
678  // Static allocating constructors
679 public:
681  static MemoryMapStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell) {
682  return MemoryMapStatePtr(new MemoryMapState(protocell));
683  }
684 
687  static MemoryMapStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval,
688  const BaseSemantics::SValuePtr &valProtoval) {
689  return MemoryMapStatePtr(new MemoryMapState(addrProtoval, valProtoval));
690  }
691 
693  static MemoryMapStatePtr instance(const MemoryMapStatePtr &other) {
694  return MemoryMapStatePtr(new MemoryMapState(*other));
695  }
696 
698  // Virtual constructors
699 public:
703  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
704  return instance(addrProtoval, valProtoval);
705  }
706 
709  return instance(protocell);
710  }
711 
713  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
715  }
716 
718  // Dynamic pointer casts
719 public:
722  static MemoryMapStatePtr promote(const BaseSemantics::MemoryStatePtr &x) {
723  MemoryMapStatePtr retval = boost::dynamic_pointer_cast<MemoryMapState>(x);
724  ASSERT_not_null(retval);
725  return retval;
726  }
727 
729  // Methods we override from the super class (documented in the super class)
730 public:
731  virtual CellKey generateCellKey(const BaseSemantics::SValuePtr &addr_) const ROSE_OVERRIDE;
732 };
733 
734 
735 
737 // Default memory state
739 
740 // List-base memory was the type originally used by this domain. We must keep it that way because some analysis, including 3rd
741 // party, assumes that the state is list-based. New analysis can use the map-based state by instantiating it when the symbolic
742 // risc operators are constructed.
743 typedef MemoryListState MemoryState;
744 typedef MemoryListStatePtr MemoryStatePtr;
745 
747 // Complete state
749 
750 typedef BaseSemantics::State State;
751 typedef BaseSemantics::StatePtr StatePtr;
752 
753 
755 // RISC operators
757 
763 };
764 
770 };
771 
773 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
774 
795 public:
796  typedef BaseSemantics::RiscOperators Super;
797 
798 protected:
799  bool omit_cur_insn; // if true, do not include cur_insn as a definer
800  DefinersMode computingDefiners_; // whether to track definers (instruction VAs) of SValues
801  WritersMode computingMemoryWriters_; // whether to track writers (instruction VAs) to memory.
802  WritersMode computingRegisterWriters_; // whether to track writers (instruction VAs) to registers.
803  size_t trimThreshold_; // max size of expressions (zero means no maximimum)
804 
806  // Serialization
807 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
808 private:
809  friend class boost::serialization::access;
810 
811  template<class S>
812  void serialize(S &s, const unsigned /*version*/) {
813  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
814  s & BOOST_SERIALIZATION_NVP(omit_cur_insn);
815  s & BOOST_SERIALIZATION_NVP(computingDefiners_);
816  s & BOOST_SERIALIZATION_NVP(computingMemoryWriters_);
817  s & BOOST_SERIALIZATION_NVP(computingRegisterWriters_);
818  s & BOOST_SERIALIZATION_NVP(trimThreshold_);
819  }
820 #endif
821 
823  // Real constructors
824 protected:
825  RiscOperators() // for serialization
826  : omit_cur_insn(false), computingDefiners_(TRACK_NO_DEFINERS), computingMemoryWriters_(TRACK_LATEST_WRITER),
827  computingRegisterWriters_(TRACK_LATEST_WRITER), trimThreshold_(0) {}
828 
830  : BaseSemantics::RiscOperators(protoval, solver), omit_cur_insn(false), computingDefiners_(TRACK_NO_DEFINERS),
831  computingMemoryWriters_(TRACK_LATEST_WRITER), computingRegisterWriters_(TRACK_LATEST_WRITER), trimThreshold_(0) {
832  name("Symbolic");
833  ASSERT_always_not_null(protoval);
834  ASSERT_always_not_null2(protoval.dynamicCast<SValue>(),
835  "SymbolicSemantics supports only symbolic SValue types or derivatives thereof");
836  }
837 
838  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
839  : BaseSemantics::RiscOperators(state, solver), omit_cur_insn(false), computingDefiners_(TRACK_NO_DEFINERS),
840  computingMemoryWriters_(TRACK_LATEST_WRITER), computingRegisterWriters_(TRACK_LATEST_WRITER), trimThreshold_(0) {
841  name("Symbolic");
842  ASSERT_always_not_null(state);
843  ASSERT_always_not_null(state->registerState());
844  ASSERT_always_not_null2(boost::dynamic_pointer_cast<RegisterState>(state->registerState()),
845  "SymbolicSemantics supports only RegisterStateGeneric or derivatives thereof");
846  ASSERT_always_not_null(state->protoval());
847  ASSERT_always_not_null2(state->protoval().dynamicCast<SValue>(),
848  "SymbolicSemantics supports only symbolic SValue types or derivatives thereof");
849  }
850 
852  // Static allocating constructors
853 public:
856  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
858  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
859  BaseSemantics::MemoryStatePtr memory = MemoryListState::instance(protoval, protoval);
860  BaseSemantics::StatePtr state = State::instance(registers, memory);
861  return RiscOperatorsPtr(new RiscOperators(state, solver));
862  }
863 
866  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
867  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
868  }
869 
872  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
873  return RiscOperatorsPtr(new RiscOperators(state, solver));
874  }
875 
877  // Virtual constructors
878 public:
880  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
881  return instance(protoval, solver);
882  }
883 
885  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
886  return instance(state, solver);
887  }
888 
890  // Dynamic pointer casts
891 public:
894  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
895  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
896  ASSERT_not_null(retval);
897  return retval;
898  }
899 
901  // Inherited methods for constructing values.
902 public:
903  virtual BaseSemantics::SValuePtr boolean_(bool b) ROSE_OVERRIDE {
905  if (computingDefiners() != TRACK_NO_DEFINERS && !omit_cur_insn)
906  retval->defined_by(currentInstruction());
907  return retval;
908  }
909 
910  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) ROSE_OVERRIDE {
911  SValuePtr retval = SValue::promote(BaseSemantics::RiscOperators::number_(nbits, value));
912  if (computingDefiners() != TRACK_NO_DEFINERS && !omit_cur_insn)
913  retval->defined_by(currentInstruction());
914  return retval;
915  }
916 
918  // New methods for constructing values, so we don't have to write so many SValue::promote calls in the RiscOperators
919  // implementations.
920 protected:
921  SValuePtr svalue_expr(const ExprPtr &expr, const InsnSet &defs=InsnSet()) {
922  SValuePtr newval = SValue::promote(protoval()->undefined_(expr->nBits()));
923  newval->set_expression(expr);
924  newval->set_defining_instructions(defs);
925  return newval;
926  }
927 
928  SValuePtr svalue_undefined(size_t nbits) {
929  return SValue::promote(undefined_(nbits));
930  }
931 
932  SValuePtr svalue_bottom(size_t nbits) {
933  return SValue::promote(bottom_(nbits));
934  }
935 
936  SValuePtr svalue_unspecified(size_t nbits) {
937  return SValue::promote(unspecified_(nbits));
938  }
939 
940  SValuePtr svalue_number(size_t nbits, uint64_t value) {
941  return SValue::promote(number_(nbits, value));
942  }
943 
944  SValuePtr svalue_boolean(bool b) {
945  return SValue::promote(boolean_(b));
946  }
947 
949  // Configuration properties
950 public:
951 
952  // [Robb P. Matzke 2015-09-17] deprecated API
953  bool computingUseDef() const ROSE_DEPRECATED("use computingDefiners instead") {
955  }
956  void computingUseDef(bool b) ROSE_DEPRECATED("use computingDefiners instead") {
958  }
959 
960  // [Robb P. Matzke 2015-08-10] deprecated API
961  void set_compute_usedef(bool b=true) ROSE_DEPRECATED("use computingDefiners instead") {
963  }
964  void clear_compute_usedef() ROSE_DEPRECATED("use computingDefiners instead") {
966  }
967  bool get_compute_usedef() ROSE_DEPRECATED("use computingDefiners instead") {
969  }
970 
988  void computingDefiners(DefinersMode m) { computingDefiners_ = m; }
989  DefinersMode computingDefiners() const { return computingDefiners_; }
1010  void computingMemoryWriters(WritersMode m) { computingMemoryWriters_ = m; }
1011  WritersMode computingMemoryWriters() const { return computingMemoryWriters_; }
1014  // [Robb P. Matzke 2015-08-10] deprecated API
1015  void set_compute_memwriters(bool b = true) ROSE_DEPRECATED("use computingMemoryWriters instead") {
1017  }
1018  void clear_compute_memwriters() ROSE_DEPRECATED("use computingMemoryWriters instead") {
1020  }
1021  bool get_compute_memwriters() const ROSE_DEPRECATED("use computingMemoryWriters instead") {
1023  }
1024 
1046  void computingRegisterWriters(WritersMode m) { computingRegisterWriters_ = m; }
1047  WritersMode computingRegisterWriters() const { return computingRegisterWriters_; }
1050  // Used internally to control whether cur_insn should be omitted from the list of definers.
1051  bool getset_omit_cur_insn(bool b) { bool retval = omit_cur_insn; omit_cur_insn=b; return retval; }
1052 
1059  void trimThreshold(size_t n) { trimThreshold_ = n; }
1060  size_t trimThreshold() const { return trimThreshold_; }
1063  // Methods first defined at this level of the class hierarchy
1065 public:
1127  virtual void substitute(const SValuePtr &from, const SValuePtr &to);
1128 
1134 
1136  // Override methods from base class. These are the RISC operators that are invoked by a Dispatcher.
1137 public:
1138  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
1140  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1142  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1144  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1145  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
1147  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
1149  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1153  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
1155  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
1157  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
1159  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
1161  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
1162  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
1164  const BaseSemantics::SValuePtr &a_,
1165  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1166  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
1167  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
1169  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1171  const BaseSemantics::SValuePtr &b_,
1172  const BaseSemantics::SValuePtr &c_,
1173  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
1174  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
1176  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1178  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1180  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1182  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1184  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1186  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
1188  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
1190  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
1191  virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
1193  const BaseSemantics::SValuePtr &addr,
1194  const BaseSemantics::SValuePtr &dflt,
1195  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
1197  const BaseSemantics::SValuePtr &addr,
1198  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
1199  virtual void writeMemory(RegisterDescriptor segreg,
1200  const BaseSemantics::SValuePtr &addr,
1201  const BaseSemantics::SValuePtr &data,
1202  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
1203 
1204 protected:
1205  virtual BaseSemantics::SValuePtr readOrPeekMemory(RegisterDescriptor segreg,
1206  const BaseSemantics::SValuePtr &addr,
1207  const BaseSemantics::SValuePtr &dflt,
1208  bool allowSideEffects);
1209 };
1210 
1211 } // namespace
1212 } // namespace
1213 } // namespace
1214 } // namespace
1215 
1216 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1221 #endif
1222 
1223 #endif
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
Sawyer::SharedPointer< class Merger > MergerPtr
Shared-ownership pointer for a merge control object.
void computingDefiners(DefinersMode m)
Property: Track which instructions define a semantic value.
virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Returns position of least significant set bit; zero when no bits are set.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
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 RegisterStateGenericPtr instance(const SValuePtr &protoval, const RegisterDictionary *regdict)
Instantiate a new register state.
boost::shared_ptr< class MemoryCell > MemoryCellPtr
Shared-ownership pointer to a semantic memory cell.
Definition: MemoryCell.h:15
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 or_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise OR of two values.
virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE
Sign extends a value.
virtual void set_defining_instructions(const InsnSet &new_defs)
Set defining instructions.
virtual SgAsmInstruction * currentInstruction() const
Returns current instruction.
static SValuePtr instance_integer(size_t nbits, uint64_t value)
Instantiate a new concrete value.
Leaf node of an expression tree for instruction semantics.
Ptr makeInteger(size_t nbits, uint64_t n, const std::string &comment="", unsigned flags=0)
Leaf constructor.
Defines RISC operators for the SymbolicSemantics domain.
virtual SValuePtr undefined_(size_t nbits)
Returns a new undefined value.
boost::shared_ptr< class RegisterStateGeneric > RegisterStateGenericPtr
Shared-ownership pointer to generic register states.
virtual BaseSemantics::SValuePtr addWithCarries(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) ROSE_OVERRIDE
Add two values of equal size and a carry bit.
virtual void set_expression(const SValuePtr &source)
Changes the expression stored in the value.
static MemoryMapStatePtr promote(const BaseSemantics::MemoryStatePtr &x)
Recasts a base pointer to a symbolic memory state.
Interior node of an expression tree for instruction semantics.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Returns true if two values must be equal.
CellCompressor * cell_compressor
Callback when a memory read aliases multiple memory cells.
static CellCompressorChoice cc_choice
The default cell compressor.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified state.
virtual SValuePtr substitute(const SValuePtr &from, const SValuePtr &to, const SmtSolverPtr &solver) const
Substitute one value for another throughout a value.
virtual BaseSemantics::SValuePtr filterResult(const BaseSemantics::SValuePtr &)
Filters results from RISC operators.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual void set_comment(const std::string &) const ROSE_OVERRIDE
Some subclasses support the ability to add comments to values.
Base class for machine instructions.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to symbolic RISC operations.
virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE
Virtual copy constructor.
Ptr makeVariable(size_t nbits, const std::string &comment="", unsigned flags=0)
Leaf constructor.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const ROSE_OVERRIDE
Virtual constructor.
virtual uint64_t get_number() const ROSE_OVERRIDE
Return the concrete number for this value.
virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1, const InsnSet &set2)
Adds instructions to the list of defining instructions.
virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Returns position of most significant set bit; zero when no bits are set.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Returns true if two values could be equal.
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 ...
void computingRegisterWriters(WritersMode m)
Property: Track latest writer to each register.
virtual bool is_number() const ROSE_OVERRIDE
Determines if the value is a concrete number.
virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Determines whether a value is equal to zero.
Functor for handling a memory read whose address matches more than one memory cell.
virtual size_t add_defining_instructions(const SValuePtr &source)
Adds definitions to the list of defining instructions.
virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
If-then-else.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a SymbolicSemantics value.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
STL namespace.
Holds a value or nothing.
Definition: Optional.h:49
static const unsigned UNSPECIFIED
Value is somehow unspecified.
virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Adds two integers of equal size.
virtual void set_defining_instructions(const SValuePtr &source)
Set defining instructions.
void set_cell_compressor(CellCompressor *cc)
Callback for handling a memory read whose address matches more than one memory cell.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to symbolic operators.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE
Create a new concrete semantic value.
virtual void interrupt(int majr, int minr) ROSE_OVERRIDE
Invoked for instructions that cause an interrupt.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
virtual BaseSemantics::SValuePtr boolean_(bool b) ROSE_OVERRIDE
Returns a Boolean value.
virtual void defined_by(SgAsmInstruction *insn)
Adds instructions to the list of defining instructions.
Main namespace for the ROSE library.
Functor for handling a memory read whose address matches more than one memory cell.
Controls formatting of expression trees when printing.
Describes (part of) a physical CPU register.
virtual void set_expression(const ExprPtr &new_expr)
Changes the expression stored in the value.
static MemoryListStatePtr promote(const BaseSemantics::MemoryStatePtr &x)
Recasts a base pointer to a symbolic memory state.
static MemoryListStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell)
Instantiates a new memory state having specified prototypical cells and value.
virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
One's complement.
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE
Virtual constructor.
Reference-counting smart pointer.
Definition: SharedPointer.h:34
virtual SValuePtr boolean_(bool value)
Returns a Boolean value.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Reads a value from a register.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Writes a value to a register.
Sawyer::SharedPointer< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
static SValuePtr instance_bottom(size_t nbits)
Instantiate a new data-flow bottom value of specified width.
WritersMode computingMemoryWriters() const
Property: Track which instructions write to each memory location.
boost::shared_ptr< class RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
boost::shared_ptr< class State > StatePtr
Shared-ownership pointer to a semantic state.
static MemoryMapStatePtr instance(const BaseSemantics::MemoryCellPtr &protocell)
Instantiates a new memory state having specified prototypical cells and value.
virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Concatenates the bits of two values.
static MemoryMapStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
Instantiates a new memory state having specified prototypical value.
DefinersMode
How to update the list of definers stored in each semantic value.
virtual Sawyer::Optional< BaseSemantics::SValuePtr > createOptionalMerge(const BaseSemantics::SValuePtr &other, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const ROSE_OVERRIDE
Possibly create a new value by merging two existing values.
void computingMemoryWriters(WritersMode m)
Property: Track which instructions write to each memory location.
virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted right logically (no sign bit).
Base classes for instruction semantics.
static const unsigned BOTTOM
Value represents bottom in dataflow analysis.
WritersMode computingRegisterWriters() const
Property: Track latest writer to each register.
static SValuePtr instance_undefined(size_t nbits)
Instantiate a new undefined value of specified width.
virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted left.
Functor for handling a memory read that found more than one cell that might alias the requested addre...
boost::shared_ptr< class MemoryMapState > MemoryMapStatePtr
Shared-ownership pointer to symbolic memory state.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::MemoryCellPtr &protocell) const
Virtual constructor.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) ROSE_OVERRIDE
Returns a number of the specified bit width.
static SValuePtr instance()
Instantiate a new prototypical value.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual const InsnSet & get_defining_instructions() const
Returns the set of instructions that defined this value.
static MemoryListStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
Instantiates a new memory state having specified prototypical value.
DefinersMode computingDefiners() const
Property: Track which instructions define a semantic value.
virtual std::string get_comment() const ROSE_OVERRIDE
Some subclasses support the ability to add comments to values.
virtual const ExprPtr & get_expression() const
Returns the expression stored in this value.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical values.
virtual void substitute(const SValuePtr &from, const SValuePtr &to)
Substitute all occurrences of from with to in the current state.
virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise AND of two values.
virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Rotate bits to the left.
WritersMode
How to update the list of writers stored at each abstract location.
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer for symbolic semantic value.
Defines registers available for a particular architecture.
Definition: Registers.h:32
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
CellCompressor * get_cell_compressor() const
Callback for handling a memory read whose address matches more than one memory cell.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
virtual void set_width(size_t nbits) ROSE_OVERRIDE
Accessor for value width.
virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Rotate bits to the right.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE
Virtual constructor.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
std::list< MemoryCellPtr > CellList
List of memory cells.
static StatePtr instance(const RegisterStatePtr &registers, const MemoryStatePtr &memory)
Instantiate a new state object with specified register and memory states.
size_t trimThreshold() const
Property: Maximum size of expressions.
Type of values manipulated by the SymbolicSemantics domain.
virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Write a byte to memory.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1)
Adds instructions to the list of defining instructions.
static SValuePtr instance_unspecified(size_t nbits)
Instantiate a new unspecified value of specified width.
virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE
Create a new, Boolean value.
virtual CellKey generateCellKey(const BaseSemantics::SValuePtr &addr_) const ROSE_OVERRIDE
Generate a cell lookup key.
virtual size_t get_width() const
Accessor for value width.
virtual BaseSemantics::SValuePtr readMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a byte from memory.
virtual SValuePtr bottom_(size_t nbits)
Returns a data-flow bottom value.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE
Create a new undefined semantic value.
virtual size_t add_defining_instructions(const InsnSet &to_add)
Adds definitions to the list of defining instructions.
static MemoryMapStatePtr instance(const MemoryMapStatePtr &other)
Instantiates a new deep copy of an existing state.
Base class for symbolic expression nodes.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE
Data-flow bottom value.
virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE
Extracts bits from a value.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE
Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits...
virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE
Virtual copy constructor.
virtual const std::string & name() const
Property: Name used for debugging.
void trimThreshold(size_t n)
Property: Maximum size of expressions.
virtual SValuePtr number_(size_t nbits, uint64_t value)
Returns a number of the specified bit width.
virtual void defined_by(SgAsmInstruction *insn, const InsnSet &set1, const InsnSet &set2, const InsnSet &set3)
Adds instructions to the list of defining instructions.
static MemoryListStatePtr instance(const MemoryListStatePtr &other)
Instantiates a new deep copy of an existing state.
MergerPtr Ptr
Shared-ownership pointer for a Merger object.
virtual BaseSemantics::SValuePtr peekMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a byte from memory with no side effects.
Functor for handling a memory read whose address matches more than one memory cell.
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 BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise XOR of two values.
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Obtain a register value without side effects.
boost::shared_ptr< class MemoryListState > MemoryListStatePtr
Shared-ownership pointer for symbolic list-based memory state.
virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted right arithmetically (with sign bit).