diff --git a/src/user.cpp b/src/user.cpp index d16d6bd067c303fbc5efe141c58c85f19f7e794c..110bbfe7b12b6d3ccd1554f079b974a817d2b881 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -30,6 +30,9 @@ #include "Swiften/Elements/MUCPayload.h" #include "log4cxx/logger.h" #include +#include +#include +#include using namespace log4cxx; using namespace boost; @@ -99,8 +102,28 @@ Swift::JID User::getJIDWithFeature(const std::string &feature) { return jid; } +static void +print_trace (void) +{ +void *array[80]; +size_t size; +char **strings; +size_t i; + +size = backtrace (array, 80); +strings = backtrace_symbols (array, size); + +printf ("Obtained %zd stack frames.\n", size); + +for (i = 0; i < size; i++) + printf ("%s\n", strings[i]); + +free (strings); +} + void User::handlePresence(Swift::Presence::ref presence) { std::cout << "PRESENCE " << presence->getFrom().toString() << "\n"; +// print_trace(); if (!m_connected) { // we are not connected to legacy network, so we should do it when disco#info arrive :) if (m_readyForConnect == false) {