ROSE 0.11.145.147
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
10namespace Rose {
11namespace BinaryAnalysis {
12namespace ModelChecker {
13
19class ErrorTag: public NameTag {
20public:
21 using Ptr = ErrorTagPtr;
22
23protected:
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
31protected:
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 SymbolicExpression::Ptr&);
37 ErrorTag(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
38 const InstructionSemantics::BaseSemantics::SValuePtr&);
39
40public:
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 SymbolicExpression::Ptr&);
53 static Ptr instance(size_t nodeStep, const std::string &name, const std::string &mesg, SgAsmInstruction*,
54 const InstructionSemantics::BaseSemantics::SValuePtr&);
60 std::string message() const;
61
69 Sawyer::Message::Importance importance() const;
70 void importance(Sawyer::Message::Importance);
73public:
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 Sarif::ResultPtr toSarif(const Sarif::AnalysisPtr&) const override;
77};
78
79} // namespace
80} // namespace
81} // namespace
82
83#endif
84#endif
Holds a value or nothing.
Definition Optional.h:56
Base class for machine instructions.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
The ROSE library.
void message(Sawyer::Message::Importance, const Ast::FilePtr &, const Token &, const std::string &mesg)
Print a diagnostic message to standard error.
Importance
Level of importance for a message.
Definition Message.h:313
@ ERROR
Error messages that indicate an abnormal situation from which the program was able to at least partia...
Definition Message.h:330