1 // This file is part of the ustl library, an STL implementation.
3 // Copyright (C) 2006 by Mike Sharov <msharov@users.sourceforge.net>
4 // This file is free software, distributed under the MIT License.
9 #ifndef BKTRACE_H_63ABB1E4388CEDD975DBE58B57DE474F
10 #define BKTRACE_H_63ABB1E4388CEDD975DBE58B57DE474F
20 /// \class CBacktrace bktrace.h ustl.h
22 /// \brief Stores the backtrace from the point of construction.
24 /// The backtrace, or callstack, is the listing of functions called to
25 /// reach the construction of this object. This is useful for debugging,
26 /// to print the location of an error. To get meaningful output you'll
27 /// need to use a debug build with symbols and with frame pointers. For
28 /// GNU ld you will also need to link with the -rdynamic option to see
29 /// actual function names instead of __gxx_personality0+0xF4800.
33 CBacktrace (void) throw();
34 CBacktrace (const CBacktrace
& v
) throw();
35 ~CBacktrace (void) throw();
36 const CBacktrace
& operator= (const CBacktrace
& v
) throw();
37 void text_write (ostringstream
& os
) const;
38 void read (istream
& is
);
39 void write (ostream
& os
) const;
40 size_t stream_size (void) const;
42 void GetSymbols (void) throw() DLL_LOCAL
;
44 void* m_Addresses
[64]; ///< Addresses of each function on the stack.
45 char* m_Symbols
; ///< Symbols corresponding to each address.
46 uint32_t m_nFrames
; ///< Number of addresses in m_Addresses.
47 uint32_t m_SymbolsSize
; ///< Size of m_Symbols.
52 ALIGNOF(ustl::CBacktrace
, sizeof(void*))