From d2dfef5f3f0152ad9b30092168869fec0698e6bf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Oct 2005 20:11:29 +0000 Subject: [PATCH] corrected code to really skip stack frames in the beginning and to number the remaining frames correctly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/stackwalk.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/unix/stackwalk.cpp b/src/unix/stackwalk.cpp index d5175464f7..ae48c30a31 100644 --- a/src/unix/stackwalk.cpp +++ b/src/unix/stackwalk.cpp @@ -225,12 +225,13 @@ void wxStackWalker::Walk(size_t skip) char **symbols = backtrace_symbols(addresses, depth); - if (skip > (size_t) depth) - skip = (size_t) depth; + // we have 3 more "intermediate" frames which the calling code doesn't know + // about., account for them + skip += 3; for ( int n = skip; n < depth; n++ ) { - wxStackFrame frame(n, addresses[n-skip], symbols[n-skip]); + wxStackFrame frame(n - skip, addresses[n], symbols[n]); OnStackFrame(frame); } } -- 2.45.2