ROSE  0.11.82.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 
19 class ErrorTag: public NameTag {
20 public:
21  using Ptr = ErrorTagPtr;
22 
23 protected:
24  const std::string mesg_; // error message
25  SgAsmInstruction* const insn_; // instruction where the error occurs (optional)
26  Sawyer::Optional<uint64_t> concrete_; // optional concrete value
27  const SymbolicExpr::Ptr symbolic_; // optional symbolic value
28  const InstructionSemantics2::BaseSemantics::SValuePtr svalue_; // optional semantic value
30 
31 protected:
32  ErrorTag() = delete;
33  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
35  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
36  const SymbolicExpr::Ptr&);
37  ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
39 
40 public:
41  ~ErrorTag();
42 
48  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*);
49  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
50  uint64_t);
51  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
52  const SymbolicExpr::Ptr&);
53  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
60  std::string message() const;
61 
73 public:
74  void print(std::ostream &out, const std::string &prefix) const override;
75  void toYaml(std::ostream &out, const std::string &prefix) const override;
76 };
77 
78 } // namespace
79 } // namespace
80 } // namespace
81 
82 #endif
83 #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.
Error messages that indicate an abnormal situation from which the program was able to at least partia...
Definition: Message.h:330
Main namespace for the ROSE library.
virtual std::string name() const override
Property: Generic name of tag.
Tag that describes a model checker abnormal condition.
Definition: ErrorTag.h:19
Sawyer::Message::Importance importance() const
Property: Importance.
size_t nodeStep() const
Property: Node step.
Base class for tags that have a name.
Definition: Tag.h:93
Importance
Level of importance for a message.
Definition: Message.h:313
void print(std::ostream &out, const std::string &prefix) const override
Print multi-line information about the tag.