Index: vst_plugin.cc =================================================================== --- vst_plugin.cc (Revision 4725) +++ vst_plugin.cc (Arbeitskopie) @@ -29,6 +29,7 @@ #include // for memmove #include #include +#include #include #include @@ -371,6 +372,34 @@ return ret; } +void +myBacktrace(void) +{ + int j, nptrs; +#define SIZE 100 + void *buffer[100]; + char **strings; + + nptrs = backtrace(buffer, SIZE); + fprintf(stderr, "\nThread ID = 0x%x\n", pthread_self ()); + fprintf(stderr, "backtrace() returned %d addresses\n", nptrs); + + /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO) + would produce similar output to the following: */ + + strings = backtrace_symbols(buffer, nptrs); + if (strings == NULL) { + perror("backtrace_symbols"); + exit(EXIT_FAILURE); + } + + for (j = 0; j < nptrs; j++) + fprintf(stderr, "%s\n", strings[j]); + + free(strings); +} + + int VSTPlugin::connect_and_run (vector& bufs, uint32_t maxbuf, int32_t& in_index, int32_t& out_index, nframes_t nframes, nframes_t offset) { @@ -398,6 +427,7 @@ /* we already know it can support processReplacing */ + myBacktrace (); _plugin->processReplacing (_plugin, ins, outs, nframes); return 0;