From bddffe4de070f28bcc1def8bfc5f86dc385aa81f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 24 Aug 2008 21:35:30 +0000 Subject: [PATCH] Improve BackTrace printing --- source/core/application.cpp | 7 +------ source/debug/backtrace.cpp | 12 +++++++++++- source/debug/backtrace.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) 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<