ROSE  0.11.109.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/InstructionSemantics/BaseSemantics/Types.h>
8 #include <Rose/BinaryAnalysis/Variables.h>
9 
10 namespace Rose {
11 namespace BinaryAnalysis {
12 namespace ModelChecker {
13 
15 class OutOfBoundsTag: public Tag {
16 public:
17  using Ptr = OutOfBoundsTagPtr;
18 
19 private:
20  const TestMode testMode_; // may or must, but not off
21  const IoMode ioMode_; // read or write
22  const SgAsmInstruction *insn_; // instruction where the oob access occurs (optional)
23  const InstructionSemantics::BaseSemantics::SValuePtr addr_; // memory address that is accessed
24  const Variables::StackVariable intendedVariable_; // variable that was incorrectly accessed
25  const AddressInterval intendedVariableLocation_; // location and size of stack variable in memory
26  const Variables::StackVariable accessedVariable_; // optional info about variable actually accessed
27  const AddressInterval accessedVariableLocation_; // optional location and size of variable actually accessed
28 
29 protected:
30  OutOfBoundsTag() = delete;
31  OutOfBoundsTag(size_t nodeStep, TestMode, IoMode, SgAsmInstruction*,
33  const Variables::StackVariable &intendedVariable, const AddressInterval &intendedVariableLocation,
34  const Variables::StackVariable &accessedVariable, const AddressInterval &accessedVariableLocation);
35 
36  OutOfBoundsTag(const OutOfBoundsTag&) = delete;
37 
38 public:
39  ~OutOfBoundsTag();
40 
51  static Ptr instance(size_t nodeStep, TestMode, IoMode, SgAsmInstruction*,
53  const Variables::StackVariable &intendedVariable, const AddressInterval &intendedVariableLocation,
54  const Variables::StackVariable &accessedVariable, const AddressInterval &accessedVariableLocation);
55 
56 public:
57  virtual std::string name() const override;
58  virtual std::string printableName() const override;
59  virtual void print(std::ostream&, const std::string &prefix) const override;
60  virtual void toYaml(std::ostream&, const std::string &prefix) const override;
61 };
62 
63 } // namespace
64 } // namespace
65 } // namespace
66 
67 #endif
68 #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.
void print(const StackVariables &, const Partitioner2::Partitioner &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
Main namespace for the ROSE library.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.