Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Reference

Header <boost/stacktrace/stacktrace.hpp>
Header <boost/stacktrace/detail/frame_decl.hpp>
Header <boost/stacktrace/frame.hpp>
Header <boost/stacktrace/safe_dump_to.hpp>
Header <boost/stacktrace/stacktrace_fwd.hpp>
namespace boost {
  namespace stacktrace {
    template<typename Allocator> class basic_stacktrace;

    typedef basic_stacktrace stacktrace;  // This is the typedef to use unless you'd like to provide a specific allocator to boost::stacktrace::basic_stacktrace. 
    template<typename Allocator1, typename Allocator2> 
      bool operator<(const basic_stacktrace< Allocator1 > &, 
                     const basic_stacktrace< Allocator2 > &);
    template<typename Allocator1, typename Allocator2> 
      bool operator==(const basic_stacktrace< Allocator1 > &, 
                      const basic_stacktrace< Allocator2 > &);

    // Comparison operators that provide platform dependant ordering and have amortized O(1) complexity; O(size()) worst case complexity; are Async-Handler-Safe. 
    template<typename Allocator1, typename Allocator2> 
      bool operator>(const basic_stacktrace< Allocator1 > & lhs, 
                     const basic_stacktrace< Allocator2 > & rhs);
    template<typename Allocator1, typename Allocator2> 
      bool operator<=(const basic_stacktrace< Allocator1 > & lhs, 
                      const basic_stacktrace< Allocator2 > & rhs);
    template<typename Allocator1, typename Allocator2> 
      bool operator>=(const basic_stacktrace< Allocator1 > & lhs, 
                      const basic_stacktrace< Allocator2 > & rhs);
    template<typename Allocator1, typename Allocator2> 
      bool operator!=(const basic_stacktrace< Allocator1 > & lhs, 
                      const basic_stacktrace< Allocator2 > & rhs);

    // Fast hashing support, O(st.size()) complexity; Async-Handler-Safe. 
    template<typename Allocator> 
      std::size_t hash_value(const basic_stacktrace< Allocator > & st);

    // Returns std::string with the stacktrace in a human readable format; unsafe to use in async handlers. 
    template<typename Allocator> 
      std::string to_string(const basic_stacktrace< Allocator > & bt);

    // Outputs stacktrace in a human readable format to the output stream os; unsafe to use in async handlers. 
    template<typename CharT, typename TraitsT, typename Allocator> 
      std::basic_ostream< CharT, TraitsT > & 
      operator<<(std::basic_ostream< CharT, TraitsT > & os, 
                 const basic_stacktrace< Allocator > & bt);
  }
}

Use <boost/stacktrace/frame.hpp> header instead of this one!

namespace boost {
  namespace stacktrace {
    class frame;
  }
}
namespace boost {
  namespace stacktrace {

    // Comparison operators that provide platform dependant ordering and have O(1) complexity; are Async-Handler-Safe. 
    constexpr bool operator<(const frame & lhs, const frame & rhs);
    constexpr bool operator>(const frame & lhs, const frame & rhs);
    constexpr bool operator<=(const frame & lhs, const frame & rhs);
    constexpr bool operator>=(const frame & lhs, const frame & rhs);
    constexpr bool operator==(const frame & lhs, const frame & rhs);
    constexpr bool operator!=(const frame & lhs, const frame & rhs);

    // Fast hashing support, O(1) complexity; Async-Handler-Safe. 
    std::size_t hash_value(const frame & f);

    // Outputs stacktrace::frame in a human readable format to string; unsafe to use in async handlers. 
    std::string to_string(const frame & f);

    // Outputs stacktrace::frame in a human readable format to output stream; unsafe to use in async handlers. 
    template<typename CharT, typename TraitsT> 
      std::basic_ostream< CharT, TraitsT > & 
      operator<<(std::basic_ostream< CharT, TraitsT > & os, const frame & f);
  }
}

This header contains low-level async-signal-safe functions for dumping call stacks. Dumps are binary serialized arrays of void*, so you could read them by using 'od -tx8 -An stacktrace_dump_failename' Linux command or using boost::stacktrace::stacktrace::from_dump functions.

namespace boost {
  namespace stacktrace {
    std::size_t safe_dump_to(void *, std::size_t);
    std::size_t safe_dump_to(std::size_t, void *, std::size_t);
    std::size_t safe_dump_to(const char *);
    std::size_t safe_dump_to(std::size_t, std::size_t, const char *);
    std::size_t safe_dump_to(platform_specific_descriptor);
    std::size_t safe_dump_to(std::size_t, std::size_t, 
                             platform_specific_descriptor);
  }
}

This header contains only forward declarations of boost::stacktrace::frame, boost::stacktrace::basic_stacktrace, boost::stacktrace::stacktrace and does not include any other Boost headers.


PrevUpHomeNext