comp.lang.ada
 help / color / mirror / Atom feed
From: jan.de.kruyf@gmail.com
Subject: Re: Arm - ravenscar - exceptions - last chance handler
Date: Sat, 30 May 2015 09:10:30 -0700 (PDT)
Date: 2015-05-30T09:10:30-07:00	[thread overview]
Message-ID: <1f5c30eb-a48e-4927-95dc-41be417720ef@googlegroups.com> (raw)
In-Reply-To: <87d21im692.fsf@theworld.com>

On Saturday, May 30, 2015 at 5:31:41 PM UTC+2, Bob Duff wrote:

> 
> > How is last chance handler going to know the --length-- of the message?
> 
> It's a NUL-terminated string, as the comment in the spec says:
> 
>    procedure Raise_Exception (E : Exception_Id; Message : String := "");
>    pragma No_Return (Raise_Exception);
>    --  Unconditionally call __gnat_last_chance_handler. Message should be a
>    --  null terminated string. Note that the exception is still raised even
>    --  if E is the null exception id. This is a deliberate simplification for
>    --  this profile (the use of Raise_Exception with a null id is very rare in
>    --  any case, and this way we avoid introducing Raise_Exception_Always and
>    --  we also avoid the if test in Raise_Exception).
> 
> > If we say that I have to append an ASCII.NUL when I raise an exception
> > then it runs havoc with the other runtime modules where exceptions are
> > used.
> 
> Why?  To raise an exception, you just say "raise Some_Exception;".
> No need to fool about with ASCII.NUL, except in the last-chance
> handler itself; the default version says:
> 
>          exit when Msg_Str (J) = Character'Val (0);
> 
> - Bob

Yes bob,
I saw that NUL terminated part just after I posted, so I tried to delete the post, but that is hard :) apparently.

In any case there is a more serious issue I think (in ravenscar).
I get unresolved symbols in a partial link caused by "raise exeption". 
(partial link since this is a kernel module)

The unresolved symbols point to the full native (linux) runtime.
So I replaces the "raise" statements in the ravenscar runtime packages I use with an explicit 
Ada.Exceptions.Raise_Exception (...);  (this then from the ravenscar profile)
which I understand to be the recommendation from the Exeptions package's comment.

That works, but some of the runtime packages are marked "pure" so they cannot depend on Ada.Exceptions.

There is still another issue, but I will post that when I am finished. If needed.

Peace,

j.



  reply	other threads:[~2015-05-30 16:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-30 14:26 Arm - ravenscar - exceptions - last chance handler jan.de.kruyf
2015-05-30 14:53 ` Jacob Sparre Andersen
2015-05-30 18:48   ` jan.de.kruyf
2015-05-30 19:18     ` Simon Wright
2015-05-30 20:57       ` jan.de.kruyf
2015-05-30 15:31 ` Bob Duff
2015-05-30 16:10   ` jan.de.kruyf [this message]
2015-05-30 16:50     ` Simon Wright
2015-05-30 20:59       ` jan.de.kruyf
2015-05-30 15:43 ` Simon Wright
2015-05-30 16:14   ` jan.de.kruyf
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox