ROSE  0.11.50.0
ErrorTag.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_ErrorTag_H
2 #define ROSE_BinaryAnalysis_ModelChecker_ErrorTag_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/ModelChecker/Tag.h>
6 
7 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics/Types.h>
8 #include <Rose/BinaryAnalysis/SymbolicExpr.h>
9 
10 namespace Rose {
11 namespace BinaryAnalysis {
12 namespace ModelChecker {
13 
15 class ErrorTag: public NameTag {
16 public:
17  using Ptr = ErrorTagPtr;
18 
19 protected:
20  const std::string mesg_; // error message
21  SgAsmInstruction* const insn_; // instruction where the error occurs (optional)
22  Sawyer::Optional<uint64_t> concrete_; // optional concrete value
23  const SymbolicExpr::Ptr symbolic_; // optional symbolic value
24  const InstructionSemantics2::BaseSemantics::SValuePtr svalue_; // optional semantic value
25 
26 protected:
27  ErrorTag() = delete;
28  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
30  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
31  const SymbolicExpr::Ptr&);
32  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
34 
35 public:
36  ~ErrorTag();
37 
43  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*);
44  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
45  uint64_t);
46  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
47  const SymbolicExpr::Ptr&);
48  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
55  std::string message() const;
56 
57 public:
58  void print(std::ostream &out, const std::string &prefix) const override;
59  void toYaml(std::ostream &out, const std::string &prefix) const override;
60 };
61 
62 } // namespace
63 } // namespace
64 } // namespace
65 
66 #endif
67 #endif
static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction *)
Allocating constructor.
std::string message() const
Property: Error message.
Base class for machine instructions.
void toYaml(std::ostream &out, const std::string &prefix) const override
Print multi-line information about the tag in YAML format.
Main namespace for the ROSE library.
virtual std::string name() const override
Property: Generic name of tag.
Tag that describes a model checker error.
Definition: ErrorTag.h:15
size_t nodeStep() const
Property: Node step.
Base class for tags that have a name.
Definition: Tag.h:93
void print(std::ostream &out, const std::string &prefix) const override
Print multi-line information about the tag.