libcruft-util/backtrace.hpp

30 lines
668 B
C++
Raw Normal View History

2014-09-17 18:20:28 +10:00
/*
2018-08-04 15:14:06 +10:00
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
2014-09-17 18:20:28 +10:00
*
* Copyright 2019, Danny Robson <danny@nerdcruft.net>
2014-09-17 18:20:28 +10:00
*/
#pragma once
2011-05-23 17:18:52 +10:00
#include <vector>
2018-03-22 16:10:06 +11:00
#include <iosfwd>
2011-05-23 17:18:52 +10:00
2014-09-17 18:20:28 +10:00
///////////////////////////////////////////////////////////////////////////////
namespace cruft {
2011-05-23 17:18:52 +10:00
class backtrace {
public:
backtrace (void);
2011-05-23 17:18:52 +10:00
2018-07-24 15:46:28 +10:00
const auto& frames(void) const { return m_frames; }
private:
std::vector<void *> m_frames;
2011-05-23 17:18:52 +10:00
};
2012-05-10 16:53:29 +10:00
std::ostream&
operator<< (std::ostream&, backtrace const&);
2011-05-23 17:18:52 +10:00
}