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

backtrace management More...

#include <symbt.hh>

Public Member Functions

 SymBackTrace (const CodeStorage::Storage &stor)
 ~SymBackTrace ()
 SymBackTrace (const SymBackTrace &)
const CodeStorage::Storagestor () const
void pushCall (int fncId, const struct cl_loc *loc)
 enter a call of function, thus enlarge the backtrace by one
const CodeStorage::FncpopCall ()
 leave the call of function on top of the backtrace
unsigned size () const
 size of the backtrace, aka call depth
int countOccurrencesOfFnc (int fncId) const
 count occurrences of the given function.
int countOccurrencesOfTopFnc () const
 same as countOccurrencesOfFnc(), but operating on top of the backtrace stack
const CodeStorage::FnctopFnc () const
 return the topmost function in the backtrace
struct cl_loctopCallLoc () const
 return location of call of the topmost function in the backtrace

Protected Member Functions

bool printBackTrace () const
 stream out the backtrace, using CL_NOTE_MSG; or do nothing if the backtrace is trivial

Private Member Functions

SymBackTraceoperator= (const SymBackTrace &)

Private Attributes

Private * d

Friends

class SymProc
class SymExecEngine

Detailed Description

backtrace management

Definition at line 42 of file symbt.hh.

Constructor & Destructor Documentation

Parameters
storreference to storage object, used for resolving fnc IDs
SymBackTrace ( const SymBackTrace )

Member Function Documentation

int countOccurrencesOfFnc ( int  fncId) const

count occurrences of the given function.

Zero means the function does not occur in the backtrace. Non-zero means the function occurs in the backtrace. Moreover, if the value is more than one, the function has been called recursively.

Note
The function is not implemented or used right now, but is going to be as soon as we allow recursion. We need the returned value to distinguish among different instances of the same local variable.
int countOccurrencesOfTopFnc ( ) const

same as countOccurrencesOfFnc(), but operating on top of the backtrace stack

SymBackTrace& operator= ( const SymBackTrace )
private
const CodeStorage::Fnc* popCall ( )

leave the call of function on top of the backtrace

Note
it's safe to ignore the return value
bool printBackTrace ( ) const
protected

stream out the backtrace, using CL_NOTE_MSG; or do nothing if the backtrace is trivial

Returns
true if the backtrace is not trivial
void pushCall ( int  fncId,
const struct cl_loc loc 
)

enter a call of function, thus enlarge the backtrace by one

Parameters
fncIdID of function, which is being called
loclocation of the call related to the caller (definitely not location of the called function)
unsigned size ( ) const

size of the backtrace, aka call depth

const CodeStorage::Storage& stor ( ) const
Todo:
consider fitness of this method in the public interface of SymBackTrace
struct cl_loc* topCallLoc ( ) const
read

return location of call of the topmost function in the backtrace

const CodeStorage::Fnc* topFnc ( ) const

return the topmost function in the backtrace

Friends And Related Function Documentation

friend class SymExecEngine
friend

Definition at line 107 of file symbt.hh.

friend class SymProc
friend

Definition at line 106 of file symbt.hh.

Field Documentation

Private* d
private

Definition at line 112 of file symbt.hh.


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