15#include <zypp/base/LogTools.h>
16#include <zypp/base/String.h>
29 size_t size = ::backtrace( array,
arraySize );
34 char ** messages = ::backtrace_symbols( array, size );
37 static const size_t handlerStack = 3;
38 static const size_t first = 0;
39 for (
size_t i = first; i < size; ++i )
41 char * mangled_name = 0;
42 char * offset_begin = 0;
43 char * offset_end = 0;
46 for (
char * p = messages[i]; *p; ++p )
63 int btLevel = i-handlerStack;
68 stream_r <<
"vvvvvvvvvv----------------------------------------" << endl;
70 stream_r <<
"[" << (btLevel<0 ?
"hd":
"bt") <<
"]: (" << btLevel <<
") ";
73 if ( mangled_name && offset_begin && offset_end && mangled_name < offset_begin )
75 *mangled_name++ =
'\0';
76 *offset_begin++ =
'\0';
80 char * real_name = ::abi::__cxa_demangle( mangled_name, 0, 0, &status );
85 stream_r << messages[i] <<
" : " << real_name <<
"+" << offset_begin << offset_end;
90 stream_r << messages[i] <<
" : " << mangled_name <<
"+" << offset_begin << offset_end;
97 stream_r << messages[i];
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpBacktrace(std::ostream &stream_r)
Dump current stack trace to a stream.