]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/backtrace.cpp
Drop copyright and license notices from source files
[libs/core.git] / source / debug / backtrace.cpp
index fe7dbffcd51a39216c783bdcd47f7d2bb45200dd..1fda155e9665d497f629cb575ea93a33b12a7d3b 100644 (file)
@@ -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 <cstdlib>
 #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; i<count; ++i)
        {
                StackFrame frame;
-               frame.address=addresses[i];
+               frame.address = addresses[i];
                if(dladdr(addresses[i], &dli))
                {
-                       frame.file=dli.dli_fname;
+                       frame.file = dli.dli_fname;
                        if(dli.dli_sname)
-                               frame.symbol=demangle(dli.dli_sname);
+                               frame.symbol = demangle(dli.dli_sname);
                }
                else
-                       frame.file="<unknown>";
+                       frame.file = "<unknown>";
                bt.frames.push_back(frame);
        }
 
@@ -50,8 +43,8 @@ Backtrace Backtrace::create()
 
 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)
+       const list<Backtrace::StackFrame> &frames = bt.get_frames();
+       for(list<Backtrace::StackFrame>::const_iterator i=frames.begin(); i!=frames.end(); ++i)
                out<<*i<<'\n';
 
        return out;