Predator
[unstable] git snapshot
|
extension of SymHeapCore dealing with abstract objects (list segments etc.) More...
#include <symheap.hh>
Public Member Functions | |
SymHeap (TStorRef, Trace::Node *) | |
create an empty symbolic heap | |
virtual | ~SymHeap () |
destruction of the symbolic heap invalidates all IDs of its entities | |
SymHeap (const SymHeap &) | |
relatively cheap operation as long as SH_COPY_ON_WRITE is enabled | |
SymHeap & | operator= (const SymHeap &) |
relatively cheap operation as long as SH_COPY_ON_WRITE is enabled | |
virtual void | swap (SymHeapCore &) |
exchange the contents with the other heap (works in constant time) | |
EObjKind | objKind (TObjId) const |
kind of object (region, SLS, DLS, ...) | |
const BindingOff & | segBinding (TObjId seg) const |
tuple of binding offsets (next, prev, ...) | |
void | objSetAbstract (TObjId seg, EObjKind kind, const BindingOff &off) |
set properties of an abstract object, set abstract if not already | |
void | objSetConcrete (TObjId) |
set the given abstract object to be a concrete object (drops props) | |
TMinLen | segMinLength (TObjId seg) const |
read the minimal segment length of the given abstract object | |
void | segSetMinLength (TObjId seg, TMinLen len) |
assign the minimal segment length of the given abstract object | |
virtual void | objInvalidate (TObjId) |
invalidate the given object | |
virtual TObjId | objClone (TObjId) |
clone the given object, including the outgoing has-value edges | |
TStorRef | stor () const |
each symbolic heap is associated with a CodeStorage model of code | |
Trace::Node * | traceNode () const |
each symbolic heap is associated with a trace graph node | |
void | traceUpdate (Trace::Node *) |
update the current trace graph node that the heap is associated with | |
unsigned | lastId () const |
the last assigned ID of a heap entity (not necessarily still valid) | |
void | usedBy (FldList &dst, TValId val, bool liveOnly=false) const |
collect all objects having the given value inside | |
unsigned | usedByCount (TValId val) const |
return how many objects have the value inside | |
void | pointedBy (FldList &dst, TObjId) const |
return all objects that point at/inside the given object | |
unsigned | pointedByCount (TObjId) const |
return how many objects point at/inside the given object | |
void | writeUniformBlock (TObjId obj, const UniformBlock &ub, TValSet *killedPtrs=0) |
write an uninitialized or nullified block of memory | |
void | copyBlockOfRawMemory (TValId dst, TValId src, TSizeOf size, TValSet *killedPtrs=0) |
copy 'size' bytes of raw memory from 'src' to 'dst' | |
void | addNeq (TValId v1, TValId v2) |
define an explicit Neq predicate | |
void | delNeq (TValId v1, TValId v2) |
remove an explicit Neq predicate if defined | |
bool | chkNeq (TValId v1, TValId v2) const |
true if there is an explicit Neq relation over the given values | |
void | gatherRelatedValues (TValList &dst, TValId val) const |
collect values connect with the given value via an extra predicate | |
void | copyRelevantPreds (SymHeapCore &dst, const TValMap &valMap) const |
transfer as many as possible extra heap predicates from this to dst | |
bool | matchPreds (const SymHeapCore &ref, const TValMap &valMap, bool nonZeroOnly=false) const |
true if all Neq predicates can be mapped to Neq predicates in ref | |
TValId | valByOffset (TValId, TOffset offset) |
translate the given address by the given offset | |
TValId | valByRange (TValId at, IR::Range range) |
create (or recycle) a VT_RANGE value at the given allocated address | |
TValId | valShift (TValId valToShift, TValId shiftBy) |
translate the given value by the given offset | |
EValueTarget | valTarget (TValId) const |
classify the object the given value points to | |
EValueOrigin | valOrigin (TValId) const |
classify where the given value originates from | |
ETargetSpecifier | targetSpec (TValId addr) const |
return the target specifier of the given address | |
TObjId | objByAddr (TValId addr) const |
return the object that the given address points to | |
EStorageClass | objStorClass (TObjId) const |
classify the storage class of the given object | |
TSizeRange | objSize (TObjId) const |
return size (in bytes) of the given object | |
TValId | addrOfTarget (TObjId, ETargetSpecifier, TOffset off=0) |
target address at the given object with target specifier and offset | |
TValId | valRoot (TValId) const |
return the address of the root which the given value is binded to | |
TOffset | valOffset (TValId) const |
return the relative placement from the root | |
IR::Range | valOffsetRange (TValId) const |
return the offset range associated with the given VT_RANGE value | |
void | valRestrictRange (TValId, IR::Range win) |
narrow down the offset range of the given VT_RANGE value | |
TValId | diffPointers (TValId v1, TValId v2) |
difference between two pointers (makes sense only for shared roots) | |
TSizeRange | valSizeOfString (TValId) const |
return count of bytes (including NULL) we can safely read as string | |
TObjId | regionByVar (CVar, bool createIfNeeded) |
return the region corresponding to the given program variable | |
virtual void | valReplace (TValId val, TValId replaceBy) |
replace all occurrences of val by replaceBy | |
void | gatherObjects (TObjList &dst, bool(*)(EStorageClass)=0) const |
return the list of objects satisfying the given filtering predicate | |
void | gatherLiveFields (FldList &dst, TObjId) const |
list of live fields (including ptrs) inside the given object | |
void | gatherUniformBlocks (TUniBlockMap &dst, TObjId) const |
list of uninitialized and nullified uniform blocks of the given obj | |
bool | findCoveringUniBlocks (TUniBlockMap *pCovered, TObjId root, UniformBlock block) const |
experimental optimization of joinUniBlocksCore() | |
CVar | cVarByObject (TObjId) const |
return program variable that the given object maps to | |
TFldId | valGetComposite (TValId val) const |
composite object given by val (applicable only on VT_COMPOSITE vals) | |
TObjId | stackAlloc (const TSizeRange &size, const CallInst &from) |
allocate a chunk of stack of known size from the select call stack | |
bool | isAnonStackObj (TObjId, CallInst *pFrom=0) |
return true if the given object was allocated by stackAlloc() | |
void | clearAnonStackObjects (TObjList &dst, const CallInst &of) |
clear the list of anonymous stack objects of the given call instance | |
TObjId | heapAlloc (const TSizeRange &size) |
allocate a chunk of heap of known size | |
bool | isValid (TObjId) const |
return true if the given object can be still accessed safely | |
void | objSetEstimatedType (TObjId obj, TObjType clt) |
update the estimated type-info of the given object | |
TObjType | objEstimatedType (TObjId obj) const |
return the estimated type-info of the given object | |
TValId | valCreate (EValueTarget code, EValueOrigin origin) |
create a generic value, otherwise use addrOfTarget() | |
TValId | valWrapCustom (CustomValue data) |
wrap a custom value, such as integer literal, or code pointer | |
const CustomValue & | valUnwrapCustom (TValId) const |
unwrap a custom value, such as integer literal, or code pointer | |
TProtoLevel | objProtoLevel (TObjId) const |
prototype level of the given object (0 means not a prototype) | |
void | objSetProtoLevel (TObjId obj, TProtoLevel level) |
set prototype level of the given boject (0 means not a prototype) |
Protected Member Functions | |
TFldId | ptrLookup (TObjId obj, TOffset off) |
return a data pointer inside the given object at the given offset | |
TFldId | fldLookup (TObjId obj, TOffset off, TObjType clt) |
return a field of the specified type at the specified offset in obj | |
void | fldEnter (TFldId) |
increment the external reference count of the given object | |
void | fldLeave (TFldId) |
decrement the external reference count (may trigger its destruction) | |
TValId | valueOf (TFldId fld) |
TValId | placedAt (TFldId fld) |
TObjId | objByField (TFldId fld) const |
TOffset | fieldOffset (TFldId fld) const |
TObjType | fieldType (TFldId fld) const |
void | setValOfField (TFldId fld, TValId val, TValSet *killedPtrs=0) |
Protected Attributes | |
TStorRef | stor_ |
Private Attributes | |
Private * | d |
extension of SymHeapCore dealing with abstract objects (list segments etc.)
Definition at line 827 of file symheap.hh.
SymHeap | ( | TStorRef | , |
Trace::Node * | |||
) |
create an empty symbolic heap
|
virtual |
destruction of the symbolic heap invalidates all IDs of its entities
|
inherited |
target address at the given object with target specifier and offset
Referenced by segHeadAt().
true if there is an explicit Neq relation over the given values
clear the list of anonymous stack objects of the given call instance
|
inherited |
copy 'size' bytes of raw memory from 'src' to 'dst'
|
inherited |
transfer as many as possible extra heap predicates from this to dst
return program variable that the given object maps to
Referenced by gatherProgramVarsCore(), and traverseProgramVarsGeneric().
difference between two pointers (makes sense only for shared roots)
Referenced by FldHandle::offset().
Referenced by FldHandle::type().
|
inherited |
experimental optimization of joinUniBlocksCore()
|
protectedinherited |
increment the external reference count of the given object
Referenced by FldHandle::FldHandle(), FldHandle::operator=(), and PtrHandle::PtrHandle().
|
protectedinherited |
decrement the external reference count (may trigger its destruction)
Referenced by FldHandle::operator=(), and FldHandle::~FldHandle().
return a field of the specified type at the specified offset in obj
list of live fields (including ptrs) inside the given object
Referenced by traverseLiveFieldsGeneric().
|
inherited |
return the list of objects satisfying the given filtering predicate
Referenced by gatherProgramVarsCore(), and traverseProgramVarsGeneric().
collect values connect with the given value via an extra predicate
|
inherited |
list of uninitialized and nullified uniform blocks of the given obj
|
inherited |
allocate a chunk of heap of known size
return true if the given object was allocated by stackAlloc()
|
inherited |
return true if the given object can be still accessed safely
Referenced by isPossibleToDeref(), nextObj(), and objMinLength().
|
inherited |
the last assigned ID of a heap entity (not necessarily still valid)
|
inherited |
true if all Neq predicates can be mapped to Neq predicates in ref
return the object that the given address points to
Referenced by LeakMonitor::collectJunkFrom(), isPossibleToDeref(), and nextObj().
Referenced by FldHandle::obj().
clone the given object, including the outgoing has-value edges
Reimplemented from SymHeapCore.
return the estimated type-info of the given object
|
virtual |
invalidate the given object
Reimplemented from SymHeapCore.
kind of object (region, SLS, DLS, ...)
Referenced by buildIgnoreList(), headOffset(), isAbstractObject(), nextPtrFromSeg(), nextValFromSeg(), objMinLength(), prevPtrFromSeg(), and segHeadAt().
|
inherited |
prototype level of the given object (0 means not a prototype)
void objSetAbstract | ( | TObjId | seg, |
EObjKind | kind, | ||
const BindingOff & | off | ||
) |
set properties of an abstract object, set abstract if not already
void objSetConcrete | ( | TObjId | ) |
set the given abstract object to be a concrete object (drops props)
update the estimated type-info of the given object
|
inherited |
set prototype level of the given boject (0 means not a prototype)
|
inherited |
return size (in bytes) of the given object
Referenced by traverseProgramVarsGeneric().
|
inherited |
classify the storage class of the given object
relatively cheap operation as long as SH_COPY_ON_WRITE is enabled
Referenced by FldHandle::placedAt().
return all objects that point at/inside the given object
|
inherited |
return how many objects point at/inside the given object
return a data pointer inside the given object at the given offset
return the region corresponding to the given program variable
Referenced by isVarAlive(), and traverseProgramVarsGeneric().
const BindingOff& segBinding | ( | TObjId | seg | ) | const |
tuple of binding offsets (next, prev, ...)
Referenced by buildIgnoreList(), headOffset(), nextPtrFromSeg(), prevPtrFromSeg(), and segHeadAt().
read the minimal segment length of the given abstract object
Referenced by objMinLength(), and segIncreaseMinLength().
assign the minimal segment length of the given abstract object
Referenced by segIncreaseMinLength().
Referenced by FldHandle::setValue().
|
inherited |
allocate a chunk of stack of known size from the select call stack
|
inlineinherited |
each symbolic heap is associated with a CodeStorage model of code
Definition at line 375 of file symheap.hh.
References SymHeapCore::stor_.
|
virtual |
exchange the contents with the other heap (works in constant time)
Reimplemented from SymHeapCore.
Referenced by SymState::swapExisting().
|
inherited |
return the target specifier of the given address
|
inherited |
each symbolic heap is associated with a trace graph node
|
inherited |
update the current trace graph node that the heap is associated with
collect all objects having the given value inside
dst | reference to a container to store the result to |
val | ID of the value to look for |
liveOnly | if true, exclude objects that are no longer alive |
|
inherited |
return how many objects have the value inside
translate the given address by the given offset
create (or recycle) a VT_RANGE value at the given allocated address
|
inherited |
create a generic value, otherwise use addrOfTarget()
Referenced by traverseProgramVarsGeneric().
return the relative placement from the root
Referenced by areValProtosEqual().
return the offset range associated with the given VT_RANGE value
|
inherited |
classify where the given value originates from
Referenced by areValProtosEqual().
replace all occurrences of val by replaceBy
narrow down the offset range of the given VT_RANGE value
return the address of the root which the given value is binded to
translate the given value by the given offset
|
inherited |
return count of bytes (including NULL) we can safely read as string
|
inherited |
classify the object the given value points to
Referenced by areValProtosEqual(), and isPossibleToDeref().
Referenced by FldHandle::value().
|
inherited |
unwrap a custom value, such as integer literal, or code pointer
|
inherited |
wrap a custom value, such as integer literal, or code pointer
|
inherited |
write an uninitialized or nullified block of memory
Referenced by traverseProgramVarsGeneric().
|
private |
Definition at line 871 of file symheap.hh.
|
protectedinherited |
Definition at line 599 of file symheap.hh.
Referenced by SymHeapCore::stor().