diff --git a/checkin_notes b/checkin_notes index 97a426cd6a..d213bae863 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5599,3 +5599,13 @@ Charlie 8 June 2006 SecurityUtility.cpp SetupSecurity.h SetupSecurity.cpp + +Rom 8 June 2006 + - Bug Fix: When the debugger fails to initialize do not attempt to use + the other debugger functions. + - Bug Fix: Display which functions are not found in dbghelp.dll when one + or more are missing. + + lib/ + diagnostics_win.C + stackwalker_win.cpp diff --git a/lib/diagnostics_win.C b/lib/diagnostics_win.C index d272d5517d..d18839b48a 100644 --- a/lib/diagnostics_win.C +++ b/lib/diagnostics_win.C @@ -1795,6 +1795,7 @@ UINT diagnostics_determine_exit_code() { UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { DWORD dwEvent = NULL; BOOL bContinue = TRUE; + BOOL bDebuggerInitialized = FALSE; HANDLE hEvents[2]; unsigned int i; CONTEXT c; @@ -1871,7 +1872,7 @@ UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { #ifndef __CYGWIN__ // Kickstart the debugger extensions - DebuggerInitialize( + bDebuggerInitialized = !DebuggerInitialize( diagnostics_get_boinc_dir(), diagnostics_get_symstore(), diagnostics_is_proxy_enabled(), @@ -1879,7 +1880,7 @@ UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { ); // Dump any useful information - DebuggerDisplayDiagnostics(); + if (bDebuggerInitialized) DebuggerDisplayDiagnostics(); #endif // Dump the process statistics diagnostics_dump_process_information(); @@ -1900,21 +1901,23 @@ UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { if (diagnostics_is_flag_set(BOINC_DIAG_DUMPCALLSTACKENABLED)) { #ifndef __CYGWIN__ - if (pThreadEntry->crash_exception_record) { - StackwalkFilter( - pThreadEntry->crash_exception_record, - EXCEPTION_EXECUTE_HANDLER - ); - } else { - // Get the thread context - memset(&c, 0, sizeof(CONTEXT)); - c.ContextFlags = CONTEXT_FULL; - GetThreadContext(pThreadEntry->thread_handle, &c); + if (bDebuggerInitialized) { + if (pThreadEntry->crash_exception_record ) { + StackwalkFilter( + pThreadEntry->crash_exception_record, + EXCEPTION_EXECUTE_HANDLER + ); + } else { + // Get the thread context + memset(&c, 0, sizeof(CONTEXT)); + c.ContextFlags = CONTEXT_FULL; + GetThreadContext(pThreadEntry->thread_handle, &c); - StackwalkThread( - pThreadEntry->thread_handle, - &c - ); + StackwalkThread( + pThreadEntry->thread_handle, + &c + ); + } } #else fprintf(stderr, "Warning: Callstack dumps are not supported on CYGWIN\n"); diff --git a/lib/stackwalker_win.cpp b/lib/stackwalker_win.cpp index 49f6e7543f..85880b8b3d 100644 --- a/lib/stackwalker_win.cpp +++ b/lib/stackwalker_win.cpp @@ -482,7 +482,23 @@ int DebuggerInitialize( LPCSTR pszBOINCLocation, LPCSTR pszSymbolStore, BOOL bPr pSI == NULL || pSRC == NULL || pSSO == NULL || pSW == NULL || pUDSN == NULL || pSLM == NULL ) { - _ftprintf( stderr, "GetProcAddress(): some required function not found.\n" ); + if (!pIAV) fprintf( stderr, "GetProcAddress(): ImagehlpApiVersion missing.\n" ); + if (!pSC) fprintf( stderr, "GetProcAddress(): SymCleanup missing.\n" ); + if (!pSEM) fprintf( stderr, "GetProcAddress(): SymEnumerateModules64 missing.\n" ); + if (!pSFTA) fprintf( stderr, "GetProcAddress(): SymFunctionTableAccess64 missing.\n" ); + if (!pSGLFA) fprintf( stderr, "GetProcAddress(): SymGetLineFromAddr64 missing.\n" ); + if (!pSGMB) fprintf( stderr, "GetProcAddress(): SymGetModuleBase64 missing.\n" ); + if (!pSGMI) fprintf( stderr, "GetProcAddress(): SymGetModuleInfo64 missing.\n" ); + if (!pSGO) fprintf( stderr, "GetProcAddress(): SymGetOptions missing.\n" ); + if (!pSGSP) fprintf( stderr, "GetProcAddress(): SymGetSearchPath missing.\n" ); + if (!pSFA) fprintf( stderr, "GetProcAddress(): SymFromAddr missing.\n" ); + if (!pSI) fprintf( stderr, "GetProcAddress(): SymInitialize missing.\n" ); + if (!pSRC) fprintf( stderr, "GetProcAddress(): SymRegisterCallback64 missing.\n" ); + if (!pSSO) fprintf( stderr, "GetProcAddress(): SymSetOptions missing.\n" ); + if (!pSW) fprintf( stderr, "GetProcAddress(): StackWalk64 missing.\n" ); + if (!pUDSN) fprintf( stderr, "GetProcAddress(): UnDecorateSymbolName missing.\n" ); + if (!pSLM) fprintf( stderr, "GetProcAddress(): SymLoadModuleEx missing.\n" ); + FreeLibrary( g_hDbgHelpDll ); g_bInitialized = FALSE; return 1;