From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Extended Exceptions and other tweaks. Date: Wed, 1 May 2013 23:37:10 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <39102c40-a4e3-4991-a94a-d7d51856c83d@googlegroups.com> <3c252206-989c-40c6-838f-6a37eeac9349@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 1 May 2013 23:37:10 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="da745e888d4a5182b5fda6212bbb0a63"; logging-data="7186"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7BmBUKyATpQHkF4OLYlw+eHjOVHfrF0E=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:mewNgrOzva0vf4HeagsiyFz89xA= X-Original-Bytes: 3868 Xref: number.nntp.dca.giganews.com comp.lang.ada:181341 Date: 2013-05-01T23:37:10+00:00 List-Id: 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