1 #ifndef STACKTRACE_H_INCLUDED
2 #define STACKTRACE_H_INCLUDED
3 
4 #if defined(ENABLE_DEBUG_REPORT)
5 
6 #ifdef __WXMSW__
7 	#include <windows.h>
8 	#ifdef __cplusplus
9 		extern "C" {
10 	#endif
11 			 LONG WINAPI DrMingwGenerateStacktrace(PEXCEPTION_POINTERS pExceptionInfo, const char* report_filename);
12 	#ifdef __cplusplus
13 		}
14 	#endif
15 #else
16 
17 	#include <wx/string.h>
18 	#include <wx/stackwalk.h>
19 
20 	#if wxUSE_STACKWALKER
21 
22 
23 	class StackTrace : public wxStackWalker
24 	{
25 	  public:
StackTrace()26 		StackTrace() {}
~StackTrace()27 		~StackTrace() {}
28 
GetStackTrace()29 		wxString GetStackTrace() { return StackTraceString; }
30 
31 	  private:
32 
33 		void OnStackFrame( const wxStackFrame& frame );
34 
35 		wxString StackTraceString;
36 		wxString PartToHash;
37 
38 	};
39 	#else
40 		#error "No usable stacktrace config, set ENABLE_DEBUG_REPORT=OFF in cmake"
41 	#endif //#if wxUSE_STACKWALKER
42 #endif // __WXMSW__
43 
44 #endif //#if defined(ENABLE_DEBUG_REPORT)
45 
46 #endif // SPRINGLOBBY_HEADERGUARD_STACKTRACE_H_INCLUDED
47