For win32 system exceptions (AV, divByZero, ...) under debug mode, Lazarus currently has no solution.
The following article essentially says, UnhandledExceptionFilter (the only handler in win32LazApp) will never work in debugMode, but only in releaseMode.
https://devblogs.microsoft.com/oldnewthing/?p=94106To improve debugging with win32 system exceptions,
I created a small unit (uses VEH) which works by simple addition to uses clause of projects.
I have to move on with my other works now, but this idea is very useful and should not become lost.
The community may improve it or/and derive from it freely. The original ideas came from this thread:
https://bugs.freepascal.org/view.php?id=12974Alternatively, win32 SEH (much more complex) would also cover this need, but only if completely implemented and tested.
FPC_USE_WIN32_SEH is not defined, maybe it's incomplete, maybe no one is working on it.
Without official support, using fpc built with -dTEST_WIN32_SEH remains a shot in the dark.
If there is a plan, please let the community know:) See:
https://bugs.freepascal.org/view.php?id=28756**************************************
The file win32Veh.pas is for building win32 binaries with fpc 3.0.x (non-SEH):
1) for debug-builds run under debugger: on system-exception: to continue to finally/except
2) for release-dlls to catch dll system-exceptions in finally/except in dll, to protect the host from faulty states and termination.
File update: 2019-05-20