\membersection{wxStackWalker::WalkFromException}\label{wxstackwalkerwalkfromexception}
-\func{void}{WalkFromException}{\void}
+\func{void}{WalkFromException}{\param{size\_t }{maxDepth = 200}}
Enumerate stack frames from the location of uncaught exception.
This method can only be called from
\helpref{wxApp::OnFatalException()}{wxapponfatalexception}.
+Up to \arg{maxDepth} frames are walked from the innermost to the outermost one.
+
wxStackWalker(const char * WXUNUSED(argv0) = NULL) { }
virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
- virtual void WalkFromException();
+ virtual void WalkFromException(size_t maxDepth = 200);
// enumerate stack frames from the given context
- void WalkFrom(const _CONTEXT *ctx, size_t skip = 1);
- void WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip = 1);
+ void WalkFrom(const _CONTEXT *ctx, size_t skip = 1, size_t maxDepth = 200);
+ void WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip = 1, size_t maxDepth = 200);
};
#endif // _WX_MSW_STACKWALK_H_
// enumerate stack frames from the location of uncaught exception
//
// this version can only be called from wxApp::OnFatalException()
- virtual void WalkFromException() = 0;
+ virtual void WalkFromException(size_t maxDepth = 200) = 0;
protected:
// this function must be overrided to process the given frame
// wxStackWalker
// ----------------------------------------------------------------------------
-void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip)
+void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth)
{
if ( !wxDbgHelpDLL::Init() )
{
#endif // _M_IX86
// iterate over all stack frames
- for ( size_t nLevel = 0; ; nLevel++ )
+ for ( size_t nLevel = 0; nLevel < maxDepth; nLevel++ )
{
// get the next stack frame
if ( !wxDbgHelpDLL::StackWalk
#endif
}
-void wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip)
+void wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip, size_t maxDepth)
{
- WalkFrom(ep->ContextRecord, skip);
+ WalkFrom(ep->ContextRecord, skip, maxDepth);
}
-void wxStackWalker::WalkFromException()
+void wxStackWalker::WalkFromException(size_t maxDepth)
{
extern EXCEPTION_POINTERS *wxGlobalSEInformation;
_T("wxStackWalker::WalkFromException() can only be called from wxApp::OnFatalException()") );
// don't skip any frames, the first one is where we crashed
- WalkFrom(wxGlobalSEInformation, 0);
+ WalkFrom(wxGlobalSEInformation, 0, maxDepth);
}
void wxStackWalker::Walk(size_t skip, size_t WXUNUSED(maxDepth))
{
}
-void wxStackWalker::WalkFromException()
+void wxStackWalker::WalkFromException(size_t WXUNUSED(maxDepth))
{
}