As we always log the assert message in ::ShowAssertDialog() itself there is no
need to log it again in wxAppTraitsBase::ShowAssertDialog().
Also show the "please wait while generating stack trace information" in
wxAppTraitsBase::GetAssertStackTrace() itself instead of doing it in both
places which call it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62844
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal)
{
#if wxDEBUG_LEVEL
bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal)
{
#if wxDEBUG_LEVEL
- wxString msg = msgOriginal;
-#if !defined(__WXMSW__)
- // on Unix stack frame generation may take some time, depending on the
- // size of the executable mainly... warn the user that we are working
- wxFprintf(stderr, wxT("[Debug] Generating a stack trace... please wait"));
- fflush(stderr);
-#endif
-
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
msg << wxT("\n\nCall stack:\n") << stackTrace;
msg << wxT("\n\nCall stack:\n") << stackTrace;
+
+ wxMessageOutputDebug().Output(msg);
+ }
#endif // wxUSE_STACKWALKER
#endif // wxUSE_STACKWALKER
- return DoShowAssertDialog(msg);
+ return DoShowAssertDialog(msgOriginal + msg);
#else // !wxDEBUG_LEVEL
wxUnusedVar(msgOriginal);
#else // !wxDEBUG_LEVEL
wxUnusedVar(msgOriginal);
wxString wxAppTraitsBase::GetAssertStackTrace()
{
#if wxDEBUG_LEVEL
wxString wxAppTraitsBase::GetAssertStackTrace()
{
#if wxDEBUG_LEVEL
+
+#if !defined(__WXMSW__)
+ // on Unix stack frame generation may take some time, depending on the
+ // size of the executable mainly... warn the user that we are working
+ wxFprintf(stderr, "Collecting stack trace information, please wait...");
+ fflush(stderr);
+#endif // !__WXMSW__
+
+
wxString stackTrace;
class StackDump : public wxStackWalker
wxString stackTrace;
class StackDump : public wxStackWalker
//case IDNO: nothing to do
}
#else // !__WXMSW__
//case IDNO: nothing to do
}
#else // !__WXMSW__
- wxMessageOutputDebug().Output(msg);
-
- // TODO: ask the user whether to trap on the console?
#endif // __WXMSW__/!__WXMSW__
#endif // __WXMSW__/!__WXMSW__
- // continue with the asserts
+ // continue with the asserts by default
wxString msgDlg = msg;
#if wxUSE_STACKWALKER
wxString msgDlg = msg;
#if wxUSE_STACKWALKER
- // on Unix stack frame generation may take some time, depending on the
- // size of the executable mainly... warn the user that we are working
- wxFprintf(stderr, wxT("[Debug] Generating a stack trace... please wait"));
- fflush(stderr);
-
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
msgDlg << wxT("\n\nCall stack:\n") << stackTrace;
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
msgDlg << wxT("\n\nCall stack:\n") << stackTrace;