ROSE 0.11.145.147
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#include <boost/process/child.hpp>
11
12namespace Rose {
13namespace BinaryAnalysis {
14namespace Concolic {
15namespace M68kSystem {
16
18class Architecture: public Concolic::Architecture {
19 using Super = Concolic::Architecture;
20
21public:
23 using Ptr = ArchitecturePtr;
24
25private:
26 boost::process::child qemu_;
27 Yaml::Node config_; // configuration info from the `instance` call
28
29protected:
30 explicit Architecture(const std::string&); // for factories
31 Architecture(const DatabasePtr&, TestCaseId);
32public:
33 ~Architecture();
34
35public:
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
49private:
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.
54public:
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 MemoryMapPtr&, 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&,
69 const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&) override;
70 virtual InstructionSemantics::BaseSemantics::DispatcherPtr
71 makeDispatcher(const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&) override;
72};
73
74} // namespace
75} // namespace
76} // namespace
77} // namespace
78
79#endif
80#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.