klee
AddressSpace.h
Go to the documentation of this file.
1//===-- AddressSpace.h ------------------------------------------*- C++ -*-===//
2//
3// The KLEE Symbolic Virtual Machine
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef KLEE_ADDRESSSPACE_H
11#define KLEE_ADDRESSSPACE_H
12
13#include "Memory.h"
14
15#include "klee/Expr/Expr.h"
17#include "klee/System/Time.h"
18
19namespace klee {
20 class ExecutionState;
21 class MemoryObject;
22 class ObjectState;
23 class TimingSolver;
24
25 template<class T> class ref;
26
27 typedef std::pair<const MemoryObject*, const ObjectState*> ObjectPair;
28 typedef std::vector<ObjectPair> ResolutionList;
29
32 bool operator()(const MemoryObject *a, const MemoryObject *b) const;
33 };
34
37
39 private:
41 mutable unsigned cowKey;
42
45
54 ref<Expr> p, const ObjectPair &op,
55 ResolutionList &rl, unsigned maxResolutions) const;
56
57 public:
66
70
73 bool resolveOne(const ref<ConstantExpr> &address,
74 ObjectPair &result) const;
75
85 bool resolveOne(ExecutionState &state,
86 TimingSolver *solver,
87 ref<Expr> address,
88 ObjectPair &result,
89 bool &success) const;
90
97 bool resolve(ExecutionState &state,
98 TimingSolver *solver,
99 ref<Expr> p,
100 ResolutionList &rl,
101 unsigned maxResolutions=0,
102 time::Span timeout=time::Span()) const;
103
104 /***/
105
107 void bindObject(const MemoryObject *mo, ObjectState *os);
108
110 void unbindObject(const MemoryObject *mo);
111
113 const ObjectState *findObject(const MemoryObject *mo) const;
114
125 ObjectState *getWriteable(const MemoryObject *mo, const ObjectState *os);
126
129 void copyOutConcretes();
130
139 bool copyInConcretes();
140
147 bool copyInConcrete(const MemoryObject *mo, const ObjectState *os,
148 uint64_t src_address);
149 };
150} // End klee namespace
151
152#endif /* KLEE_ADDRESSSPACE_H */
void unbindObject(const MemoryObject *mo)
Remove a binding from the address space.
AddressSpace(const AddressSpace &b)
Definition: AddressSpace.h:68
int checkPointerInObject(ExecutionState &state, TimingSolver *solver, ref< Expr > p, const ObjectPair &op, ResolutionList &rl, unsigned maxResolutions) const
bool resolveOne(const ref< ConstantExpr > &address, ObjectPair &result) const
bool copyInConcrete(const MemoryObject *mo, const ObjectState *os, uint64_t src_address)
bool resolve(ExecutionState &state, TimingSolver *solver, ref< Expr > p, ResolutionList &rl, unsigned maxResolutions=0, time::Span timeout=time::Span()) const
void bindObject(const MemoryObject *mo, ObjectState *os)
Add a binding to the address space.
unsigned cowKey
Epoch counter used to control ownership of objects.
Definition: AddressSpace.h:41
const ObjectState * findObject(const MemoryObject *mo) const
Lookup a binding from a MemoryObject.
ObjectState * getWriteable(const MemoryObject *mo, const ObjectState *os)
Obtain an ObjectState suitable for writing.
AddressSpace & operator=(const AddressSpace &)
Unsupported, use copy constructor.
ExecutionState representing a path under exploration.
Definition: main.cpp:291
std::vector< ObjectPair > ResolutionList
Definition: AddressSpace.h:28
ImmutableMap< const MemoryObject *, ref< ObjectState >, MemoryObjectLT > MemoryMap
Definition: AddressSpace.h:36
std::pair< const MemoryObject *, const ObjectState * > ObjectPair
Definition: AddressSpace.h:25
Function object ordering MemoryObject's by address.
Definition: AddressSpace.h:31
bool operator()(const MemoryObject *a, const MemoryObject *b) const