ROSE 0.11.145.192
Concolic/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#if BOOST_VERSION < 108600
11 #include <boost/process/child.hpp>
12#else
13 #include <boost/process/v1/child.hpp>
14#endif
15
16namespace Rose {
17namespace BinaryAnalysis {
18namespace Concolic {
19namespace M68kSystem {
20
22class Architecture: public Concolic::Architecture {
23 using Super = Concolic::Architecture;
24
25public:
27 using Ptr = ArchitecturePtr;
28
29private:
30 boost::process::child qemu_;
31 Yaml::Node config_; // configuration info from the `instance` call
32
33protected:
34 explicit Architecture(const std::string&); // for factories
35 Architecture(const DatabasePtr&, TestCaseId);
36public:
37 ~Architecture();
38
39public:
45 static Ptr instance(const DatabasePtr&, TestCaseId, const Yaml::Node &config);
46 static Ptr instance(const DatabasePtr&, const TestCasePtr&, const Yaml::Node &config);
50 static Ptr factory();
51
52 // Supporting functions
53private:
54 // Return the address of the first instruction to be executed, if known.
55 Sawyer::Optional<rose_addr_t> entryAddress();
56
57 // These are documented in the base class.
58public:
59 virtual bool matchFactory(const Yaml::Node&) const override;
60 virtual Super::Ptr instanceFromFactory(const DatabasePtr&, TestCaseId, const Yaml::Node &config) const override;
61 virtual Partitioner2::PartitionerPtr partition(const Partitioner2::EnginePtr&, const std::string &specimen) override;
62 virtual void configureSystemCalls() override;
63 virtual void load(const boost::filesystem::path&) override;
64 virtual ByteOrder::Endianness memoryByteOrder() override;
65 virtual std::vector<ExecutionEventPtr> createMemoryHashEvents() override;
66 virtual std::vector<ExecutionEventPtr> createMemoryAdjustEvents(const MemoryMapPtr&, rose_addr_t insnVa) override;
67 virtual std::vector<ExecutionEventPtr> createMemoryRestoreEvents() override;
68 virtual void mapMemory(const AddressInterval&, unsigned permissions) override;
69 virtual void unmapMemory(const AddressInterval&) override;
70 virtual void createInputVariables(const Partitioner2::PartitionerConstPtr&, const Emulation::RiscOperatorsPtr&,
71 const SmtSolver::Ptr&) override;
72 virtual void systemCall(const Partitioner2::PartitionerConstPtr&,
73 const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&) override;
74 virtual InstructionSemantics::BaseSemantics::DispatcherPtr
75 makeDispatcher(const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&) override;
76};
77
78} // namespace
79} // namespace
80} // namespace
81} // namespace
82
83#endif
84#endif
Holds a value or nothing.
Definition Optional.h:56
ROSE_DLL_API void load(SgProject *project, std::list< std::string > const &filepaths)
Load ASTs that have been saved to files.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
The ROSE library.
const char * Architecture(int64_t)
Convert Rose::BinaryAnalysis::Disassembler::Mips::Decoder::Architecture enum constant to a string.