make PBD::stacktrace() be clear if it cannot generate stacktraces for some (runtime) reason. not sure why this is an issue, but it is, right now, on my machine
This commit is contained in:
parent
16ce39c230
commit
a5d3f2d578
@ -77,15 +77,21 @@ PBD::stacktrace (std::ostream& out, int levels)
|
||||
size_t i;
|
||||
|
||||
size = backtrace (array, 200);
|
||||
strings = backtrace_symbols (array, size);
|
||||
|
||||
if (strings) {
|
||||
|
||||
for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) {
|
||||
out << " " << demangle (strings[i]) << std::endl;
|
||||
if (size) {
|
||||
strings = backtrace_symbols (array, size);
|
||||
|
||||
if (strings) {
|
||||
|
||||
for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) {
|
||||
out << " " << demangle (strings[i]) << std::endl;
|
||||
std::cerr << " " << demangle (strings[i]) << std::endl;
|
||||
}
|
||||
|
||||
free (strings);
|
||||
}
|
||||
|
||||
free (strings);
|
||||
} else {
|
||||
out << "no stacktrace available!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user