Really fix stack dumps for asserts and wxStackWalker::Walk() calls.

The code apparently tried to compensate for the wrong "skip" values used in
the calls to wxStackWalker::Walk() by skipping too much in Walk() itself which
was wrong as it dropped the frames that should have been shown.

Fix this by skipping only the one extra (compared to Walk() itself) frame we
add in wxStackWalker Unix implementation and not 3 of them and do skip more
frames when calling Walk() from assert failure handlers.

Also fix the wrong number of frames used in ProcessFrames(): we must not
subtract the number of skipped frames, they were already skipped.

Closes #14690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-25 10:49:45 +00:00
parent 3fce0e6480
commit 1114902acf
3 changed files with 7 additions and 6 deletions

View File

@@ -953,7 +953,7 @@ wxString wxAppTraitsBase::GetAssertStackTrace()
static const int maxLines = 20;
StackDump dump;
dump.Walk(2, maxLines); // don't show OnAssert() call itself
dump.Walk(8, maxLines); // 8 is chosen to hide all OnAssert() calls
stackTrace = dump.GetStackTrace();
const int count = stackTrace.Freq(wxT('\n'));