]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/backtrace.h
Use nullptr instead of 0 for pointers
[libs/core.git] / source / debug / backtrace.h
index 9715df0ed8026c395af1cf1b865b1fc9b4ba4a64..98aa4d8cdd9736291253cecf403b10d75bf43b2a 100644 (file)
@@ -1,15 +1,9 @@
-/* $Id$
-
-This file is part of libmspcore
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
 #ifndef MSP_DEBUG_BACKTRACE_H_
 #define MSP_DEBUG_BACKTRACE_H_
 
-#include <list>
 #include <ostream>
 #include <string>
+#include <vector>
 
 namespace Msp {
 namespace Debug {
@@ -19,22 +13,22 @@ class Backtrace
 public:
        struct StackFrame
        {
-               void *address;
+               void *address = nullptr;
                std::string file;
                std::string symbol;
-
-               //StackFrame(void *a, const std::string &s): address(a), symbol(s) { }
        };
-       typedef std::list<StackFrame> FrameSeq;
 
-       const FrameSeq &get_frames() const { return frames; }
+private:
+       std::vector<StackFrame> frames;
+
+public:
+       const std::vector<StackFrame> &get_frames() const { return frames; }
 
        static Backtrace create();
-private:
-       FrameSeq frames;
 };
 
 std::ostream &operator<<(std::ostream &, const Backtrace &);
+std::ostream &operator<<(std::ostream &, const Backtrace::StackFrame &);
 
 } // namespace Debug
 } // namespace Msp