ROSE  0.11.145.0
M68kSystem/Architecture.h
1 #ifndef ROSE_BinaryAnalysis_Concolic_M68kSystem_Architecture_H
2 #define ROSE_BinaryAnalysis_Concolic_M68kSystem_Architecture_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_CONCOLIC_TESTING
5 
6 #include <Rose/BinaryAnalysis/Concolic/Architecture.h>
7 #include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
8 #include <Rose/Yaml.h>
9 
10 #include <boost/process/child.hpp>
11 
12 namespace Rose {
13 namespace BinaryAnalysis {
14 namespace Concolic {
15 namespace M68kSystem {
16 
18 class Architecture: public Concolic::Architecture {
19  using Super = Concolic::Architecture;
20 
21 public:
23  using Ptr = ArchitecturePtr;
24 
25 private:
26  boost::process::child qemu_;
27  Yaml::Node config_; // configuration info from the `instance` call
28 
29 protected:
30  explicit Architecture(const std::string&); // for factories
31  Architecture(const DatabasePtr&, TestCaseId);
32 public:
33  ~Architecture();
34 
35 public:
41  static Ptr instance(const DatabasePtr&, TestCaseId, const Yaml::Node &config);
42  static Ptr instance(const DatabasePtr&, const TestCasePtr&, const Yaml::Node &config);
46  static Ptr factory();
47 
48  // Supporting functions
49 private:
50  // Return the address of the first instruction to be executed, if known.
51  Sawyer::Optional<rose_addr_t> entryAddress();
52 
53  // These are documented in the base class.
54 public:
55  virtual bool matchFactory(const Yaml::Node&) const override;
56  virtual Super::Ptr instanceFromFactory(const DatabasePtr&, TestCaseId, const Yaml::Node &config) const override;
57  virtual Partitioner2::PartitionerPtr partition(const Partitioner2::EnginePtr&, const std::string &specimen) override;
58  virtual void configureSystemCalls() override;
59  virtual void load(const boost::filesystem::path&) override;
60  virtual ByteOrder::Endianness memoryByteOrder() override;
61  virtual std::vector<ExecutionEventPtr> createMemoryHashEvents() override;
62  virtual std::vector<ExecutionEventPtr> createMemoryAdjustEvents(const MemoryMap::Ptr&, rose_addr_t insnVa) override;
63  virtual std::vector<ExecutionEventPtr> createMemoryRestoreEvents() override;
64  virtual void mapMemory(const AddressInterval&, unsigned permissions) override;
65  virtual void unmapMemory(const AddressInterval&) override;
66  virtual void createInputVariables(const Partitioner2::PartitionerConstPtr&, const Emulation::RiscOperatorsPtr&,
67  const SmtSolver::Ptr&) override;
68  virtual void systemCall(const Partitioner2::PartitionerConstPtr&,
71  makeDispatcher(const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&) override;
72 };
73 
74 } // namespace
75 } // namespace
76 } // namespace
77 } // namespace
78 
79 #endif
80 #endif
SmtSolverPtr Ptr
Reference counting pointer for SMT solvers.
Definition: SmtSolver.h:45
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Main namespace for the ROSE library.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
MemoryMapPtr Ptr
Reference counting pointer.
Definition: MemoryMap.h:115
Sawyer::SharedPointer< Partitioner > PartitionerPtr
Shared-ownership pointer for Partitioner.
ROSE_DLL_API void load(SgProject *project, std::list< std::string > const &filepaths)
Load ASTs that have been saved to files.
Sawyer::SharedPointer< const Partitioner > PartitionerConstPtr
Shared-ownership pointer for Partitioner.
const char * Architecture(int64_t)
Convert Rose::BinaryAnalysis::Disassembler::Mips::Decoder::Architecture enum constant to a string...
Sawyer::SharedPointer< Engine > EnginePtr
Shared-ownership pointer for Engine.
Range of values delimited by endpoints.
Definition: Interval.h:33
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.