From ea93adeffbb191c502e9b27be4e7a4c8cdd332a5 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Tue, 20 Oct 2026 22:17:41 +0100 Subject: New upstream version 6.0.26.1+repack --- LinBPQ.c | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) (limited to 'LinBPQ.c') diff --git a/LinBPQ.c b/LinBPQ.c index 8515119..bfee707 100644 --- a/LinBPQ.c +++ b/LinBPQ.c @@ -1169,6 +1169,7 @@ LONG WINAPI UnhandledExcepFilter(PEXCEPTION_POINTERS pExcepPointers) DWORD dwDisplacement; IMAGEHLP_LINE64 line; char * fptr; + DWORD ExceptionCode = pExcepPointers->ExceptionRecord->ExceptionCode; time_t T; @@ -1190,29 +1191,52 @@ LONG WINAPI UnhandledExcepFilter(PEXCEPTION_POINTERS pExcepPointers) exit(0); } + + switch (ExceptionCode) + { - inErrorhandling = 1; - - if(pExcepPointers->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C) + case DBG_PRINTEXCEPTION_C: return EXCEPTION_CONTINUE_EXECUTION; - SymFromAddr( process, ((DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress), 0, symbol ); + case STATUS_INTEGER_DIVIDE_BY_ZERO: + case STATUS_ACCESS_VIOLATION: + case STATUS_STACK_OVERFLOW: + case STATUS_FLOAT_DIVIDE_BY_ZERO: - Debugprintf("\r\n\r\nProgram error trapped at %02d:%02d:%02d\r\n", tm->tm_hour, tm->tm_min, tm->tm_sec); + break; - SymGetLineFromAddr64(process, (DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress, &dwDisplacement, &line); + // ignore others - if (line.FileName) - { - fptr = line.FileName + (int)strlen(line.FileName); // remove path - while (*fptr != '\\' && *fptr != '/') - fptr--; - - fptr++; + default: - Debugprintf("In Procedure %s - %s Line %d Addr %p\r\n", symbol->Name, fptr, line.LineNumber, symbol->Address ); + return EXCEPTION_CONTINUE_SEARCH; } + inErrorhandling = 1; + + SymFromAddr( process, ((DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress), 0, symbol ); + + Debugprintf("\r\n\r\nProgram error trapped at %02d:%02d:%02d\r\n", tm->tm_hour, tm->tm_min, tm->tm_sec); + + if (SymFromAddr(process, ((DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress), 0, symbol)) + { + Debugprintf("\r\n\r\nException %x trapped at %02d:%02d:%02d\r\n", ExceptionCode, tm->tm_hour, tm->tm_min, tm->tm_sec); + + line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); + + SymGetLineFromAddr64(process, (DWORD)pExcepPointers->ExceptionRecord->ExceptionAddress, &dwDisplacement, &line); + + if (line.FileName) + { + fptr = line.FileName + (int)strlen(line.FileName); // remove path + while (*fptr != '\\' && *fptr != '/') + fptr--; + + fptr++; + + Debugprintf("In Procedure %s - %s Line %d Addr %p\r\n", symbol->Name, fptr, line.LineNumber, symbol->Address ); + } + } printStack(); CloseDebugLog(); -- cgit v1.2.3