//
// this creates a much larger mini dump than just wxCRASH_REPORT_STACK but
// still much smaller than wxCRASH_REPORT_LOCALS one
- wxCRASH_REPORT_GLOBALS = 4
+ wxCRASH_REPORT_GLOBALS = 4,
+
+ // default is to create the smallest possible crash report
+ wxCRASH_REPORT_DEFAULT = wxCRASH_REPORT_LOCATION | wxCRASH_REPORT_STACK
};
// ----------------------------------------------------------------------------
//
// if ep pointer is NULL, the global exception info which is valid only
// inside wxApp::OnFatalException() is used
- static bool Generate(int flags = wxCRASH_REPORT_LOCATION |
- wxCRASH_REPORT_STACK,
+ static bool Generate(int flags = wxCRASH_REPORT_DEFAULT,
_EXCEPTION_POINTERS *ep = NULL);
+
+ // generate a crash report from outside of wxApp::OnFatalException(), this
+ // can be used to take "snapshots" of the program in wxApp::OnAssert() for
+ // example
+ static bool GenerateNow(int flags = wxCRASH_REPORT_DEFAULT);
};
#endif // wxUSE_CRASHREPORT
return impl.Generate(flags, ep);
}
+/* static */
+bool wxCrashReport::GenerateNow(int flags)
+{
+ bool rc = false;
+
+ __try
+ {
+ RaiseException(0x1976, 0, 0, NULL);
+ }
+ __except( rc = Generate(flags, (EXCEPTION_POINTERS *)GetExceptionInformation()),
+ EXCEPTION_CONTINUE_EXECUTION )
+ {
+ // never executed because of EXCEPTION_CONTINUE_EXECUTION above
+ }
+
+ return rc;
+}
+
// ----------------------------------------------------------------------------
// wxCrashContext
// ----------------------------------------------------------------------------