tango.core.tools.StackTrace

Stacktracing
Functions to generate a stacktrace.

License:

Tango License

Author:

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() #
Creates 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.)