21 #ifndef __libpbd_stacktrace_h__
22 #define __libpbd_stacktrace_h__
25 #include "libpbd-config.h"
31 #include <glibmm/threads.h>
90 typename std::list<thing_with_backtrace<T>*>::iterator x;
91 for (x =
all.begin(); x !=
all.end(); ++x) {
95 strings = backtrace_symbols ((*x)->allocation_backtrace, (*x)->allocation_backtrace_size);
98 stream <<
"--- ALLOCATED SHARED_PTR @ " << (*x) << std::endl;
99 for (i = 0; i < (*x)->allocation_backtrace_size && i < 50U; i++) {
100 stream << strings[i] << std::endl;
106 stream <<
"execinfo not defined for this platform" << std::endl;
113 static std::list<thing_with_backtrace<T>* >
all;
thing_with_backtrace(const thing_with_backtrace< T > &other)
static Glib::Threads::Mutex all_mutex
static void peek_a_boo(std::ostream &stream)
int allocation_backtrace_size
static std::list< thing_with_backtrace< T > * > all
void ** allocation_backtrace
thing_with_backtrace< T > & operator=(const thing_with_backtrace< T > &other)
void stacktrace(std::ostream &out, int levels=0, size_t start_level=0)