ROSE  0.11.83.2
OobTag.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_OobTag_H
2 #define ROSE_BinaryAnalysis_ModelChecker_OobTag_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/ModelChecker/Tag.h>
7 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics/Types.h>
8 #include <Rose/BinaryAnalysis/Variables.h>
9 
10 namespace Rose {
11 namespace BinaryAnalysis {
12 namespace ModelChecker {
13 
15 class OobTag: public Tag {
16 public:
17  using Ptr = OobTagPtr;
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 InstructionSemantics2::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  OobTag() = delete;
33  const Variables::StackVariable &intendedVariable, const AddressInterval &intendedVariableLocation,
34  const Variables::StackVariable &accessedVariable, const AddressInterval &accessedVariableLocation);
35 
36  OobTag(const OobTag&) = delete;
37 
38 public:
39  ~OobTag();
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
Base class for machine instructions.
virtual void print(std::ostream &, const std::string &prefix) const override
Print multi-line information about the tag.
TestMode
Mode by which comparisons are made.
virtual void toYaml(std::ostream &, const std::string &prefix) const override
Print multi-line information about the tag in YAML format.
Main namespace for the ROSE library.
static Ptr instance(size_t nodeStep, TestMode, IoMode, SgAsmInstruction *, const InstructionSemantics2::BaseSemantics::SValuePtr &addr, const Variables::StackVariable &intendedVariable, const AddressInterval &intendedVariableLocation, const Variables::StackVariable &accessedVariable, const AddressInterval &accessedVariableLocation)
Allocating constructor.
IoMode
Direction of data wrt storage.
Information tagged to a path node.
Definition: Tag.h:22
size_t nodeStep() const
Property: Node step.
Tag that describes an out-of-bounds memory access.
Definition: OobTag.h:15
virtual std::string name() const override
Property: Generic name of tag.
Description of a local stack variable within a function.
Definition: Variables.h:146
virtual std::string printableName() const override
String to identify this tag.