klee
klee::MemoryObject Class Reference

#include <Memory.h>

Collaboration diagram for klee::MemoryObject:

Public Member Functions

 MemoryObject (const MemoryObject &b)
 
MemoryObjectoperator= (const MemoryObject &b)
 
 MemoryObject (uint64_t _address)
 
 MemoryObject (uint64_t _address, unsigned _size, bool _isLocal, bool _isGlobal, bool _isFixed, const llvm::Value *_allocSite, MemoryManager *_parent)
 
 ~MemoryObject ()
 
void getAllocInfo (std::string &result) const
 Get an identifying string for this allocation. More...
 
void setName (std::string name) const
 
ref< ConstantExprgetBaseExpr () const
 
ref< ConstantExprgetSizeExpr () const
 
ref< ExprgetOffsetExpr (ref< Expr > pointer) const
 
ref< ExprgetBoundsCheckPointer (ref< Expr > pointer) const
 
ref< ExprgetBoundsCheckPointer (ref< Expr > pointer, unsigned bytes) const
 
ref< ExprgetBoundsCheckOffset (ref< Expr > offset) const
 
ref< ExprgetBoundsCheckOffset (ref< Expr > offset, unsigned bytes) const
 
int compare (const MemoryObject &b) const
 

Public Attributes

unsigned id
 
uint64_t address
 
unsigned size
 size in bytes More...
 
std::string name
 
bool isLocal
 
bool isGlobal
 
bool isFixed
 
bool isUserSpecified
 
MemoryManagerparent
 
const llvm::Value * allocSite
 

Private Attributes

class ReferenceCounter _refCount
 Required by klee::ref-managed objects. More...
 

Static Private Attributes

static int counter = 0
 

Friends

class STPBuilder
 
class ObjectState
 
class ExecutionState
 
class ref< MemoryObject >
 
class ref< const MemoryObject >
 

Detailed Description

Definition at line 35 of file Memory.h.

Constructor & Destructor Documentation

◆ MemoryObject() [1/3]

klee::MemoryObject::MemoryObject ( const MemoryObject b)

◆ MemoryObject() [2/3]

klee::MemoryObject::MemoryObject ( uint64_t  _address)
inlineexplicit

Definition at line 75 of file Memory.h.

◆ MemoryObject() [3/3]

klee::MemoryObject::MemoryObject ( uint64_t  _address,
unsigned  _size,
bool  _isLocal,
bool  _isGlobal,
bool  _isFixed,
const llvm::Value *  _allocSite,
MemoryManager _parent 
)
inline

Definition at line 84 of file Memory.h.

◆ ~MemoryObject()

MemoryObject::~MemoryObject ( )

Definition at line 47 of file Memory.cpp.

References klee::MemoryManager::markFreed(), and parent.

Here is the call graph for this function:

Member Function Documentation

◆ compare()

int klee::MemoryObject::compare ( const MemoryObject b) const
inline

Compare this object with memory object b.

Parameters
bmemory object to compare with
Returns
<0 if this is smaller, 0 if both are equal, >0 if b is smaller

Definition at line 146 of file Memory.h.

References address, allocSite, id, and size.

◆ getAllocInfo()

void MemoryObject::getAllocInfo ( std::string &  result) const

Get an identifying string for this allocation.

Definition at line 52 of file Memory.cpp.

References allocSite, and size.

Referenced by klee::Executor::getAddressInfo().

Here is the caller graph for this function:

◆ getBaseExpr()

ref< ConstantExpr > klee::MemoryObject::getBaseExpr ( ) const
inline

◆ getBoundsCheckOffset() [1/2]

ref< Expr > klee::MemoryObject::getBoundsCheckOffset ( ref< Expr offset) const
inline

Definition at line 125 of file Memory.h.

References klee::ConstantExpr::alloc(), klee::Context::get(), getSizeExpr(), and size.

Referenced by klee::Executor::executeMemoryOperation(), and getBoundsCheckPointer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBoundsCheckOffset() [2/2]

