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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.8.69 with SMTP id 45mr17402055yhq.32.1433002230747; Sat, 30 May 2015 09:10:30 -0700 (PDT) X-Received: by 10.140.109.247 with SMTP id l110mr186378qgf.8.1433002230709; Sat, 30 May 2015 09:10:30 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!z60no4684868qgd.1!news-out.google.com!4ni112qgh.1!nntp.google.com!z60no4684867qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 30 May 2015 09:10:30 -0700 (PDT) In-Reply-To: <87d21im692.fsf@theworld.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.237.62.132; posting-account=orbgeAkAAADzWCTlruxuX_Ts4lIq8C5J NNTP-Posting-Host: 105.237.62.132 References: <41913ae0-7513-4be5-bb94-b834836f8525@googlegroups.com> <87d21im692.fsf@theworld.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1f5c30eb-a48e-4927-95dc-41be417720ef@googlegroups.com> Subject: Re: Arm - ravenscar - exceptions - last chance handler From: jan.de.kruyf@gmail.com Injection-Date: Sat, 30 May 2015 16:10:30 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:193409 Date: 2015-05-30T09:10:30-07:00 List-Id: 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.