Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 Raising exceptions can yield undefined behaviour

1.0
open
nobody
None
2013-05-01
2013-05-01
Brian Drummond
No

As "pragma Restrictions (No_Exception_Propagation)" is in effect, any exception not handled locally, simply calls the Last Chance exception handler. This ought to reset the processor via a call to "Reset" (in reality, a jump to the reset address, with pragma No_Return (Reset); on the procedure). See "a-except.adb" in the mini-RTS source folder.

Unfortunately this jumps to the incorrect address thanks to a pragma
for Reset'Address use 0;
while in reality it should be
for Reset'Address use 16#F800#;
or some other CPU-dependent number.

This will be fixed in the next package (msp430_ada_package_4).

Meantime, if you need appropriate behaviour for exceptions on a specific CPU, you can edit the correct address into "a-except.adb" and rebuild the RTS.

Discussion