tango.core.tools.StackTrace

Stacktracing
Functions to generate a stacktrace

License:

tango license

Authors:

Fawzi Mohamed
void rt_setAddrBacktraceFnc(AddrBacktraceFunc f) [extern(C)] #
sets the function used for address stacktraces
void rt_setSymbolizeFrameInfoFnc(SymbolizeFrameInfoFnc f) [extern(C)] #
sets the function used to symbolize a FrameInfo
Exception.TraceInfo rt_createTraceContext(void* ptr) [extern(C)] #
creates a stack trace (defined in the runtime)
size_t rt_addrBacktrace(TraceContext* context, TraceContext * contextOut, size_t* traceBuf, size_t bufLength, int * flags) [extern(C)] #
builds a backtrace of addresses, the addresses are addresses of the *next* instruction, *return* addresses, the most likely the calling instruction is the one before them (stack top excluded)
bool rt_symbolizeFrameInfo(ref Exception.FrameInfo fInfo, TraceContext* context, char[] buf) [extern(C)] #
tries to sybolize a frame information, this should try to build the best backtrace information, if possible finding the calling context, thus if fInfo.exactAddress is false the address might be changed to the one preceding it returns true if it managed to at least find the function name
char[] nameOfFunctionAt(void* addr, char[] buf) #
char[] nameOfFunctionAt(void * addr) #
returns the name of the function at the given adress (if possible) function@ and then the address. For delegates you can use .funcptr does not demangle
enum AddrPrecision #
precision of the addresses given by the backtrace function
class BasicTraceInfo : Exception.TraceInfo #
basic class that represents a stacktrace
this() #
cretes an empty stacktrace
this(size_t[] traceAddresses, AddrPrecision addrPrecision) #
creates a stacktrace with the given traceAddresses
void trace(TraceContext * contextIn = null, int skipFrames = 0) #
takes a stacktrace
int opApply(int delegate( ref Exception.FrameInfo fInfo ) loopBody) #
loops on the stacktrace
void writeOut(void delegate(char[]) sink) #
writes out the stacktrace
size_t defaultAddrBacktrace(TraceContext* context, TraceContext* contextOut, size_t* traceBuf, size_t length, int* flags) #
default (tango given) backtrace function
bool dladdrSymbolizeFrameInfo(ref Exception.FrameInfo fInfo, TraceContext* context, char[] buf) #
poor symbolication, uses dladdr, gives no line info, limited info on statically linked files
bool defaultSymbolizeFrameInfo(ref Exception.FrameInfo fInfo, TraceContext * context, char[] buf) #
loads symbols for the given frame info with the methods defined in tango itself
Exception.TraceInfo basicTracer(void* ptr = null) #
function that generates a trace (handler compatible with old TraceInfo)