Predator  [unstable] git snapshot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
SymProc Class Reference

a layer on top of SymHeap, providing some higher-level operations More...

#include <symproc.hh>

Inheritance diagram for SymProc:
Inheritance graph
[legend]
Collaboration diagram for SymProc:
Collaboration graph
[legend]

Public Member Functions

 SymProc (SymHeap &heap, const SymBackTrace *bt)
 creation of the symbolic heap processor is a really cheap operation
virtual ~SymProc ()
SymHeapsh ()
const SymBackTracebt ()
struct cl_loclw ()
void setLocation (const struct cl_loc *lw)
 update location info
FldHandle fldByOperand (const struct cl_operand &op)
 obtain a heap object corresponding to the given operand
TValId valFromOperand (const struct cl_operand &op)
 obtain a heap value corresponding to the given operand
bool fncFromOperand (int *pUid, const struct cl_operand &op)
 resolve Fnc uid from the given operand, return true on success
void setValueOf (const FldHandle &lhs, TValId rhs)
 high-level interface to FldHandle::setValue()
void objDestroy (TObjId obj)
 high-level interface to SymHeap::objInvalidate()
void killInsn (const CodeStorage::Insn &)
 invalidate all variables that are killed by the given instruction
void killPerTarget (const CodeStorage::Insn &, unsigned target)
 invalidate all variables killed by the given instruction per target
bool checkForInvalidDeref (TValId val, TSizeOf sizeOfTarget)
 check whether we can safely access sizeOfTarget at the given address
void printBackTrace (EMsgLevel level, bool forcePtrace=false)
 print backtrace and update the current error level correspondingly
bool hasFatalError () const
 if true, the current state is not going to be inserted into dst

Protected Member Functions

TObjId objByVar (const CVar &cv, bool initOnly=false)
TObjId objByVar (const struct cl_operand &op)
TValId targetAt (const struct cl_operand &op)
virtual void varInit (TObjId reg)

Protected Attributes

SymHeapsh_
const SymBackTracebt_
struct cl_loclw_
bool errorDetected_

Private Member Functions

TValId valFromObj (const struct cl_operand &op)
TValId valFromCst (const struct cl_operand &op)
void killVar (const CodeStorage::KillVar &kv)

Friends

void initGlVar (SymHeap &sh, const CVar &cv)

Detailed Description

a layer on top of SymHeap, providing some higher-level operations

Definition at line 94 of file symproc.hh.

Constructor & Destructor Documentation

SymProc ( SymHeap heap,
const SymBackTrace bt 
)
inline

creation of the symbolic heap processor is a really cheap operation

Parameters
heapan instance of SymHeap to operate on
btan instance of symbolic backtrace used to distinguish among instances of automatic variables and to print backtraces when necessary/suitable

Definition at line 103 of file symproc.hh.

virtual ~SymProc ( )
inlinevirtual

Definition at line 111 of file symproc.hh.

Member Function Documentation

const SymBackTrace* bt ( )
inline

Definition at line 114 of file symproc.hh.

References bt_.

bool checkForInvalidDeref ( TValId  val,
TSizeOf  sizeOfTarget 
)

check whether we can safely access sizeOfTarget at the given address

FldHandle fldByOperand ( const struct cl_operand op)

obtain a heap object corresponding to the given operand

bool fncFromOperand ( int *  pUid,
const struct cl_operand op 
)

resolve Fnc uid from the given operand, return true on success

bool hasFatalError ( ) const

if true, the current state is not going to be inserted into dst

void killInsn ( const CodeStorage::Insn )

invalidate all variables that are killed by the given instruction

void killPerTarget ( const CodeStorage::Insn ,
unsigned  target 
)

invalidate all variables killed by the given instruction per target

void killVar ( const CodeStorage::KillVar kv)
private
struct cl_loc* lw ( )
inlineread

Definition at line 115 of file symproc.hh.

References lw_.

Referenced by setLocation().

TObjId objByVar ( const CVar cv,
bool  initOnly = false 
)
protected
TObjId objByVar ( const struct cl_operand op)
protected
void objDestroy ( TObjId  obj)

high-level interface to SymHeap::objInvalidate()

void printBackTrace ( EMsgLevel  level,
bool  forcePtrace = false 
)

print backtrace and update the current error level correspondingly

void setLocation ( const struct cl_loc lw)
inline

update location info

Note
this method is used to provide as accurate as possible location info in error/warning messages
Parameters
lwwhere to retrieve the location info from

Definition at line 123 of file symproc.hh.

References lw(), and lw_.

void setValueOf ( const FldHandle lhs,
TValId  rhs 
)

high-level interface to FldHandle::setValue()

SymHeap& sh ( )
inline

Definition at line 113 of file symproc.hh.

References sh_.

Referenced by operator<().

TValId targetAt ( const struct cl_operand op)
protected
TValId valFromCst ( const struct cl_operand op)
private
TValId valFromObj ( const struct cl_operand op)
private
TValId valFromOperand ( const struct cl_operand op)

obtain a heap value corresponding to the given operand

virtual void varInit ( TObjId  reg)
protectedvirtual

Reimplemented in SymExecCore.

Friends And Related Function Documentation

void initGlVar ( SymHeap sh,
const CVar cv 
)
friend

Field Documentation

const SymBackTrace* bt_
protected

Definition at line 172 of file symproc.hh.

Referenced by bt().

bool errorDetected_
protected

Definition at line 174 of file symproc.hh.

struct cl_loc* lw_
protected

Definition at line 173 of file symproc.hh.

Referenced by lw(), and setLocation().

SymHeap& sh_
protected

Definition at line 171 of file symproc.hh.

Referenced by sh().


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