ref< Expr > klee::MemoryObject::getBoundsCheckOffset ( ref< Expr offset,
unsigned  bytes 
) const
inline

Definition at line 133 of file Memory.h.

References klee::ConstantExpr::alloc(), klee::Expr::Bool, klee::Context::get(), and size.

Here is the call graph for this function:

◆ getBoundsCheckPointer() [1/2]

ref< Expr > klee::MemoryObject::getBoundsCheckPointer ( ref< Expr pointer) const
inline

Definition at line 118 of file Memory.h.

References getBoundsCheckOffset(), and getOffsetExpr().

Referenced by klee::AddressSpace::checkPointerInObject(), and klee::Executor::executeMemoryOperation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBoundsCheckPointer() [2/2]

ref< Expr > klee::MemoryObject::getBoundsCheckPointer ( ref< Expr pointer,
unsigned  bytes 
) const
inline

Definition at line 121 of file Memory.h.

References getBoundsCheckOffset(), and getOffsetExpr().

Here is the call graph for this function:

◆ getOffsetExpr()

ref< Expr > klee::MemoryObject::getOffsetExpr ( ref< Expr pointer) const
inline

Definition at line 115 of file Memory.h.

References getBaseExpr().

Referenced by klee::Executor::executeMemoryOperation(), getBoundsCheckPointer(), and klee::SpecialFunctionHandler::readStringAtAddress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSizeExpr()

ref< ConstantExpr > klee::MemoryObject::getSizeExpr ( ) const
inline

Definition at line 112 of file Memory.h.

References klee::ConstantExpr::create(), klee::Context::get(), and size.

Referenced by getBoundsCheckOffset(), and klee::Executor::unwindToNextLandingpad().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

MemoryObject & klee::MemoryObject::operator= ( const MemoryObject b)

◆ setName()

void klee::MemoryObject::setName ( std::string  name) const
inline

Definition at line 105 of file Memory.h.

References name.

Friends And Related Function Documentation

◆ ExecutionState

friend class ExecutionState
friend

Definition at line 38 of file Memory.h.

◆ ObjectState

friend class ObjectState
friend

Definition at line 37 of file Memory.h.

◆ ref< const MemoryObject >

friend class ref< const MemoryObject >
friend

Definition at line 38 of file Memory.h.

◆ ref< MemoryObject >

friend class ref< MemoryObject >
friend

Definition at line 38 of file Memory.h.

◆ STPBuilder

friend class STPBuilder
friend

Definition at line 36 of file Memory.h.

Member Data Documentation

◆ _refCount

class ReferenceCounter klee::MemoryObject::_refCount
private

Required by klee::ref-managed objects.

Definition at line 45 of file Memory.h.

◆ address

◆ allocSite

const llvm::Value* klee::MemoryObject::allocSite

"Location" for which this memory object was allocated. This should be either the allocating instruction or the global object it was allocated for (or whatever else makes sense).

Definition at line 66 of file Memory.h.

Referenced by compare(), and getAllocInfo().

◆ counter

int MemoryObject::counter = 0
staticprivate

Definition at line 43 of file Memory.h.

◆ id

unsigned klee::MemoryObject::id

Definition at line 48 of file Memory.h.

Referenced by compare().

◆ isFixed

bool klee::MemoryObject::isFixed

Definition at line 57 of file Memory.h.

Referenced by klee::MemoryManager::markFreed(), and klee::MemoryManager::~MemoryManager().

◆ isGlobal

bool klee::MemoryObject::isGlobal
mutable

Definition at line 56 of file Memory.h.

Referenced by klee::Executor::executeFree().

◆ isLocal

bool klee::MemoryObject::isLocal

Definition at line 55 of file Memory.h.

Referenced by klee::Executor::executeFree().

◆ isUserSpecified

bool klee::MemoryObject::isUserSpecified

◆ name

std::string klee::MemoryObject::name
mutable

◆ parent

MemoryManager* klee::MemoryObject::parent

Definition at line 61 of file Memory.h.

Referenced by ~MemoryObject().

◆ size


The documentation for this class was generated from the following files: