Re: Try Finally...

From: VBDis (vbdis_at_aol.com)
Date: 10/28/04


Date: 28 Oct 2004 07:59:05 GMT

Im Artikel <2u8158F2706ubU1@uni-berlin.de>, Rob Kennedy <me3@privacy.net>
schreibt:

>If SysUtils is not used, then system exceptions are not transformed into
>Delphi exceptions, and so Delphi's try-except blocks don't handle them.

Okay, so one big part of Delphi SEH requires conversions for system exceptions,
interrupts, assertions and other Delphi exceptions into Delphi SEH structures.

>(Delphi's try-finally blocks still execute, though.)

In my tests (D4) no Finally code was executed, the call to @Assert actually
never returned and ended up in Halt instead, without triggering any Finally
code. I.e. SEH is not working at all when the various exception conditions do
not trigger the Delphi exception handling.

Consequently a replacement SEH should specify what it supports, at least:
- Delphi version
- which kinds of error conditions (by triggering Delphi exception handling)
- exceptions during exception handling (in exception handling code)
- debugging
- possibly non-standard behaviour of Except and Finally

More topics may need a specification (thread support...).

With regards to these many and possibly still incomplete parameters I doubt
that a possible reduction of program size by at most 24KB justifies the
implementation and use of a replacement SEH, besides for programs in a very
restricted environment. Even in special cases an exclusion of the whole SEH
seems to be the simplest solution, requiring nothing but not to use SysUtils.

So my question to Laura is:

What shall be the benefit of your SEH, as opposed to simply excluding SysUtils?

DoDi

P.S.: @Assert shows another calling convention encoding, in addition to the
(stdcall? cdecl?) convention with _GetMem.



Relevant Pages

  • Re: Oh boy, how did we miss this...
    ... but only Delphi exceptions can be /caught/? ... filters based on exception codes, instead of or in addition to ... Is it a technical term, ... Non-Delphi exceptions are handled by SEH, ...
    (comp.lang.pascal.delphi.misc)
  • [EXPL] Alphanumeric GetPC Code and Shellcode Encoder-Decoder
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... In addition attached is an uppercase alphanumeric shellcode ... new SEH. ... Then it causes an exception, passing execution to the new SEH. ...
    (Securiteam)
  • Re: Implementing Exception Handling in a VM
    ... Given that the implementing language has SEH, can ... I leverage this fact to add exception support in my Pascal-like ... handling system in your VM. ...
    (comp.compilers)
  • Re: try/catch with new rtti & /GX doesnt want to catch exception...
    ... but I'll give you my recommendation. ... exception if it happens. ... Wrapping entire programs/threads, i.e. the __try should be at the base ... it's trivial to place the SEH __try in its own ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Try Finally...
    ... >different viewpoint between language constructs and S.E.H. constructs. ... SEH (Structured Exception Handling) is a stack based mechanism **administered ... Try/Except and Try/Finally are the car around the SEH engine. ... the exception handler registered in the stack. ...
    (comp.lang.pascal.delphi.misc)