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

extension of SymProc, now only used by SymExecEngine::execNontermInsn() More...

#include <symproc.hh>

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

Public Member Functions

 SymExecCore (SymHeap &heap, const SymBackTrace *bt, const SymExecCoreParams &ep=SymExecCoreParams())
 creation of the symbolic heap processor is a really cheap operation
const SymExecCoreParamsparams () const
bool exec (SymState &dst, const CodeStorage::Insn &insn)
 execute a non-terminal instruction using the managed symbolic heap
void execStackAlloc (const struct cl_operand &opLhs, const TSizeRange &)
void execStackRestore ()
void execHeapAlloc (SymState &dst, const CodeStorage::Insn &insn, TSizeRange size, bool nullified)
void execFree (TValId val)
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

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

Protected Attributes

SymHeapsh_
const SymBackTracebt_
struct cl_loclw_
bool errorDetected_

Private Member Functions

template<int ARITY>
void execOp (const CodeStorage::Insn &insn)
template<class TDerefs >
bool concretizeLoop (SymState &dst, const CodeStorage::Insn &insn, const TDerefs &derefs)
void handleLabel (const CodeStorage::Insn &)
bool execCore (SymState &dst, const CodeStorage::Insn &insn)

Private Attributes

const SymExecCoreParams ep_

Detailed Description

extension of SymProc, now only used by SymExecEngine::execNontermInsn()

Definition at line 213 of file symproc.hh.

Constructor & Destructor Documentation

SymExecCore ( SymHeap heap,
const SymBackTrace bt,
const SymExecCoreParams ep = SymExecCoreParams() 
)
inline

creation of the symbolic heap processor is a really cheap operation

Parameters
epexecution parameters - see SymExecCoreParams for details

Definition at line 219 of file symproc.hh.

Member Function Documentation

const SymBackTrace* bt ( )
inlineinherited

Definition at line 114 of file symproc.hh.

References SymProc::bt_.

bool checkForInvalidDeref ( TValId  val,
TSizeOf  sizeOfTarget 
)
inherited

check whether we can safely access sizeOfTarget at the given address

bool concretizeLoop ( SymState dst,
const CodeStorage::Insn insn,
const TDerefs &  derefs 
)
private
bool exec ( SymState dst,
const CodeStorage::Insn insn 
)

execute a non-terminal instruction using the managed symbolic heap

Note
see also CodeStorage::Insn
see also code_listener.h::cl_is_term_insn()
Parameters
dsta container to store the result(s) to
insnan instruction to be executed
Note
returning false in this case does not mean there has been an error
Returns
true, if the requested instruction has been processed; false if the instruction has to be processed elsewhere (usually CL_INSN_CALL)
bool execCore ( SymState dst,
const CodeStorage::Insn insn 
)
private
void execFree ( TValId  val)
void execHeapAlloc ( SymState dst,
const CodeStorage::Insn insn,
TSizeRange  size,
bool  nullified 
)
void execOp ( const CodeStorage::Insn insn)
private
void execStackAlloc ( const struct cl_operand opLhs,
const TSizeRange  
)
void execStackRestore ( )
FldHandle fldByOperand ( const struct cl_operand op)
inherited

obtain a heap object corresponding to the given operand

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

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

void handleLabel ( const CodeStorage::Insn )
private
bool hasFatalError ( ) const
inherited

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

void killInsn ( const CodeStorage::Insn )
inherited

invalidate all variables that are killed by the given instruction

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

invalidate all variables killed by the given instruction per target

struct cl_loc* lw ( )
inlinereadinherited

Definition at line 115 of file symproc.hh.

References SymProc::lw_.

Referenced by SymProc::setLocation().

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

high-level interface to SymHeap::objInvalidate()

const SymExecCoreParams& params ( ) const
inline

Definition at line 226 of file symproc.hh.

References ep_.

void printBackTrace ( EMsgLevel  level,
bool  forcePtrace = false 
)
inherited

print backtrace and update the current error level correspondingly

void setLocation ( const struct cl_loc lw)
inlineinherited

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 SymProc::lw(), and SymProc::lw_.

void setValueOf ( const FldHandle lhs,
TValId  rhs 
)
inherited

high-level interface to FldHandle::setValue()

SymHeap& sh ( )
inlineinherited

Definition at line 113 of file symproc.hh.

References SymProc::sh_.

Referenced by operator<().

TValId targetAt ( const struct cl_operand op)
protectedinherited
TValId valFromOperand ( const struct cl_operand op)
inherited

obtain a heap value corresponding to the given operand

virtual void varInit ( TObjId  reg)
protectedvirtual

Reimplemented from SymProc.

Field Documentation

const SymBackTrace* bt_
protectedinherited

Definition at line 172 of file symproc.hh.

Referenced by SymProc::bt().

const SymExecCoreParams ep_
private

Definition at line 271 of file symproc.hh.

Referenced by params().

bool errorDetected_
protectedinherited

Definition at line 174 of file symproc.hh.

struct cl_loc* lw_
protectedinherited

Definition at line 173 of file symproc.hh.

Referenced by SymProc::lw(), and SymProc::setLocation().

SymHeap& sh_
protectedinherited

Definition at line 171 of file symproc.hh.

Referenced by SymProc::sh().


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