X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d476275306f7bdfb81ea3f06ed69fe461d058695..722f74cec895bbc284ba7b7a7213ee5cf2a1ab95:/src/msw/stackwalk.cpp diff --git a/src/msw/stackwalk.cpp b/src/msw/stackwalk.cpp index d0f9e59749..212c2eda69 100644 --- a/src/msw/stackwalk.cpp +++ b/src/msw/stackwalk.cpp @@ -214,7 +214,7 @@ void wxStackFrame::OnGetParam() // 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() ) { @@ -267,7 +267,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip) #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 @@ -293,7 +293,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip) if ( nLevel >= skip ) { wxStackFrame frame(nLevel - skip, - (void *)sf.AddrPC.Offset, + wxUIntToPtr(sf.AddrPC.Offset), sf.AddrFrame.Offset); OnStackFrame(frame); @@ -310,12 +310,12 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip) #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; @@ -323,7 +323,7 @@ void wxStackWalker::WalkFromException() _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)) @@ -386,17 +386,20 @@ void wxStackFrame::OnGetParam() // ---------------------------------------------------------------------------- void -wxStackWalker::WalkFrom(const CONTEXT * WXUNUSED(pCtx), size_t WXUNUSED(skip)) +wxStackWalker::WalkFrom(const CONTEXT * WXUNUSED(pCtx), + size_t WXUNUSED(skip), + size_t WXUNUSED(maxDepth)) { } void wxStackWalker::WalkFrom(const _EXCEPTION_POINTERS * WXUNUSED(ep), - size_t WXUNUSED(skip)) + size_t WXUNUSED(skip), + size_t WXUNUSED(maxDepth)) { } -void wxStackWalker::WalkFromException() +void wxStackWalker::WalkFromException(size_t WXUNUSED(maxDepth)) { }