Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Aug : how to hook access violations before stack unwinding ?

www.cryer.info
Managed Newsgroup Archive

how to hook access violations before stack unwinding ?

Subject:how to hook access violations before stack unwinding ?
Posted by:"Frédéric van der Plancke" (eb.sic..@pdvf--reverse.me)
Date:Tue, 22 Aug 2006 18:02:19

To debug a program I'd like to get a full stack trace on (e.g.) access
violation, under Delphi 6 for Windows.

I know how to get a stack trace in code that runs out of exception handling
context. The problem is: how to hook a procedure of mine in the code so that
it is run before the stack is unwind by exception handling. (As it seems,
when an "except" clause is called the stack is already unwound. I also tried
to hook System.ErrorProc but that doesn't seem to be called at all. Looking
at the assembler code run by exception handling, I don't see that Delphi
offers an obvious place for such a hook. Dim prospects).

Is there a "cheap" way to do this ? By cheap I mostly mean
- no need to decorate all bottom-level functions where the A.V. is suspected
to appear,
- no need to write thousands of lines of clever code

(Also, is this an appropriate newsgroup where to ask such questions, and if
not, where ?)

Thank you for your help.

Frédéric vdP

Replies:

www.cryer.info
Managed Newsgroup Archive