wxStackWalker(const char * WXUNUSED(argv0) = NULL) { }
virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
+#if wxUSE_ON_FATAL_EXCEPTION
virtual void WalkFromException(size_t maxDepth = 200);
+#endif // wxUSE_ON_FATAL_EXCEPTION
// enumerate stack frames from the given context
// notice that Walk() frame itself is not included if skip >= 1)
virtual void Walk(size_t skip = 1, size_t maxDepth = 200) = 0;
+#if wxUSE_ON_FATAL_EXCEPTION
// enumerate stack frames from the location of uncaught exception
//
// this version can only be called from wxApp::OnFatalException()
virtual void WalkFromException(size_t maxDepth = 200) = 0;
+#endif // wxUSE_ON_FATAL_EXCEPTION
protected:
// this function must be overrided to process the given frame
}
virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
+#if wxUSE_ON_FATAL_EXCEPTION
virtual void WalkFromException(size_t maxDepth = 200) { Walk(2, maxDepth); }
+#endif // wxUSE_ON_FATAL_EXCEPTION
static const wxString& GetExePath() { return ms_exepath; }
#if wxUSE_STACKWALKER
wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, _T("stack"));
XmlStackWalker sw(nodeStack);
+#if wxUSE_ON_FATAL_EXCEPTION
if ( ctx == Context_Exception )
{
sw.WalkFromException();
}
else // Context_Current
+#endif // wxUSE_ON_FATAL_EXCEPTION
{
sw.Walk();
}
WalkFrom(ep->ContextRecord, skip, maxDepth);
}
+#if wxUSE_ON_FATAL_EXCEPTION
+
void wxStackWalker::WalkFromException(size_t maxDepth)
{
extern EXCEPTION_POINTERS *wxGlobalSEInformation;
WalkFrom(wxGlobalSEInformation, 0, maxDepth);
}
+#endif // wxUSE_ON_FATAL_EXCEPTION
+
void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))
{
// to get a CONTEXT for the current location, simply force an exception and
// get EXCEPTION_POINTERS from it
//
// note:
- // 1. we additionally skip RaiseException() and WalkFromException() frames
+ // 1. we additionally skip RaiseException() and WalkFrom() frames
// 2. explicit cast to EXCEPTION_POINTERS is needed with VC7.1 even if it
// shouldn't have been according to the docs
__try
__except( WalkFrom((EXCEPTION_POINTERS *)GetExceptionInformation(),
skip + 2), EXCEPTION_CONTINUE_EXECUTION )
{
- // never executed because of WalkFromException() return value
+ // never executed because the above expression always evaluates to
+ // EXCEPTION_CONTINUE_EXECUTION
}
}
{
}
+#if wxUSE_ON_FATAL_EXCEPTION
void wxStackWalker::WalkFromException(size_t WXUNUSED(maxDepth))
{
}
+#endif // wxUSE_ON_FATAL_EXCEPTION
void wxStackWalker::Walk(size_t WXUNUSED(skip), size_t WXUNUSED(maxDepth))
{