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)
  • Re: initial lang spec: SXIL...
    ... Shouldn't some of that functionality be moved into the exception ... but, of course, natively using SEH requires compiler support. ... throws a fixed exception code in my case, and generic handlers are used. ... It took many years, and a language review, before I realized that my fond ...
    (comp.lang.misc)
  • Re: CORRECTION Re: confused by exception handling in VC 2008
    ... translator to convert asynchronous SEH exceptions into synchronous C++ ... going to combine SEH and C++ exception handling, you should at least do it ...
    (microsoft.public.vc.mfc)
  • [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)