X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdebug%2Fbacktrace.cpp;h=1fda155e9665d497f629cb575ea93a33b12a7d3b;hb=b4806214e905752617691f851717033fd3f266c2;hp=5e96005538eed6830bcb87b6e0e967467aa4af2b;hpb=9f2774a500d779af9a38f42bfb03b507444a47b0;p=libs%2Fcore.git diff --git a/source/debug/backtrace.cpp b/source/debug/backtrace.cpp index 5e96005..1fda155 100644 --- a/source/debug/backtrace.cpp +++ b/source/debug/backtrace.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspcore -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - // Must include something to test for glibc #include #if !defined(WIN32) && defined(__GLIBC__) @@ -23,22 +16,22 @@ Backtrace Backtrace::create() { #if !defined(WIN32) && defined(__GLIBC__) void *addresses[50]; - int count=::backtrace(addresses, 50); + int count = ::backtrace(addresses, 50); Backtrace bt; Dl_info dli; for(int i=0; iaddress<<" in "<symbol<<" from "<file<<'\n'; + const list &frames = bt.get_frames(); + for(list::const_iterator i=frames.begin(); i!=frames.end(); ++i) + out<<*i<<'\n'; + + return out; +} + +ostream &operator<<(ostream &out, const Backtrace::StackFrame &sf) +{ + out<