ROSE  0.11.145.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_MODEL_CHECKER
5 #include <Rose/BinaryAnalysis/ModelChecker/Tag.h>
6 
7 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
8 #include <Rose/BinaryAnalysis/SymbolicExpression.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 SymbolicExpression::Ptr symbolic_; // optional symbolic value
28  const InstructionSemantics::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*,
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*,
53  static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
60  std::string message() const;
61 
69  Sawyer::Message::Importance importance() const;
70  void importance(Sawyer::Message::Importance);
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
Base class for machine instructions.
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.
void message(Sawyer::Message::Importance, const Ast::FilePtr &, const Token &, const std::string &mesg)
Print a diagnostic message to standard error.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
Importance
Level of importance for a message.
Definition: Message.h:313
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.