Predator  [unstable] git snapshot
Functions
symseg.hh File Reference

some generic utilities operating on list segments (SLS, DLS, Linux lists) More...

#include "config.h"
#include "symheap.hh"
#include "symutil.hh"

Go to the source code of this file.

Functions

bool haveSeg (const SymHeap &sh, TValId atAddr, TValId pointingTo, EObjKind kind)
 return true if there is a list segment among the given pair of values
bool haveDlSegAt (const SymHeap &sh, TValId atAddr, TValId peerAddr)
 return true if there is a DLS (Doubly-linked List Segment) among the given pair of values
PtrHandle nextPtrFromSeg (const SymHeap &sh, TObjId seg)
 return 'next' pointer in the given segment
PtrHandle prevPtrFromSeg (const SymHeap &sh, TObjId seg)
 return 'prev' pointer in the given segment
TValId nextValFromSeg (const SymHeap &sh, TObjId seg)
 return the value of 'next' in the given segment
TValId nextValFromSegAddr (const SymHeap &sh, TValId addr)
TValId prevValFromSegAddr (const SymHeap &sh, TValId addr)
TOffset headOffset (const SymHeap &sh, const TObjId seg)
TValId segHeadAt (SymHeap &sh, TObjId seg, ETargetSpecifier ts)
 return address of segment's head (useful mainly for Linux lists)
TMinLen objMinLength (const SymHeap &sh, TObjId obj)
bool segProveNeq (const SymHeap &sh, TValId v1, TValId v2)
 return true if the given pair of values is proven to be non-equal
void segIncreaseMinLength (SymHeap &sh, const TObjId seg, TMinLen len)
 if the current segment min length is lower than the given one, update it!
bool segApplyNeq (SymHeap &sh, TValId v1, TValId v2)
 we know (v1 != v2), update related segments in the given heap accordingly!
bool isObjWithBinding (const EObjKind kind)
void buildIgnoreList (TFldSet &ignoreList, const SymHeap &sh, const TObjId obj)
void buildIgnoreList (TFldSet &ignoreList, SymHeap &sh, const TObjId obj, const BindingOff &bf)
TValId lookThrough (const SymHeap &sh, TValId val, TValSet *pSeen=0)
 look through possibly empty objects and return the value seen
bool segCheckConsistency (const SymHeap &sh)
 true if all segments have populated next/prev pointers

Detailed Description

some generic utilities operating on list segments (SLS, DLS, Linux lists)

Definition in file symseg.hh.

Function Documentation

void buildIgnoreList ( TFldSet ignoreList,
const SymHeap sh,
const TObjId  obj 
)
inline
void buildIgnoreList ( TFldSet ignoreList,
SymHeap sh,
const TObjId  obj,
const BindingOff bf 
)
inline

Definition at line 183 of file symseg.hh.

References FldHandle::isValidHandle(), BindingOff::next, and BindingOff::prev.

bool haveDlSegAt ( const SymHeap sh,
TValId  atAddr,
TValId  peerAddr 
)

return true if there is a DLS (Doubly-linked List Segment) among the given pair of values

Parameters
shan instance of symbolic heap
atAddraddress of the heap object for consideration
peerAddrpotential address of DLS peer object
bool haveSeg ( const SymHeap sh,
TValId  atAddr,
TValId  pointingTo,
EObjKind  kind 
)

return true if there is a list segment among the given pair of values

Parameters
shan instance of symbolic heap
atAddraddress of the heap object for consideration
pointingTotarget address of the given potential list segment
kindkind of list segment to look for
TOffset headOffset ( const SymHeap sh,
const TObjId  seg 
)
inline
bool isObjWithBinding ( const EObjKind  kind)
inline

Definition at line 134 of file symseg.hh.

References OK_DLS, OK_OBJ_OR_NULL, OK_REGION, OK_SEE_THROUGH, OK_SEE_THROUGH_2N, and OK_SLS.

TValId lookThrough ( const SymHeap sh,
TValId  val,
TValSet pSeen = 0 
)

look through possibly empty objects and return the value seen

PtrHandle nextPtrFromSeg ( const SymHeap sh,
TObjId  seg 
)
inline

return 'next' pointer in the given segment

Definition at line 55 of file symseg.hh.

References CL_BREAK_IF, SymHeap::objKind(), OK_REGION, and SymHeap::segBinding().

Referenced by nextValFromSeg().

TValId nextValFromSeg ( const SymHeap sh,
TObjId  seg 
)
inline

return the value of 'next' in the given segment

Definition at line 73 of file symseg.hh.

References nextPtrFromSeg(), SymHeap::objKind(), OK_OBJ_OR_NULL, VAL_NULL, and FldHandle::value().

TValId nextValFromSegAddr ( const SymHeap sh,
TValId  addr 
)
TMinLen objMinLength ( const SymHeap sh,
TObjId  obj 
)
inline
PtrHandle prevPtrFromSeg ( const SymHeap sh,
TObjId  seg 
)
inline

return 'prev' pointer in the given segment

Definition at line 64 of file symseg.hh.

References CL_BREAK_IF, SymHeap::objKind(), OK_REGION, and SymHeap::segBinding().

TValId prevValFromSegAddr ( const SymHeap sh,
TValId  addr 
)
bool segApplyNeq ( SymHeap sh,
TValId  v1,
TValId  v2 
)

we know (v1 != v2), update related segments in the given heap accordingly!

bool segCheckConsistency ( const SymHeap sh)

true if all segments have populated next/prev pointers

TValId segHeadAt ( SymHeap sh,
TObjId  seg,
ETargetSpecifier  ts 
)
inline

return address of segment's head (useful mainly for Linux lists)

Definition at line 97 of file symseg.hh.

References SymHeapCore::addrOfTarget(), CL_BREAK_IF, SymHeap::objKind(), OK_REGION, and SymHeap::segBinding().

void segIncreaseMinLength ( SymHeap sh,
const TObjId  seg,
TMinLen  len 
)
inline

if the current segment min length is lower than the given one, update it!

Definition at line 123 of file symseg.hh.

References CL_BREAK_IF, SymHeap::segMinLength(), and SymHeap::segSetMinLength().

bool segProveNeq ( const SymHeap sh,
TValId  v1,
TValId  v2 
)

return true if the given pair of values is proven to be non-equal