From: Mikko Rasa Date: Sun, 24 Aug 2008 21:35:30 +0000 (+0000) Subject: Improve BackTrace printing X-Git-Tag: 1.1~12 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=bddffe4de070f28bcc1def8bfc5f86dc385aa81f;p=libs%2Fcore.git Improve BackTrace printing --- diff --git a/source/core/application.cpp b/source/core/application.cpp index cc9946c..82134df 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -78,12 +78,7 @@ int Application::run(int argc, char **argv, void *data) cerr<<" backtrace:\n"; const Debug::Backtrace::FrameSeq &frames=exc->get_backtrace().get_frames(); for(Debug::Backtrace::FrameSeq::const_iterator i=frames.begin(); i!=frames.end(); ++i) - { - cerr<<" "<address; - if(!i->symbol.empty()) - cerr<<" in "<symbol; - cerr<<" from "<file<<'\n'; - } + cerr<<" "<<*i<<'\n'; } #endif diff --git a/source/debug/backtrace.cpp b/source/debug/backtrace.cpp index 5e96005..fe7dbff 100644 --- a/source/debug/backtrace.cpp +++ b/source/debug/backtrace.cpp @@ -52,7 +52,17 @@ ostream &operator<<(ostream &out, const Backtrace &bt) { const Backtrace::FrameSeq &frames=bt.get_frames(); for(Backtrace::FrameSeq::const_iterator i=frames.begin(); i!=frames.end(); ++i) - out<address<<" in "<symbol<<" from "<file<<'\n'; + out<<*i<<'\n'; + + return out; +} + +ostream &operator<<(ostream &out, const Backtrace::StackFrame &sf) +{ + out<