Is there a way to hook all exceptions in Delphi, even handled ones, and even those not triggered by Delphi itself?

Is there a way to hook all exceptions in Delphi, even handled ones, and even those not triggered by Delphi itself?

OnException and similar mechanisms deal with unhandled exceptions, I am after a way to track all exceptions, even those properly trapped in except.

The reason being that I have a performance issue which I suspect is some exception being triggered and trapped repeatedly, because not only CPU usage can spike, but the OS becomes less responsive.
Of course this happens only in production, and I suspect that while the exceptions are triggered from within my process, they may not be triggered Delphi-side, but in a DLL...

Comments