1 #ifndef _BACKTRACING_HPP 2 #define _BACKTRACING_HPP 8 #include <containers/Vector.hpp> 9 #include <debug/Demangle.hpp> 10 #include <utility/String.hpp> 32 explicit BackTraceSymbol(
const char* str) :
33 compilUnit(substrBetweenPos(str,0,std::string(str).find(
'('))),
34 symbol(substrBetween(str,
'(',
'+')),
35 offset(substrBetween(str,
'+',
')')),
36 address(substrBetween(str,
'[',
']'))
42 template <
int NMAX_REW=128>
46 void* callstack[NMAX_REW];
50 backtrace(callstack,NMAX_REW);
54 backtrace_symbols(callstack,nRew);
60 for(
int i=0;i<nRew;i++)
61 res.emplace_back(strs[i]);
84 ", offset: "<<((s.offset!=
"")?s.offset:
"n.a")<<
85 ", address: "<<s.address;
void printBacktraceList()
Write the list of called routines.
Decompose the backtrace symbol.
Vector< BackTraceSymbol > getBackTraceList()
Gets the backtracing symbols list.
void divWithMod(Vector< TOut > "ient, Vector< TOut > &remainder, const Vector &divisor) const
Returns the result and remainder of the division.
const std::string offset
Offset.
const std::string symbol
Symbol name.
const std::string address
Address.
const std::string compilUnit
Compilation unit.