Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template basic_stacktrace

boost::stacktrace::basic_stacktrace

Synopsis

// In header: <boost/stacktrace/stacktrace.hpp>

template<typename Allocator> 
class basic_stacktrace {
public:
  // types
  typedef boost::stacktrace::frame, Allocator >::             ;            
  typedef boost::stacktrace::frame, Allocator >::         ;        
  typedef boost::stacktrace::frame, Allocator >::          ;               
  typedef boost::stacktrace::frame, Allocator >::          ;         
  typedef boost::stacktrace::frame, Allocator >::        ;             
  typedef boost::stacktrace::frame, Allocator >::        ;       
  typedef boost::stacktrace::frame, Allocator >::              ;             
  typedef boost::stacktrace::frame, Allocator >::        ;       
  typedef boost::stacktrace::frame, Allocator >::         ;              
  typedef boost::stacktrace::frame, Allocator >::         ;        
  typedef boost::stacktrace::frame, Allocator >:: ;      
  typedef boost::stacktrace::frame, Allocator >:: ;

  // construct/copy/destruct
  () ;
  (const ) ;
  (, , const  = ) ;
  (const basic_stacktrace &);
  (basic_stacktrace &&) ;
  basic_stacktrace & (const basic_stacktrace &);
  basic_stacktrace & (basic_stacktrace &&);
  ~();

  // public member functions
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
  () ;
  bool () ;
  const boost::stacktrace::frame, Allocator > & 
  () ;

  // public static functions
  template<typename Char, typename Trait> 
    basic_stacktrace 
    (Char, Trait > &, const  = );
  basic_stacktrace 
  (const void *, , const  = );
};

Description

Class that on construction copies minimal information about call stack into its internals and provides access to that information.

Template Parameters

  1. typename Allocator

    Allocator to use during stack capture.

basic_stacktrace public construct/copy/destruct

  1. () ;
    Stores the current function call sequence inside *this without any decoding or any other heavy platform specific operations.

    Complexity: O(N) where N is call sequence length, O(1) if BOOST_STACKTRACE_USE_NOOP is defined.

    Async-Handler-Safety: Safe if Allocator construction, copying, Allocator::allocate and Allocator::deallocate are async signal safe.

  2. (const  a) ;
    Stores the current function call sequence inside *this without any decoding or any other heavy platform specific operations.

    Complexity: O(N) where N is call sequence length, O(1) if BOOST_STACKTRACE_USE_NOOP is defined.

    Async-Handler-Safety: Safe if Allocator construction, copying, Allocator::allocate and Allocator::deallocate are async signal safe.

    Parameters:

    a

    Allocator that would be passed to underlying storage.

  3. ( skip,  max_depth, 
                     const  a = ) ;
    Stores [skip, skip + max_depth) of the current function call sequence inside *this without any decoding or any other heavy platform specific operations.

    Complexity: O(N) where N is call sequence length, O(1) if BOOST_STACKTRACE_USE_NOOP is defined.

    Async-Handler-Safety: Safe if Allocator construction, copying, Allocator::allocate and Allocator::deallocate are async signal safe.

    Parameters:

    a

    Allocator that would be passed to underlying storage.

    max_depth

    Max call sequence depth to collect.

    skip

    How many top calls to skip and do not store in *this.

    Throws:

    Nothing. Note that default construction of allocator may throw, however it is performed outside the constructor and exception in allocator_type() would not result in calling std::terminate.
  4. (const basic_stacktrace & st);

    Complexity: O(st.size())

    Async-Handler-Safety: Safe if Allocator construction, copying, Allocator::allocate and Allocator::deallocate are async signal safe.

  5. (basic_stacktrace && st) ;

    Complexity: O(1)

    Async-Handler-Safety: Safe if Allocator construction and copying are async signal safe.

  6. basic_stacktrace & (const basic_stacktrace & st);

    Complexity: O(st.size())

    Async-Handler-Safety: Safe if Allocator construction, copying, Allocator::allocate and Allocator::deallocate are async signal safe.

  7. basic_stacktrace & (basic_stacktrace && st);

    Complexity: O(st.size())

    Async-Handler-Safety: Safe if Allocator construction and copying are async signal safe.

  8. ~();

    Complexity: O(1)

    Async-Handler-Safety: Safe if Allocator::deallocate is async signal safe.

basic_stacktrace public member functions

  1.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

    Returns:

    Number of function names stored inside the class.

  2.  ( frame_no) ;

    Complexity: O(1).

    Async-Handler-Safety: Safe.

    Parameters:

    frame_no

    Zero based index of frame to return. 0 is the function index where stacktrace was constructed and index close to this->size() contains function main().

    Returns:

    frame that references the actual frame info, stored inside *this.

  3.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  4.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  5.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  6.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  7.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  8.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  9.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  10.  () ;

    Complexity: O(1)

    Async-Handler-Safety: Safe.

  11. () ;
    Allows to check that stack trace capturing was successful.

    Complexity: O(1)

    Async-Handler-Safety: Safe.

    Returns:

    true if this->size() != 0

  12. bool () ;
    Allows to check that stack trace failed.

    Complexity: O(1)

    Async-Handler-Safety: Safe.

    Returns:

    true if this->size() == 0

  13. const boost::stacktrace::frame, Allocator > & 
    () ;

basic_stacktrace public static functions

  1. template<typename Char, typename Trait> 
      basic_stacktrace 
      (Char, Trait > & in, 
                const  a = );

    Constructs stacktrace from basic_istreamable that references the dumped stacktrace. Terminating zero frame is discarded.

    Complexity: O(N)

  2. basic_stacktrace 
    (const void * begin,  buffer_size_in_bytes, 
              const  a = );

    Constructs stacktrace from raw memory dump. Terminating zero frame is discarded.

    Complexity: O(size) in worst case

    Parameters:

    begin

    Beginning of the memory where the stacktrace was saved using the boost::stacktrace::safe_dump_to

    buffer_size_in_bytes

    Size of the memory. Usually the same value that was passed to the boost::stacktrace::safe_dump_to


PrevUpHomeNext