1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/stackwalk.h
3 // Purpose: declaration of wxStackWalker for Unix
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIX_STACKWALK_H_
13 #define _WX_UNIX_STACKWALK_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_BASE wxStackFrame
: public wxStackFrameBase
22 // arguments are the stack depth of this frame, its address and the return
23 // value of backtrace_symbols() for it
25 // NB: we don't copy syminfo pointer so it should have lifetime at least as
27 wxStackFrame(size_t level
, void *address
, const char *syminfo
)
28 : wxStackFrameBase(level
, address
)
31 m_hasLocation
= false;
37 virtual void OnGetName();
38 virtual void OnGetLocation();
41 const char *m_syminfo
;
47 // ----------------------------------------------------------------------------
49 // ----------------------------------------------------------------------------
51 class WXDLLIMPEXP_BASE wxStackWalker
: public wxStackWalkerBase
54 // we need the full path to the program executable to be able to use
55 // addr2line, normally we can retrieve it from wxTheApp but if wxTheApp
56 // doesn't exist or doesn't have the correct value, the path may be given
58 wxStackWalker(const char *argv0
= NULL
)
60 ms_exepath
= wxString::FromAscii(argv0
);
63 virtual void Walk(size_t skip
= 1);
64 virtual void WalkFromException() { Walk(2); }
66 static const wxString
& GetExePath() { return ms_exepath
; }
69 static wxString ms_exepath
;
72 #endif // _WX_UNIX_STACKWALK_H_