Re: Exception Handling...

From: David Reeve (dree4456_at_big-pond.net.au)
Date: 06/29/04


Date: Tue, 29 Jun 2004 10:00:42 GMT


<nobody@noplace.not> wrote in message
news:otc1e0dscufp2gss0nh2llfckjits5pmat@4ax.com...
> On Sun, 27 Jun 2004 15:22:24 GMT, "David Reeve" <dree4456@big-pond.net.au>
>
Laura,

I'm up to my neck in crocodiles so won't have a lot of time for this until
the weekend. I would like to get to the stage where I can invoke the OS SEH
mechanism by dropping in some assembler. Not that this is something I have
any need for, just curiosity. Commercial imperative puts me firmly in the OO
bloatware camp :-), and that's not because I've got my arm held up my back.
Like you, my background is in low level and procedural stuff, but I just
love the way I can take an abstract notion and make it a real engineering
entity based on good ole TObject. But, it's also very good to gain as much
understanding of the OS as one possibly can so let's go .....

> If I am reading this correctly...
>
> When you set up try/except:
>
>
> Try // 1 pushes SEH pointer to 4 on the stack

    and links this exception record to the top of the exception chain

> // 2 falls through to your_code
>
> your_code;

   unlinks exception record and cleans stack
>
> except // 3 jump to the more_code if no exception
> // 4 On exception does HandleAnyException
> // 5 On return goes to your_fixups.
>
> your_fixups;
>
> end; // 6 calls DoneExcept in system.pas
> // 7 goes to more_code if exception handled
>
> more_code;
>
>

This is a basic framework, but doesn't cover things like what happens if the
exception isn't handled? Not to mention all the exception filtration stuff.

>
> When you set up try/finally:
>
> Try // 1 pushes SEH pointer to 6 on the stack.
> // 2 falls though to your_code
>
> your_code;
>
> finally // 3 places address of more_code on the stack
> // 4 if no exception falls through to do_anyway
>
> do_anyway;
>
> // 5 jump to more_code if no exception
> end; // 6 on exception does HandleFinally in system.pas
> // 7 jumps to D0_anyway
>
>
> more_code;
>
>

I've had a quick step through this, and it seems to be much as you say.
However, I haven't looked very closely.

Dave



Relevant Pages

  • Re: How great was Petty @ 1/2 time
    ... No exception this time. ... a Gretch. ... I sure thought the double neck was a Danelectro. ...
    (alt.guitar)
  • Re: In-Out Parameters for functions
    ... e and h aren't accessible/used after the exception has been ... division by zero. ... Jacob (who isn't a LL and didn't look it up in the ARM) ...
    (comp.lang.ada)
  • Re: writing on terminal before an exception
    ... It will, surely, as said the ARM 2005: ... But he will loose the default exception informations which are useful ... And any way, the behaviour he has meet is not a normal behaviour, so ...
    (comp.lang.ada)
  • Re: MissingMethodEception
    ... The System.Typeload exception must be having some other information being ... > The exception appears only when a form which contains OpenNETCF components ... > always installed when I deploy the application on the PDA. ... > What are the differences between arm and arm v4? ...
    (microsoft.public.pocketpc.developer)
  • Highway 18
    ... sassy-mouthed punk Jay slipped, fell, and screwed up his arm, he got served ... with the exception of Natalie Gulbis. ...
    (rec.sport.golf)