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/CommandLine.h>
11#include <Sawyer/FileSystem.h>
18namespace BinaryAnalysis {
35 std::string printableName;
41 : sourceVa(0), targetVa(0), stackVa(0) {}
43 FunctionCall(
const std::string &printableName, rose_addr_t sourceVa, rose_addr_t targetVa, rose_addr_t stackVa)
44 : printableName(printableName), sourceVa(sourceVa), targetVa(targetVa), stackVa(stackVa) {}
48 ConcolicExecutorSettings settings_;
49 std::vector<FunctionCall> functionCallStack_;
56 TestCasePtr testCase_;
57 TestCaseId testCaseId_;
59 Partitioner2::PartitionerPtr partitioner_;
60 ArchitecturePtr process_;
61 Emulation::DispatcherPtr cpu_;
71 static Ptr instance();
81 const ConcolicExecutorSettings&
settings()
const;
82 ConcolicExecutorSettings&
settings();
83 void settings(
const ConcolicExecutorSettings&);
96 void solver(
const SmtSolverPtr&);
104 DatabasePtr database()
const;
111 TestCasePtr testCase()
const;
118 TestCaseId testCaseId()
const;
125 Partitioner2::PartitionerConstPtr partitioner()
const;
132 ArchitecturePtr process()
const;
139 Emulation::DispatcherPtr cpu()
const;
148 static std::vector<Sawyer::CommandLine::SwitchGroup>
commandLineSwitches(ConcolicExecutorSettings &settings );
157 void configureExecution(
const DatabasePtr&,
const TestCasePtr&,
const Yaml::Node &config);
165 std::vector<TestCasePtr> execute();
166 std::vector<TestCasePtr> execute(
const DatabasePtr&,
const TestCasePtr&,
const Yaml::Node &config);
172 Partitioner2::PartitionerPtr partition(
const SpecimenPtr&,
const ArchitecturePtr&);
175 Emulation::DispatcherPtr makeDispatcher(
const ArchitecturePtr&);
181 void startDispatcher();
191 void printCallStack(std::ostream&);
198 void generateTestCase(
const InstructionSemantics::BaseSemantics::RiscOperatorsPtr&,
const SymbolicExpression::Ptr &childIp);
201 void saveSymbolicState(
const Emulation::RiscOperatorsPtr&,
const TestCaseId&);
204 bool areSimilar(
const TestCasePtr&,
const TestCasePtr&)
const;
Create a temporary directory.
Base class for reference counted objects.
Reference-counting intrusive smart pointer.
Base class for machine instructions.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &settings)
Command-line switches for unparser settings.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.
Settings settings
Command-line settings for the rosebud tool.