1 #ifndef ROSE_BinaryAnalysis_Concolic_ConcolicExecutor_H
2 #define ROSE_BinaryAnalysis_Concolic_ConcolicExecutor_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_CONCOLIC_TESTING
5 #include <Rose/BinaryAnalysis/Concolic/Settings.h>
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
10 #include <Sawyer/FileSystem.h>
13 namespace BinaryAnalysis {
30 std::string printableName;
36 : sourceVa(0), targetVa(0), stackVa(0) {}
38 FunctionCall(
const std::string &printableName, rose_addr_t sourceVa, rose_addr_t targetVa, rose_addr_t stackVa)
39 : printableName(printableName), sourceVa(sourceVa), targetVa(targetVa), stackVa(stackVa) {}
43 ConcolicExecutorSettings settings_;
44 std::vector<FunctionCall> functionCallStack_;
51 TestCasePtr testCase_;
52 TestCaseId testCaseId_;
55 ArchitecturePtr process_;
56 Emulation::DispatcherPtr cpu_;
66 static Ptr instance();
76 const ConcolicExecutorSettings& settings()
const;
77 ConcolicExecutorSettings& settings();
78 void settings(
const ConcolicExecutorSettings&);
99 DatabasePtr database()
const;
106 TestCasePtr testCase()
const;
113 TestCaseId testCaseId()
const;
127 ArchitecturePtr process()
const;
134 Emulation::DispatcherPtr cpu()
const;
143 static std::vector<Sawyer::CommandLine::SwitchGroup>
commandLineSwitches(ConcolicExecutorSettings &settings );
152 void configureExecution(
const DatabasePtr&,
const TestCasePtr&,
const Yaml::Node &config);
160 std::vector<TestCasePtr> execute();
161 std::vector<TestCasePtr> execute(
const DatabasePtr&,
const TestCasePtr&,
const Yaml::Node &config);
170 Emulation::DispatcherPtr makeDispatcher(
const ArchitecturePtr&);
176 void startDispatcher();
186 void printCallStack(std::ostream&);
196 void saveSymbolicState(
const Emulation::RiscOperatorsPtr&,
const TestCaseId&);
199 bool areSimilar(
const TestCasePtr&,
const TestCasePtr&)
const;
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Base class for machine instructions.
Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &settings)
Command-line switches for unparser settings.
Main namespace for the ROSE library.
Reference-counting intrusive smart pointer.
Sawyer::SharedPointer< Partitioner > PartitionerPtr
Shared-ownership pointer for Partitioner.
Sawyer::SharedPointer< const Partitioner > PartitionerConstPtr
Shared-ownership pointer for Partitioner.
Base class for reference counted objects.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.
Create a temporary directory.