git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47766
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\membersection{wxStackWalker::WalkFromException}\label{wxstackwalkerwalkfromexception}
\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}.
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);
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
// 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_
};
#endif // _WX_MSW_STACKWALK_H_
// enumerate stack frames from the location of uncaught exception
//
// this version can only be called from wxApp::OnFatalException()
// 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
protected:
// this function must be overrided to process the given frame
}
virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
}
virtual void Walk(size_t skip = 1, size_t maxDepth = 200);
- virtual void WalkFromException() { Walk(2); }
+ virtual void WalkFromException(size_t maxDepth = 200) { Walk(2, maxDepth); }
static const wxString& GetExePath() { return ms_exepath; }
static const wxString& GetExePath() { return ms_exepath; }
// wxStackWalker
// ----------------------------------------------------------------------------
// 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() )
{
{
if ( !wxDbgHelpDLL::Init() )
{
#endif // _M_IX86
// iterate over all stack frames
#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
{
// get the next stack frame
if ( !wxDbgHelpDLL::StackWalk
-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;
{
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
_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::Walk(size_t skip, size_t WXUNUSED(maxDepth))
-void wxStackWalker::WalkFromException()
+void wxStackWalker::WalkFromException(size_t WXUNUSED(maxDepth))