From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Extended Exceptions and other tweaks.
Date: Wed, 1 May 2013 23:37:10 +0000 (UTC)
Date: 2013-05-01T23:37:10+00:00 [thread overview]
Message-ID: <kls8v6$70i$1@dont-email.me> (raw)
In-Reply-To: kju5mf$bj8$1@dont-email.me
On Mon, 08 Apr 2013 10:21:04 +0000, Brian Drummond wrote:
> On Sun, 07 Apr 2013 13:20:52 -0700, rrr.eee.27 wrote:
>
>> On Saturday, April 6, 2013 5:49:55 PM UTC+2, Lucretia wrote:
>>> On Monday, 1 April 2013 21:36:58 UTC+1, Brian Drummond wrote:
>> Also in the configurable run time mode you need the files
>> a-except.ad[sb]. They can be very short, however. Have look at these
>> files in the latest AVR-Ada (V1.2.1). Local exceptions -- including
>> user defined ones -- are possible in AVR-Ada.
>
> It would be interesting to know if porting these helps Luke's situation.
>
> I have borrowed the AVR-Ada RTS as a starting point for the TI MSP430
> and it's looking good so far. I haven't tried exceptions yet though, but
> I'll report when I get that far.
Played with exceptions tonight; they look better than I expected and I
think I can shed some light on Luke's experiments.
(NOTE: all the following apply with "pragma No_Exception_Propagation" in
effect)
The a-except.ad[sb] from AVR-Ada _nearly_ worked for the MSP430 as well!
The address clause on "procedure Reset" was the only point of failure so
far, as it is not 0 on the MSP430 but 16#FF80# or other CPU-dependent
value.
What's untested so far:
Actually running the executables : so far I have just examined the code
emitted by the compiler
Raising exceptions as a result of runtime errors (overflow etc) instead
of explicit Raise statements.
What works :
Raising a standard exception.
Handling it locally
Handling it in the Last Chance Saloon (cough, Handler).
Raising a user-defined exception, declared immediately visible to the
subprogram which raises and handles it.
Handling it locally.
Handling it in the Last Chance handler.
Raising a user-defined exception, declared elsewhere - even in a local
package.
Handling it in the Last Chance handler.
What doesn't work :
Locally handling a user-defined exception from another package, via a
selected name. The compiler ignores (deletes) any local handler and
passes the exception (actually just plants a call to) the Last Chance
handler. However, making the exception directly visible via a Use clause,
it does work.
So the following ,
raise Timer_A.oops; -- last chance handler!
and
use Timer_A;
raise oops; -- can be locally handled
end up in different exception handlers!
I'm not clear on whether this is expected behaviour...
- Brian
next prev parent reply other threads:[~2013-05-01 23:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 20:01 Extended Exceptions and other tweaks Diogenes
2013-03-30 22:10 ` Brian Drummond
2013-03-31 1:18 ` Diogenes
2013-04-01 20:36 ` Brian Drummond
2013-04-06 15:49 ` Lucretia
2013-04-07 20:20 ` rrr.eee.27
2013-04-08 10:21 ` Brian Drummond
2013-05-01 23:37 ` Brian Drummond [this message]
2013-05-02 1:06 ` Randy Brukardt
2013-05-05 12:41 ` Brian Drummond
2013-05-07 0:39 ` Randy Brukardt
2013-05-04 7:52 ` Yannick Duchêne (Hibou57)
2013-03-31 13:55 ` Luke A. Guest
2013-03-30 22:38 ` Shark8
2013-03-31 11:41 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox