From d18462141c31a89de1b54fd58bdd69e6ce238c34 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sat, 8 Apr 2006 23:45:57 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=9819 --- lib/stackwalker_win.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/stackwalker_win.cpp b/lib/stackwalker_win.cpp index fe4eef70ba..fb75a858af 100644 --- a/lib/stackwalker_win.cpp +++ b/lib/stackwalker_win.cpp @@ -592,7 +592,6 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context, HANDLE hSWProcess) // if this returns ERROR_INVALID_ADDRESS (487) or ERROR_NOACCESS (998), you can // assume that either you are done, or that the stack is so hosed that the next // deeper frame could not be found. - // CONTEXT need not to be suplied if imageTyp is IMAGE_FILE_MACHINE_I386! bRetVal = pSW( IMAGE_FILE_MACHINE_I386, hSWProcess, @@ -698,8 +697,18 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context, HANDLE hSWProcess) } } // for ( frameNum ) - if ( gle != 0 ) - _ftprintf(stderr, _T("\nStackWalk(): GetLastError = %lu\n"), gle ); + switch(gle) + { + case ERROR_INVALID_ADDRESS: + _ftprintf(stderr, _T("\nStackWalk(): ERROR_INVALID_ADDRESS (%lu) - Possible stack corruption.\n"), gle ); + break; + case ERROR_NOACCESS: + _ftprintf(stderr, _T("\nStackWalk(): ERROR_NOACCESS (%lu) - Possible stack corruption.\n"), gle ); + break; + default: + _ftprintf(stderr, _T("\nStackWalk(): GetLastError = %lu\n"), gle ); + break; + } fflush(stderr);