1 #include <pbd/stacktrace.h>
4 /* Obtain a backtrace and print it to stdout. */
12 PBD::stacktrace (std::ostream& out, int levels)
19 size = backtrace (array, 200);
20 strings = backtrace_symbols (array, size);
24 printf ("Obtained %zd stack frames.\n", size);
26 for (i = 0; i < size && (levels == 0 || i < levels); i++) {
27 out << strings[i] << std::endl;
37 PBD::stacktrace (std::ostream& out, int levels)
39 out << "stack tracing is not enabled on this platform" << std::endl;
42 #endif /* HAVE_EXECINFO */