X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2fd6629831b1b25e739f73cdc2157eed840f273..af4168e2cfbeffbe3b53380471aa31e9ab63a598:/src/unix/stackwalk.cpp?ds=sidebyside diff --git a/src/unix/stackwalk.cpp b/src/unix/stackwalk.cpp index 28c4fa89c3..e8cf6edff3 100644 --- a/src/unix/stackwalk.cpp +++ b/src/unix/stackwalk.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 2005-01-18 -// RCS-ID: $Id$ // Copyright: (c) 2005 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -182,17 +181,18 @@ void wxStackWalker::ProcessFrames(size_t skip) if (!ms_symbols || !m_depth) return; - // we have 3 more "intermediate" frames which the calling code doesn't know - // about, account for them + // we are another level down from Walk(), so adjust the number of stack + // frames to skip accordingly skip += 1; // call addr2line only once since this call may be very slow // (it has to load in memory the entire EXE of this app which may be quite // big, especially if it contains debug info and is compiled statically!) - int towalk = InitFrames(frames, m_depth - skip, &ms_addresses[skip], &ms_symbols[skip]); + int numFrames = InitFrames(frames, m_depth - skip, + &ms_addresses[skip], &ms_symbols[skip]); // now do user-defined operations on each frame - for ( int n = 0; n < towalk - (int)skip; n++ ) + for ( int n = 0; n < numFrames; n++ ) OnStackFrame(frames[n]); }