ROSE  0.11.50.0
FailureUnit.h
1 #ifndef ROSE_BinaryAnalysis_ModelChecker_FailureUnit_H
2 #define ROSE_BinaryAnalysis_ModelChecker_FailureUnit_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/ModelChecker/ExecutionUnit.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace ModelChecker {
11 
15 class FailureUnit: public ExecutionUnit {
16 public:
17  using Ptr = FailureUnitPtr;
18 
19 private:
21  const std::string description_;
22  TagPtr tag_;
23 
24 protected:
25  FailureUnit() = delete;
26  FailureUnit(const Sawyer::Optional<rose_addr_t>&, const SourceLocation&, const std::string &description,
27  const TagPtr&);
28 public:
29  ~FailureUnit();
30 
31 public:
42  static Ptr instance(const Sawyer::Optional<rose_addr_t>&, const SourceLocation&, const std::string &description);
43  static Ptr instance(const Sawyer::Optional<rose_addr_t>&, const SourceLocation&, const std::string &description, const TagPtr&);
46 public:
53  const std::string& description() const;
54 
55 public:
56  virtual std::string printableName() const override;
57  virtual void printSteps(const SettingsPtr&, std::ostream&, const std::string &prefix,
58  size_t stepOrigin, size_t maxSteps) const override;
59  virtual void toYamlHeader(const SettingsPtr&, std::ostream&, const std::string &prefix) const override;
60  virtual void toYamlSteps(const SettingsPtr&, std::ostream&, const std::string &prefix,
61  size_t stepOrigin, size_t maxSteps) const override;
62  virtual size_t nSteps() const override;
63  virtual Sawyer::Optional<rose_addr_t> address() const override;
64 
65  virtual std::vector<TagPtr>
66  execute(const SettingsPtr&, const SemanticCallbacksPtr&, const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr&) override;
67 };
68 
69 } // namespace
70 } // namespace
71 } // namespace
72 
73 #endif
74 #endif
virtual void toYamlHeader(const SettingsPtr &, std::ostream &, const std::string &prefix) const override
Print the header information in YAML format.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual size_t nSteps() const override
Property: Number of steps required to execute this unit.
virtual void toYamlSteps(const SettingsPtr &, std::ostream &, const std::string &prefix, size_t stepOrigin, size_t maxSteps) const override
Print the steps for this execution unit in YAML format.
An execution unit that always fails.
Definition: FailureUnit.h:15
Information about a source location.
virtual Sawyer::Optional< rose_addr_t > address() const override
Property: Address if it has one.
const std::string & description() const
Property: Description.
Main namespace for the ROSE library.
virtual void printSteps(const SettingsPtr &, std::ostream &, const std::string &prefix, size_t stepOrigin, size_t maxSteps) const override
Print the steps for this execution unit.
ExecutionUnitPtr Ptr
Shared ownership pointer for an execution unit.
Definition: ExecutionUnit.h:22
virtual std::vector< TagPtr > execute(const SettingsPtr &, const SemanticCallbacksPtr &, const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr &) override
Execute the unit to create a new state.
virtual std::string printableName() const override
Property: Printable name.
static Ptr instance(const Sawyer::Optional< rose_addr_t > &, const SourceLocation &, const std::string &description)
Allocating constructor.