1 #ifndef ROSE_BinaryAnalysis_Concolic_Emulation_H
2 #define ROSE_BinaryAnalysis_Concolic_Emulation_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_CONCOLIC_TESTING
5 #include <Rose/BinaryAnalysis/Concolic/BasicTypes.h>
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
9 #include <Rose/BinaryAnalysis/InstructionSemantics/SymbolicSemantics.h>
10 #include <Sawyer/FileSystem.h>
13 namespace BinaryAnalysis {
19 typedef InstructionSemantics::SymbolicSemantics::Formatter SValueFormatter;
21 typedef InstructionSemantics::SymbolicSemantics::SValue SValue;
22 typedef InstructionSemantics::SymbolicSemantics::RegisterStatePtr RegisterStatePtr;
23 typedef InstructionSemantics::SymbolicSemantics::RegisterState RegisterState;
24 typedef InstructionSemantics::SymbolicSemantics::MemoryStatePtr
MemoryStatePtr;
25 typedef InstructionSemantics::SymbolicSemantics::MemoryState MemoryState;
26 typedef InstructionSemantics::SymbolicSemantics::StatePtr StatePtr;
27 typedef InstructionSemantics::SymbolicSemantics::State
State;
30 class Exit:
public Exception {
34 explicit Exit(uint64_t status)
35 : Exception(
"subordinate exit"), status_(status) {}
40 uint64_t status()
const {
46 class RiscOperators:
public InstructionSemantics::SymbolicSemantics::RiscOperators {
52 typedef InstructionSemantics::SymbolicSemantics::RiscOperators Super;
55 const RegisterDescriptor REG_PATH;
64 TestCasePtr testCase_;
66 ArchitecturePtr process_;
67 bool hadSystemCall_ =
false;
68 ExecutionEventPtr hadSharedMemoryAccess_;
69 bool isRecursive_ =
false;
80 static RiscOperatorsPtr instance(
const Settings &settings,
const DatabasePtr&,
const TestCasePtr&,
100 const Settings& settings()
const;
106 TestCasePtr testCase()
const;
109 DatabasePtr database()
const;
112 ArchitecturePtr process()
const;
119 InputVariablesPtr inputVariables()
const;
129 bool hadSystemCall()
const;
130 void hadSystemCall(
bool);
139 ExecutionEventPtr hadSharedMemoryAccess()
const;
140 void hadSharedMemoryAccess(
const ExecutionEventPtr&);
149 bool isRecursive()
const;
150 void isRecursive(
bool);
157 size_t wordSizeBits()
const;
177 void printInputVariables(std::ostream&)
const;
180 void printAssertions(std::ostream&)
const;
187 virtual void interrupt(
int majr,
int minr)
override;
193 readRegister(RegisterDescriptor reg)
override;
216 void doExit(uint64_t);
243 rose_addr_t concreteInstructionPointer()
const;
249 bool isTerminated()
const;
SmtSolverPtr Ptr
Reference counting pointer for SMT solvers.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Base class for machine instructions.
Sawyer::SharedPointer< class SValue > SValuePtr
Smart-ownership pointer to a concrete semantic value.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to a concrete memory state.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer for symbolic semantic value.
Reference-counting intrusive smart pointer.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to concrete RISC operations.
Sawyer::SharedPointer< const Partitioner > PartitionerConstPtr
Shared-ownership pointer for Partitioner.
RiscOperatorsPtr Ptr
Shared-ownership pointer.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
Base class for reference counted objects.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
std::shared_ptr< SmtSolver > SmtSolverPtr
Reference counting pointer.