Re: Structured Exception Handling (was: Try Finally...)
From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 11/03/04
- Next message: Maarten Wiltink: "Re: Oh boy, how did we miss this..."
- Previous message: AlanGLLoyd: "Re: Grid cell draw"
- In reply to: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Next in thread: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Reply: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 3 Nov 2004 13:43:48 +0100
"VBDis" <vbdis@aol.com> wrote in message
news:20041031203233.24462.00000778@mb-m23.aol.com...
> Im Artikel <4184d94b$0$37789$e4fe514c@news.xs4all.nl>, "Maarten Wiltink"
> <maarten@kittensandcats.net> schreibt:
>> Windows SEH provides building blocks: guard frames, and hooks to
>> exception handlers and termination handlers. Where a compiler puts
>> exception filtering, except clauses, and finally clauses, is up to
>> the compiler.
>
> You should understand that no phyiscal difference exists between
> exception filters, exception handlers, and termination handlers. An
> exception handler /is/ a piece of code that /behaves as/ an exception
> handler. ...
I have been careful to distinguish between except clauses and exception
handlers, and between finally clauses and, er, exception handlers, too
(latest insight being that both types of clauses are executed during the
second phase of Windows SEH). The filtering I'm not concerned with; it
really has very little bearing on the relative timing of Object Pascal's
except and finally clauses.
I realise that in the end, all machine code is created equal, and the
difference is only in how it's placed where Windows SEH code will call
into it.
[...]
> With regards to exception filters and handlers, the invocation
> sequence is as follows:
> 1) an exception filter signals to stop arbitration, indicating
> where to resume normal program operation.
> 2) the termination handlers up to the resume point run.
> 3) operation resumes as determined before, typically in the
> exception handler related to the stopping exception filter.
>
> Consequently an exception filter is a handler that signals to stop
> the search for an exception handler. An exception handler can be
> everything that becomes active when normal program operation resumes.
"Exception handler" is the Windows SEH term for the code that runs
during the first guard chain traversal. You seem to be using it with
a different meaning. Anyhow I can't make sense of your point 3.
I think both (OP) finally clauses and except clauses end up in (WinSEH)
termination handlers. Finally clauses always run and except clauses run
when their filter is fulfilled but they reraise the exception. The
final except clause does not reraise the exception. After that, execution
might resume at the excepting machine code instruction, or _after_ the
exception handler whose filter signalled a stop.
Groetjes,
Maarten Wiltink
- Next message: Maarten Wiltink: "Re: Oh boy, how did we miss this..."
- Previous message: AlanGLLoyd: "Re: Grid cell draw"
- In reply to: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Next in thread: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Reply: VBDis: "Re: Structured Exception Handling (was: Try Finally...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|