MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / print_trace

Function print_trace

sources/utils/DefaultSignalHandler.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 void print_trace()
84 {
85 const int MAX_SIZE = 50;
86 void* addresses[MAX_SIZE];
87 int size = backtrace(addresses, MAX_SIZE);
88
89 if (!size)
90 return;
91
92 Logger* log = Logger::getInstance("CORE");
93 char** symbols = backtrace_symbols(addresses, size);
94
95 /* Skip first 2 frames as they are signal
96 * handler and print_trace functions. */
97 for (int i = 2; i < size; ++i)
98 {
99 std::string line = "\t" + decipher_trace(symbols[i]);
100 Error(log, line.c_str());
101 }
102
103 free(symbols);
104 }
105
106 void install_default_handler(int signum)
107 {

Callers 1

signal_handlerFunction · 0.85

Calls 1

decipher_traceFunction · 0.85

Tested by

no test coverage detected