Re: Try Finally...
From: VBDis (vbdis_at_aol.com)
Date: 10/29/04
- Next message: Nicholas Sherlock: "Re: Rotating JPEG images?"
- Previous message: VBDis: "Re: Ok.. live and learn."
- In reply to:(deleted message) L D Blake: "Re: Try Finally..."
- Next in thread: L D Blake: "Re: Try Finally..."
- Reply:(deleted message) L D Blake: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Oct 2004 03:12:36 GMT
Im Artikel <dib1o0h986j5jguotdk4rlu6t5s7ccaetf@4ax.com>, L D Blake
<not@any.adr> schreibt:
>OK lets try and clear some of this up. Structured Exception Handling is a
>Windows thing. It is governed by guard frames placed in the program's stack.
>These frames are put in place by Delphi's TRY keyword. Each frame contains
>(at minimum) the address of an exception handler and a pointer on the stack
>to the previous frame.
Another thing to clarify:
Even if the records reside in the stack, the list of the guard frames is
implemented by specific links, independent from the subroutine frames in the
call stack. The list head is accessible via FS, the following records by their
built-in links. The total stack record seems to consist of 3 pointers, if I
interpret the code in the CPU window correctly?
In so far I don't like to speak of "the stack", the guard frames form their own
stack (linked list), and walking the call stack (frames) is different from
walking the guard list.
>The hard part for us to understand is that when we do something that causes an
>exception, the exception is not created in Delphi (or whatever language we are
>using), it originates in the operating system. What the language does with an
>active exception is entirely up to the language (and by extension, us).
This applies to "external" exceptions only. There exists no real need to signal
internal exceptions (range checks...) to the OS, it's sufficient when both
internal and external exceptions trigger the same exception /handling/.
Walking the guard list also is not problematic, regardless of whether it's
performed in 1 or 2 passes. In a 2-pass traversal an applicable exception
handler is determined first, and in the second pass the termination handlers
are invoked, followed by the exception handler determined in the first pass.
The second pass is not initiated when the filter expression decided to resume
at the instruction that caused the exception(?). It should be noted that the
exception handler executes only after all termination handlers have executed.
This can be done in a single pass as well, but then the guard list must be
truncated at the same time, because the handlers become no more elective for
another execution, and the stack must be unwound at the same time, so that the
handlers execute in their proper stack frame.
DoDi
- Next message: Nicholas Sherlock: "Re: Rotating JPEG images?"
- Previous message: VBDis: "Re: Ok.. live and learn."
- In reply to:(deleted message) L D Blake: "Re: Try Finally..."
- Next in thread: L D Blake: "Re: Try Finally..."
- Reply:(deleted message) L D Blake: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|