1 #ifndef ROSE_BinaryAnalysis_Concolic_BasicTypes_H
2 #define ROSE_BinaryAnalysis_Concolic_BasicTypes_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_CONCOLIC_TESTING
6 #include <rose_strtoull.h>
8 #include <Rose/Exception.h>
10 #include <Sawyer/Callbacks.h>
11 #include <Sawyer/Message.h>
12 #include <Sawyer/SharedPointer.h>
14 #include <boost/shared_ptr.hpp>
18 namespace BinaryAnalysis {
75 explicit Exception(
const std::string &mesg):
Rose::Exception(mesg) {}
76 ~Exception() throw () {}
86 class ConcolicExecutor;
89 class ConcreteExecutor;
91 class ConcreteExecutorResult;
101 class ExecutionEvent;
104 class ExecutionLocation;
106 class ExecutionManager;
109 class InputVariables;
118 class SharedMemoryCallback;
123 class SharedMemoryContext;
128 class SyscallCallback;
129 using SyscallCallbackPtr = std::shared_ptr<SyscallCallback>;
133 class SyscallContext;
141 class LinuxExitStatus;
152 using Value = size_t;
160 ObjectId(
const Value& v)
163 ObjectId(
const ObjectId& rhs)
174 explicit ObjectId(
const std::string &s) {
176 uint64_t
id = rose_strtoull(s.c_str(), &rest, 0);
177 while (*rest && isspace(*rest)) ++rest;
181 *
this = boost::numeric_cast<Value>(id);
182 }
catch (
const boost::bad_numeric_cast&) {
188 ObjectId<Tag>& operator=(
const ObjectId<Tag>& lhs) {
189 this->Super::operator=(lhs);
194 ObjectId<Tag>& operator=(
const Value& v) {
195 this->Super::operator=(v);
199 explicit operator bool()
const {
206 bool operator<(const ObjectId<_Tag>& lhs,
const ObjectId<_Tag>& rhs);
209 const Super& optional()
const {
217 bool operator<(const ObjectId<Tag>& lhs,
const ObjectId<Tag>& rhs)
219 if (!rhs)
return false;
220 if (!lhs)
return true;
222 return lhs.get() < rhs.get();
225 using TestSuiteId = ObjectId<TestSuite>;
226 using SpecimenId = ObjectId<Specimen>;
227 using TestCaseId = ObjectId<TestCase>;
228 using ExecutionEventId = ObjectId<ExecutionEvent>;
234 struct ObjectTraits {
239 struct ObjectTraits<TestSuite> {
240 using Id = TestSuiteId;
244 struct ObjectTraits<Specimen> {
245 using Id = SpecimenId;
249 struct ObjectTraits<TestCase> {
250 using Id = TestCaseId;
254 struct ObjectTraits<ExecutionEvent> {
255 using Id = ExecutionEventId;
const char * IoDirection(int64_t)
Convert Rose::BinaryAnalysis::Concolic::IoDirection enum constant to a string.
Only query an allocation.
ROSE_DLL_API Sawyer::Message::Facility mlog
Diagnostic facility for the ROSE library as a whole.
const char * ShowAssertions(int64_t)
Convert Rose::BinaryAnalysis::Concolic::ShowAssertions enum constant to a string. ...
Holds a value or nothing.
Main namespace for the ROSE library.
ROSE_UTIL_API std::string cEscape(const std::string &, char context= '"')
Escapes characters that are special to C/C++.
const char * When(int64_t)
Convert Rose::BinaryAnalysis::Concolic::When enum constant to a string.
Reference-counting intrusive smart pointer.
Object
The five kind of objects manipulated by Rose::CodeGen::API and associated Rose::CodeGen::Factory.
Allocate memory for real.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to concrete RISC operations.
const char * Update(int64_t)
Convert Rose::BinaryAnalysis::Concolic::Update enum constant to a string.
const char * Architecture(int64_t)
Convert Rose::BinaryAnalysis::Disassembler::Mips::Decoder::Architecture enum constant to a string...
const char * ConcolicPhase(int64_t)
Convert Rose::BinaryAnalysis::Concolic::ConcolicPhase enum constant to a string.
size_t Id
Attribute identification.
const char * ShowEvents(int64_t)
Convert Rose::BinaryAnalysis::Concolic::ShowEvents enum constant to a string.
void initDiagnostics()
Initialize diagnostics.
const char * InputType(int64_t)
Convert Rose::BinaryAnalysis::Concolic::InputType enum constant to a string.
Base class for all ROSE exceptions.