MCPcopy Create free account
hub / github.com/clementgallet/libTAS / printBacktrace

Function printBacktrace

src/library/backtrace.cpp:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace libtas {
26
27void printBacktrace(void)
28{
29 thread_local static int recurs = 0;
30 if (recurs)
31 return;
32 recurs = 1;
33
34 void* addresses[256];
35 const int n = backtrace(addresses, 256);
36 /* Use `backtrace_symbols_fd` instead of `backtrace_symbols` to avoid using
37 * `malloc`. Also, don't print the top three functions as those are libtas
38 * functions calling this */
39 backtrace_symbols_fd(addresses+3, n-3, STDERR_FILENO);
40 recurs = 0;
41}
42
43}

Callers 1

debuglogfullFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected