11 namespace boost {
namespace utils {
13 backtrace::backtrace()
17 nptrs_ = ::backtrace(buffer_, BT_BUF_SIZE);
18 locations_ = ::backtrace_symbols(buffer_, nptrs_);
19 if (locations_ == NULL)
21 auto error = strerror(errno);
22 throw std::runtime_error(error);
26 backtrace::~backtrace()
31 void backtrace::dump(std::ostream& os)
const 33 for (
auto j = 0; j < nptrs_; j++)
34 os << locations_[j] << std::endl;
Produces a backtrace of RAII.