AddressSpace.h

Go to the documentation of this file.
00001 //===-- AddressSpace.h ------------------------------------------*- C++ -*-===//
00002 //
00003 //                     The KLEE Symbolic Virtual Machine
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef KLEE_ADDRESSSPACE_H
00011 #define KLEE_ADDRESSSPACE_H
00012 
00013 #include "ObjectHolder.h"
00014 
00015 #include "klee/Expr.h"
00016 #include "klee/Internal/ADT/ImmutableMap.h"
00017 
00018 namespace klee {
00019   class ExecutionState;
00020   class MemoryObject;
00021   class ObjectState;
00022   class TimingSolver;
00023 
00024   template<class T> class ref;
00025 
00026   typedef std::pair<const MemoryObject*, const ObjectState*> ObjectPair;
00027   typedef std::vector<ObjectPair> ResolutionList;  
00028 
00030   struct MemoryObjectLT {
00031     bool operator()(const MemoryObject *a, const MemoryObject *b) const;
00032   };
00033   
00034   typedef ImmutableMap<const MemoryObject*, ObjectHolder, MemoryObjectLT> MemoryMap;
00035   
00036   class AddressSpace {
00037   private:
00039     mutable unsigned cowKey;
00040 
00042     AddressSpace &operator=(const AddressSpace&); 
00043     
00044   public:
00052     MemoryMap objects;
00053     
00054   public:
00055     AddressSpace() : cowKey(1) {}
00056     AddressSpace(const AddressSpace &b) : cowKey(++b.cowKey), objects(b.objects) { }
00057     ~AddressSpace() {}
00058 
00061     bool resolveOne(uint64_t address, 
00062                     ObjectPair &result);
00063 
00073     bool resolveOne(ExecutionState &state, 
00074                     TimingSolver *solver,
00075                     ref<Expr> address,
00076                     ObjectPair &result,
00077                     bool &success);
00078 
00085     bool resolve(ExecutionState &state,
00086                  TimingSolver *solver,
00087                  ref<Expr> address, 
00088                  ResolutionList &rl, 
00089                  unsigned maxResolutions=0,
00090                  double timeout=0.);
00091 
00092     /***/
00093 
00095     void bindObject(const MemoryObject *mo, ObjectState *os);
00096 
00098     void unbindObject(const MemoryObject *mo);
00099 
00101     const ObjectState *findObject(const MemoryObject *mo) const;
00102 
00113     ObjectState *getWriteable(const MemoryObject *mo, const ObjectState *os);
00114 
00117     void copyOutConcretes();
00118 
00127     bool copyInConcretes();
00128   };
00129 } // End klee namespace
00130 
00131 #endif

Generated on Fri Jun 5 03:31:31 2009 for klee by  doxygen 1.5.8