Allow running on systems without wx stackwalker (#3519)

closes #2796
This commit is contained in:
John Zimmermann 2020-07-19 19:13:15 -07:00 committed by GitHub
parent e42b9ce110
commit 7e52b9550f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include <wx/stackwalk.h>
#if wxUSE_STACKWALKER
class StackDump : public wxStackWalker
{
protected:
@ -94,6 +95,7 @@ static wxString pxGetStackTrace( const FnChar_t* calledFrom )
dump.Walk( 3 );
return dump.GetStackTrace();
}
#endif
#ifdef __WXDEBUG__
@ -122,7 +124,11 @@ bool AppDoAssert( const DiagnosticOrigin& origin, const wxChar *msg )
static bool disableAsserts = false;
if( disableAsserts ) return false;
#if wxUSE_STACKWALKER
wxString trace( pxGetStackTrace(origin.function) );
#else
wxString trace( "Warning: Platform doesn't support wx stackwalker" );
#endif
wxString dbgmsg( origin.ToString( msg ) );
wxMessageOutputDebug().Printf( L"%s", WX_STR(dbgmsg) );