ROSE  0.11.145.0
OutOfBoundsTag.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_OutOfBoundsTag_H
2 #define ROSE_BinaryAnalysis_ModelChecker_OutOfBoundsTag_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_MODEL_CHECKER
5 
6 #include <Rose/BinaryAnalysis/ModelChecker/Tag.h>
7 #include <Rose/BinaryAnalysis/ModelChecker/Variables.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
9 #include <Rose/BinaryAnalysis/Variables.h>
10 
11 namespace Rose {
12 namespace BinaryAnalysis {
13 namespace ModelChecker {
14 
16 class OutOfBoundsTag: public Tag {
17 public:
18  using Ptr = OutOfBoundsTagPtr;
19 
20 private:
21  const TestMode testMode_; // may or must, but not off
22  const IoMode ioMode_; // read or write
23  const SgAsmInstruction *insn_; // instruction where the oob access occurs (optional)
24  const InstructionSemantics::BaseSemantics::SValuePtr addr_; // memory address that is accessed
25  const FoundVariable intendedVariable_; // variable that was incorrectly accessed
26  const FoundVariable accessedVariable_; // optional info about variable actually accessed
27 
28 protected:
29  OutOfBoundsTag() = delete;
30  OutOfBoundsTag(size_t nodeStep, TestMode, IoMode, SgAsmInstruction*,
32  const FoundVariable &intendedVariable, const FoundVariable &accessedVariable);
33 
34  OutOfBoundsTag(const OutOfBoundsTag&) = delete;
35 
36 public:
37  ~OutOfBoundsTag();
38 
49  static Ptr instance(size_t nodeStep, TestMode, IoMode, SgAsmInstruction*,
51  const FoundVariable &intendedVariable, const FoundVariable &accessedVariable);
52 
53 public:
54  virtual std::string name() const override;
55  virtual std::string printableName() const override;
56  virtual void print(std::ostream&, const std::string &prefix) const override;
57  virtual void toYaml(std::ostream&, const std::string &prefix) const override;
58 };
59 
60 } // namespace
61 } // namespace
62 } // namespace
63 
64 #endif
65 #endif
const char * TestMode(int64_t)
Convert Rose::BinaryAnalysis::ModelChecker::TestMode enum constant to a string.
Base class for machine instructions.
const char * IoMode(int64_t)
Convert Rose::BinaryAnalysis::FeasiblePath::IoMode enum constant to a string.
Main namespace for the ROSE library.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.