Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

IgHookTrace Class Reference

#include <IgHook_IgHookTrace.h>

Collaboration diagram for IgHookTrace:
Collaboration graph
[legend]

List of all members.

Classes

struct  Counter
 Nearly dummy object type to identify a counter. More...
class  CounterValue
 Value for a counter chained from a trace. More...

Public Member Functions

void * operator new (size_t n, IgHookTraceAlloc *alloc=0)
 IgHookTrace (IgHookTrace *parent=0, void *address=0)
IgHookTraceparent (void)
IgHookTracenext (void)
void * address (void)
bool symbol (const char *&sym, const char *&lib, int &offset, int &liboffset)
IgHookTracechildren (void)
IgHookTracechild (void *address)
CounterValuecounters (void)
CounterValuecounter (Counter *id)
void merge (IgHookTrace *other)

Static Public Member Functions

static int stacktrace (void **addresses, int nmax)
static void * tosymbol (void *address)
static bool symbol (void *address, const char *&sym, const char *&lib, int &offset, int &liboffset)

Private Attributes

IgHookTraceAllocm_alloc
IgHookTracem_parent
IgHookTracem_next
IgHookTracem_children
void * m_address
CounterValuem_counters

Detailed Description

Definition at line 27 of file IgHook_IgHookTrace.h.


Constructor & Destructor Documentation

IgHookTrace::IgHookTrace ( IgHookTrace parent = 0,
void *  address = 0 
)

Definition at line 205 of file IgHook_IgHookTrace.cpp.

00206     : m_alloc (parent ? parent->m_alloc : new IgHookTraceAlloc),
00207       m_parent (parent),
00208       m_next (parent ? parent->m_children : 0),
00209       m_children (0),
00210       m_address (address),
00211       m_counters (0)
00212 { if (m_parent) m_parent->m_children = this; }


Member Function Documentation

void * IgHookTrace::address ( void   ) 

Definition at line 223 of file IgHook_IgHookTrace.cpp.

00224 { return m_address; }

IgHookTrace* IgHookTrace::child ( void *  address  ) 
IgHookTrace* IgHookTrace::children ( void   ) 
CounterValue* IgHookTrace::counter ( Counter id  ) 
CounterValue* IgHookTrace::counters ( void   ) 
void IgHookTrace::merge ( IgHookTrace other  ) 
IgHookTrace * IgHookTrace::next ( void   ) 

Definition at line 219 of file IgHook_IgHookTrace.cpp.

00220 { return m_next; }

void * IgHookTrace::operator new ( size_t  n,
IgHookTraceAlloc alloc = 0 
)

Definition at line 202 of file IgHook_IgHookTrace.cpp.

00203 { return alloc ? alloc->allocate (n) : ::operator new (n); }

IgHookTrace * IgHookTrace::parent ( void   ) 

Definition at line 215 of file IgHook_IgHookTrace.cpp.

00216 { return m_parent; }

static int IgHookTrace::stacktrace ( void **  addresses,
int  nmax 
) [static]
bool IgHookTrace::symbol ( const char *&  sym,
const char *&  lib,
int &  offset,
int &  liboffset 
)

Definition at line 259 of file IgHook_IgHookTrace.cpp.

00260 { return symbol (m_address, sym, lib, offset, liboffset); }

bool IgHookTrace::symbol ( void *  address,
const char *&  sym,
const char *&  lib,
int &  offset,
int &  liboffset 
) [static]

Definition at line 227 of file IgHook_IgHookTrace.cpp.

00232 {
00233     sym = lib = 0;
00234     offset = 0;
00235     liboffset = (unsigned long) address;
00236 
00237     Dl_info info;
00238     if (dladdr (address, &info))
00239     {
00240         if (info.dli_fname && info.dli_fname [0])
00241             lib = info.dli_fname;
00242 
00243         if (info.dli_fbase)
00244             liboffset = (unsigned long) address - (unsigned long) info.dli_fbase;
00245 
00246         if (info.dli_saddr)
00247             offset = (unsigned long) address - (unsigned long) info.dli_saddr;
00248 
00249         if (info.dli_sname && info.dli_sname [0])
00250             sym = info.dli_sname;
00251 
00252         return true;
00253     }
00254 
00255     return false;
00256 }

void * IgHookTrace::tosymbol ( void *  address  )  [static]

Definition at line 263 of file IgHook_IgHookTrace.cpp.

00264 {
00265     Dl_info info;
00266     return (dladdr (address, &info)
00267             && info.dli_fname
00268             && info.dli_fname [0]
00269             && info.dli_saddr)
00270         ? info.dli_saddr : address;
00271 }


Member Data Documentation

void* IgHookTrace::m_address [private]

Definition at line 99 of file IgHook_IgHookTrace.h.

Definition at line 95 of file IgHook_IgHookTrace.h.

Definition at line 98 of file IgHook_IgHookTrace.h.

Definition at line 100 of file IgHook_IgHookTrace.h.

Definition at line 97 of file IgHook_IgHookTrace.h.

Definition at line 96 of file IgHook_IgHookTrace.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Wed Feb 9 16:30:58 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004