summaryrefslogtreecommitdiff
path: root/LinBPQ.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2026-10-20 22:17:41 +0100
committerDave Hibberd <hibby@debian.org>2026-10-20 22:17:41 +0100
commitea93adeffbb191c502e9b27be4e7a4c8cdd332a5 (patch)
tree0574e23ccb898ff523ba1105682bbb77b8efeb5f /LinBPQ.c
parent592e5967b8fcd79423802071319d0c646f2080df (diff)
New upstream version 6.0.26.1+repackupstream/6.0.26.1+repackupstream/latest
Diffstat (limited to 'LinBPQ.c')
-rw-r--r--LinBPQ.c52
1 files changed, 38 insertions, 14 deletions
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();