tango.core.tools.StackTrace

Stacktracing

Functions to generate a stacktrace.

Members

Aliases

AddrBacktraceFunc
alias AddrBacktraceFunc = size_t function(TraceContext* context, TraceContext* contextOut, size_t* traceBuf, size_t bufLength, int* flags)
Undocumented in source.
SymbolizeFrameInfoFnc
alias SymbolizeFrameInfoFnc = bool function(ref FrameInfo fInfo, const(TraceContext)* context, char[] buf)
Undocumented in source.
TraceHandler
alias TraceHandler = Exception.TraceInfo function(void* ptr = null)
Undocumented in source.

Classes

BasicTraceInfo
class BasicTraceInfo

basic class that represents a stacktrace

Enums

AddrPrecision
enum AddrPrecision

precision of the addresses given by the backtrace function

Functions

backtrace
int backtrace(void** , int )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
basicTracer
Exception.TraceInfo basicTracer(void* ptr)

function that generates a trace (handler compatible with old TraceInfo)

defaultAddrBacktrace
size_t defaultAddrBacktrace(TraceContext* context, TraceContext* contextOut, size_t* traceBuf, size_t length, int* flags)

default (tango given) backtrace function

defaultSymbolizeFrameInfo
bool defaultSymbolizeFrameInfo(FrameInfo fInfo, const(TraceContext)* context, char[] buf)

loads symbols for the given frame info with the methods defined in tango itself

dladdr
int dladdr(void* addr, Dl_info* info)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
dladdrSymbolizeFrameInfo
bool dladdrSymbolizeFrameInfo(FrameInfo fInfo, const(TraceContext)* context, char[] buf)

poor symbolication, uses dladdr, gives no line info, limited info on statically linked files

elfSymbolizeFrameInfo
bool elfSymbolizeFrameInfo(FrameInfo fInfo, const(TraceContext)* context, char[] buf)
Undocumented in source.
elfSymbolizeFrameInfo
bool elfSymbolizeFrameInfo(FrameInfo fInfo, const(TraceContext)* context, char[] buf)
Undocumented in source. Be warned that the author may not have intended to support it.
isInternalMethod
bool isInternalMethod(const(char)[] name)
Undocumented in source. Be warned that the author may not have intended to support it.
nameOfFunctionAt
const(char)[] nameOfFunctionAt(void* addr, char[] buf)
const(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

rt_addrBacktrace
size_t rt_addrBacktrace(TraceContext* context, TraceContext* contextOut, size_t* traceBuf, size_t bufLength, int* flags)

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)

rt_createTraceContext
Exception.TraceInfo rt_createTraceContext(void* ptr)

creates a stack trace (defined in the runtime)

rt_setAddrBacktraceFnc
void rt_setAddrBacktraceFnc(AddrBacktraceFunc f)

sets the function used for address stacktraces

rt_setSymbolizeFrameInfoFnc
void rt_setSymbolizeFrameInfoFnc(SymbolizeFrameInfoFnc f)

sets the function used to symbolize a FrameInfo

rt_symbolizeFrameInfo
bool rt_symbolizeFrameInfo(FrameInfo fInfo, const(TraceContext)* context, char[] buf)

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

setupSegfaultTracer
void setupSegfaultTracer()
Undocumented in source. Be warned that the author may not have intended to support it.
tango_stacktrace_fault_handler
void tango_stacktrace_fault_handler(int sn, siginfo_t* si, void* ctx)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

addrBacktraceFnc
AddrBacktraceFunc addrBacktraceFnc;
Undocumented in source.
fault_action
sigaction_t fault_action;
Undocumented in source.
internalFuncs
int[const(char)[]] internalFuncs;
Undocumented in source.
recursiveStackTraces
ThreadLocal!(int) recursiveStackTraces;
Undocumented in source.
symbolizeFrameInfoFnc
SymbolizeFrameInfoFnc symbolizeFrameInfoFnc;
Undocumented in source.

Structs

Dl_info
struct Dl_info
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
TraceContext
struct TraceContext
Undocumented in source.

Variables

internalMethodEnders
const(char[])[] internalMethodEnders;
Undocumented in source.

Meta

License

Tango License

Authors

Fawzi Mohamed