Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"No matter where you go, there you are..." -- Buckaroo Banzai


devel / comp.lang.ada / Extra information in the message string of exceptions.

SubjectAuthor
* Extra information in the message string of exceptions.Rod Kay
+* Re: Extra information in the message string of exceptions.Fabien Chouteau
|+* Re: Extra information in the message string of exceptions.G.B.
||`- Re: Extra information in the message string of exceptions.Dmitry A. Kazakov
|+- Re: Extra information in the message string of exceptions.Rod Kay
|`* Re: Extra information in the message string of exceptions.Fabien Chouteau
| +- Re: Extra information in the message string of exceptions.Anh Vo
| `* Re: Extra information in the message string of exceptions.Jerry
|  +* Re: Extra information in the message string of exceptions.Dmitry A. Kazakov
|  |`- Re: Extra information in the message string of exceptions.Jerry
|  `* Re: Extra information in the message string of exceptions.Dmitry A. Kazakov
|   `* Re: Extra information in the message string of exceptions.Rod Kay
|    `* Re: Extra information in the message string of exceptions.Jerry
|     +* Re: Extra information in the message string of exceptions.Rod Kay
|     |+- Re: Extra information in the message string of exceptions.Gautier write-only address
|     |`- Re: Extra information in the message string of exceptions.G.B.
|     `- Re: Extra information in the message string of exceptions.Jerry
+* Re: Extra information in the message string of exceptions.Gautier write-only address
|+* Re: Extra information in the message string of exceptions.Randy Brukardt
||`- Re: Extra information in the message string of exceptions.Rod Kay
|`- Re: Extra information in the message string of exceptions.Rod Kay
+* Re: Extra information in the message string of exceptions.Luke A. Guest
|`* Re: Extra information in the message string of exceptions.Rod Kay
| `- Re: Extra information in the message string of exceptions.Luke A. Guest
+* Re: Extra information in the message string of exceptions.DrPi
|`* Re: Extra information in the message string of exceptions.Jerry
| `* Re: Extra information in the message string of exceptions.Gautier write-only address
|  +- Re: Extra information in the message string of exceptions.Randy Brukardt
|  +- Re: Extra information in the message string of exceptions.Simon Wright
|  `- Re: Extra information in the message string of exceptions.Jerry
`- Re: Extra information in the message string of exceptions.Robin Vowels

Pages:12
Extra information in the message string of exceptions.

<t7ktsu$178$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8358&group=comp.lang.ada#8358

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 22:59:19 +1000
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <t7ktsu$178$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 6 Jun 2022 13:02:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="bcbb2fd6a7ddabdfae906a2af6b17d22";
logging-data="1256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GuDYMOL27y8LyNn96ERVi9es1nLkIZIU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:Z92y/Wx7+nFCR4SV2MR3yM7Bsxg=
Content-Language: en-US
 by: Rod Kay - Mon, 6 Jun 2022 12:59 UTC

Hi all,

Any thoughts on pro's/con's of having the Ada standard packages
runtime provide extra information in the message string of exceptions ?

For instance, a Constraint_Error message might provide details on
the variable name, the legal range and the erroneous value which caused
the exception.

Regards.

Re: Extra information in the message string of exceptions.

<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8359&group=comp.lang.ada#8359

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:19cc:b0:46b:9918:2225 with SMTP id j12-20020a05621419cc00b0046b99182225mr3844313qvc.77.1654522837409;
Mon, 06 Jun 2022 06:40:37 -0700 (PDT)
X-Received: by 2002:a81:9f0d:0:b0:2fe:ac51:19b with SMTP id
s13-20020a819f0d000000b002feac51019bmr26263783ywn.164.1654522837091; Mon, 06
Jun 2022 06:40:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 6 Jun 2022 06:40:36 -0700 (PDT)
In-Reply-To: <t7ktsu$178$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=86.212.105.77; posting-account=L3mulQoAAADsXVjCD5rM6Ap3Xy0U3ckB
NNTP-Posting-Host: 86.212.105.77
References: <t7ktsu$178$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: fabien.chouteau@gmail.com (Fabien Chouteau)
Injection-Date: Mon, 06 Jun 2022 13:40:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1672
 by: Fabien Chouteau - Mon, 6 Jun 2022 13:40 UTC

On Monday, June 6, 2022 at 3:02:25 PM UTC+2, roda...@gmail.com wrote:
> For instance, a Constraint_Error message might provide details on
> the variable name, the legal range and the erroneous value which caused
> the exception.

That's a really good idea I would say. Extremely useful during development where I often start the debugger just to know what value triggered a Constraint_Error.

I guess the drawback is performance as formatting string with extra information will have a cost.
But this feature could be activated with a switch only when needed.

Re: Extra information in the message string of exceptions.

<1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8360&group=comp.lang.ada#8360

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:44b:b0:2f3:f495:386b with SMTP id o11-20020a05622a044b00b002f3f495386bmr18592914qtx.349.1654525868320;
Mon, 06 Jun 2022 07:31:08 -0700 (PDT)
X-Received: by 2002:a25:1a43:0:b0:660:4263:3452 with SMTP id
a64-20020a251a43000000b0066042633452mr23695517yba.267.1654525868138; Mon, 06
Jun 2022 07:31:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 6 Jun 2022 07:31:07 -0700 (PDT)
In-Reply-To: <t7ktsu$178$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:282b:1d00:80de:cf04:9bb:94b6;
posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1210:282b:1d00:80de:cf04:9bb:94b6
References: <t7ktsu$178$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: gautier_niouzes@hotmail.com (Gautier write-only address)
Injection-Date: Mon, 06 Jun 2022 14:31:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Gautier write-only a - Mon, 6 Jun 2022 14:31 UTC

> Any thoughts on pro's/con's of having the Ada standard packages
> runtime provide extra information in the message string of exceptions ?

It depends on the compiler. And of course it is advantage to provide more details.
For instance HAC issues for...

procedure CE_2 is
i : Positive;
j : Integer := 1;
begin
i := -j;
end CE_2;

the message:
hac ce_2.adb
HAC VM: raised Constraint_Error
Out of range: pos, -1, is below (sub)type's lower bound, 1
Trace-back: approximate location
ce_2.adb: CE_2 at line 5

Of for...

procedure CE_3 is
a : array (1 .. 5) of Integer;
begin
a (7) := 2;
end CE_3;

hac ce_3.adb
HAC VM: raised Constraint_Error
Out of range: index (pos: 7) is above upper bound (pos: 5)
Trace-back: approximate location
ce_3.adb: CE_3 at line 4

Re: Extra information in the message string of exceptions.

<t7lhnq$eeh$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8362&group=comp.lang.ada#8362

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bauhaus@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 20:40:57 +0200
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <t7lhnq$eeh$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me>
<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
Reply-To: nonlegitur@notmyhomepage.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 6 Jun 2022 18:40:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a8b1658011db123fdeababb46b965338";
logging-data="14801"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IQJ7eKjhCHclbsawKh9VjAFP1dT3BpO0="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.1
Cancel-Lock: sha1:/6+susGN5AZpdMRIc93iyo+nvdM=
In-Reply-To: <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
Content-Language: en-US
 by: G.B. - Mon, 6 Jun 2022 18:40 UTC

On 06.06.22 15:40, Fabien Chouteau wrote:
> On Monday, June 6, 2022 at 3:02:25 PM UTC+2, roda...@gmail.com wrote:
>> For instance, a Constraint_Error message might provide details on
>> the variable name, the legal range and the erroneous value which caused
>> the exception.
>
> That's a really good idea I would say. Extremely useful during development where I often start the debugger just to know what value triggered a Constraint_Error.
>
> I guess the drawback is performance as formatting string with extra information will have a cost.
> But this feature could be activated with a switch only when needed.

Will it help to have a standard object taking just the data?

Re: Extra information in the message string of exceptions.

<t7lk9a$79u$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8363&group=comp.lang.ada#8363

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 21:24:27 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t7lk9a$79u$1@gioia.aioe.org>
References: <t7ktsu$178$1@dont-email.me>
<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<t7lhnq$eeh$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7486"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Mon, 6 Jun 2022 19:24 UTC

On 2022-06-06 20:40, G.B. wrote:
> On 06.06.22 15:40, Fabien Chouteau wrote:
>> On Monday, June 6, 2022 at 3:02:25 PM UTC+2, roda...@gmail.com wrote:
>>> For instance, a Constraint_Error message might provide details on
>>> the variable name, the legal range and the erroneous value which caused
>>> the exception.
>>
>> That's a really good idea I would say. Extremely useful during
>> development where I often start the debugger just to know what value
>> triggered a Constraint_Error.
>>
>> I guess the drawback is performance as formatting string with extra
>> information will have a cost.
>> But this feature could be activated with a switch only when needed.
>
> Will it help to have a standard object taking just the data?

Besides problems with finalization and touching memory pools, an
exception from a rendezvous is propagated in two tasks. Will the object
be shared, copied?

------------------
Though you can always serialize an object into a string stream and use
the result. One could consider some syntax sugar like:

raise E with X;

would mean

declare
S : aliased String_Stream (200);
begin
T'Output (S'Access, X); -- T is the subtype of X
raise E with S.Get;
end;

and

function Stream (X : Exception_Occurrence)
return not null access Root_Stream_Type'Class;

So, in the handler:

when Error : E =>
declare
X : T'Class := T'Class'Input (Error'Stream);
begin
...
end;

without the sugar:

when Error : E =>
declare
S : aliased String_Stream (200);
begin
S.Set (Exception_Message (S));
declare
X : T'Class := T'Class'Input (S'Access);
begin
...
end;
end;

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Extra information in the message string of exceptions.

<t7ln9o$1hkn$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8364&group=comp.lang.ada#8364

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail
From: laguest@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 21:14:26 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t7ln9o$1hkn$1@gioia.aioe.org>
References: <t7ktsu$178$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="50839"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luke A. Guest - Mon, 6 Jun 2022 20:14 UTC

On 06/06/2022 13:59, Rod Kay wrote:
> Hi all,
>
>    Any thoughts on pro's/con's of having the Ada standard packages
> runtime provide extra information in the message string of exceptions ?
>
>    For instance, a Constraint_Error message might provide details on
> the variable name, the legal range and the erroneous value which caused
> the exception.

This is something which could be added to either the language or the
compiler. GNAT does have a dump backtrace call you could use.

Luke.

Re: Extra information in the message string of exceptions.

<629e6842$0$24796$426a74cc@news.free.fr>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8365&group=comp.lang.ada#8365

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-a.proxad.net!nnrp5-1.free.fr!not-for-mail
Date: Mon, 6 Jun 2022 22:49:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Subject: Re: Extra information in the message string of exceptions.
Content-Language: fr
Newsgroups: comp.lang.ada
References: <t7ktsu$178$1@dont-email.me>
From: 314@drpi.fr (DrPi)
In-Reply-To: <t7ktsu$178$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 16
Message-ID: <629e6842$0$24796$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 06 Jun 2022 22:49:06 CEST
NNTP-Posting-Host: 82.65.30.55
X-Trace: 1654548546 news-2.free.fr 24796 82.65.30.55:60752
X-Complaints-To: abuse@proxad.net
 by: DrPi - Mon, 6 Jun 2022 20:49 UTC

Le 06/06/2022 à 14:59, Rod Kay a écrit :
> Hi all,
>
>    Any thoughts on pro's/con's of having the Ada standard packages
> runtime provide extra information in the message string of exceptions ?
>
>    For instance, a Constraint_Error message might provide details on
> the variable name, the legal range and the erroneous value which caused
> the exception.
>

+1

>
> Regards.

Re: Extra information in the message string of exceptions.

<368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8366&group=comp.lang.ada#8366

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:570:b0:6a6:ccb6:3083 with SMTP id p16-20020a05620a057000b006a6ccb63083mr2884299qkp.408.1654557458153;
Mon, 06 Jun 2022 16:17:38 -0700 (PDT)
X-Received: by 2002:a81:106:0:b0:2d0:e682:8a7a with SMTP id
6-20020a810106000000b002d0e6828a7amr28933028ywb.257.1654557458013; Mon, 06
Jun 2022 16:17:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 6 Jun 2022 16:17:37 -0700 (PDT)
In-Reply-To: <629e6842$0$24796$426a74cc@news.free.fr>
Injection-Info: google-groups.googlegroups.com; posting-host=174.26.236.234; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 174.26.236.234
References: <t7ktsu$178$1@dont-email.me> <629e6842$0$24796$426a74cc@news.free.fr>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: list_email@icloud.com (Jerry)
Injection-Date: Mon, 06 Jun 2022 23:17:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jerry - Mon, 6 Jun 2022 23:17 UTC

On Monday, June 6, 2022 at 1:49:08 PM UTC-7, DrPi wrote:
> Le 06/06/2022 à 14:59, Rod Kay a écrit :
> > Hi all,
> >
> > Any thoughts on pro's/con's of having the Ada standard packages
> > runtime provide extra information in the message string of exceptions ?
> >
> > For instance, a Constraint_Error message might provide details on
> > the variable name, the legal range and the erroneous value which caused
> > the exception.
> >
> +1
>
> >
> > Regards.

This is not responsive to the OP but here is a bit of code that I find extremely useful to get a symbolic traceback for unhandled exceptions. Here is an example:

with Common; use Common;
with Ada.Exceptions;

procedure CE_2 is
i : Positive;
j : Integer := 1;

procedure A_Subroutine is
begin
i := -j;
end A_Subroutine;

begin
A_Subroutine;

-- Print a traceback for all unhandled exceptions.
-- See http://www.adacore.com/adaanswers/gems/gem-142-exceptions/.
exception
when Error : others =>
Common.Print_Traceback_For_Unhandled_Exception(Error);
end CE_2;

It provides this output:

=========================================================Exception name: CONSTRAINT_ERROR
Message: ce_2.adb:10 range check failed
Load address: 0x100000000
Call stack traceback locations:
0x1000013ac 0x1000013cd 0x100001c36
<<<<<< Symbolic Traceback >>>>>>
If incomplete, compile with -O0.
ce_2__a_subroutine.3035 (in run) (ce_2.adb:10)
_ada_ce_2 (in run) (ce_2.adb:14)
main (in run) (b__ce_2.adb:354)
=========================================================
I can post the code that does this if anyone is interested. The gist is calling Ada.Exceptions.Exception_Information, massaging that information, and calling atos. (Is atos macOS-specific?)

Jerry

Re: Extra information in the message string of exceptions.

<cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8368&group=comp.lang.ada#8368

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:1983:b0:304:f190:1739 with SMTP id u3-20020a05622a198300b00304f1901739mr4019809qtc.382.1654566811661;
Mon, 06 Jun 2022 18:53:31 -0700 (PDT)
X-Received: by 2002:a5b:148:0:b0:650:15bd:97ab with SMTP id
c8-20020a5b0148000000b0065015bd97abmr28400920ybp.231.1654566811471; Mon, 06
Jun 2022 18:53:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 6 Jun 2022 18:53:31 -0700 (PDT)
In-Reply-To: <368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:282b:1d00:80de:cf04:9bb:94b6;
posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1210:282b:1d00:80de:cf04:9bb:94b6
References: <t7ktsu$178$1@dont-email.me> <629e6842$0$24796$426a74cc@news.free.fr>
<368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: gautier_niouzes@hotmail.com (Gautier write-only address)
Injection-Date: Tue, 07 Jun 2022 01:53:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1481
 by: Gautier write-only a - Tue, 7 Jun 2022 01:53 UTC

GNAT provides an integrated symbolic trace-back through the -Es switch. Doesn't it work on your Mac setup?
Anyway, it's much trouble for a feature which should be activated by default...

Re: Extra information in the message string of exceptions.

<t7mde9$th0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8369&group=comp.lang.ada#8369

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 21:33:44 -0500
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <t7mde9$th0$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me> <1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>
Injection-Date: Tue, 7 Jun 2022 02:33:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6298794fc2e54696148ef40c1d1f6757";
logging-data="30240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Q6sVsUApN4jM+Kt0yhljXQfGZUvxJAfY="
Cancel-Lock: sha1:EcqhJXUtSBZmyUVZb1Gzi/By6YA=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Tue, 7 Jun 2022 02:33 UTC

"Gautier write-only address" <gautier_niouzes@hotmail.com> wrote in message
news:1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com...
>> Any thoughts on pro's/con's of having the Ada standard packages
>> runtime provide extra information in the message string of exceptions ?
>
> It depends on the compiler. And of course it is advantage to provide more
> details.
> For instance HAC issues for...
>
> procedure CE_2 is
> i : Positive;
> j : Integer := 1;
> begin
> i := -j;
> end CE_2;
>
> the message:
> hac ce_2.adb
> HAC VM: raised Constraint_Error
> Out of range: pos, -1, is below (sub)type's lower bound, 1
> Trace-back: approximate location
> ce_2.adb: CE_2 at line 5

Janus/Ada has *always* done this (going all the way back to the original
Z-80 CP/M compiler). This particular case is not very expensive, since one
can use the fact that the out-of-range value is certainly in a register to
be tested in order to construct the message. And no real program cares about
the performance of raising Constraint_Error -- the main issue is one of
space (making the program larger).

For example, from a recent bug report:

** Unhandled CONSTRAINT_ERROR
Index or Subtype out of bounds - Pos of Error Value = 197807
On Line Number 37 In XCB_MAIN.DETERMINE_FILE_SIZE
Called from line number 40 In XCB_MAIN

It's possible to turn this off, but there hasn't been much need to do so
this century.

Randy.

P.S. I'd quibble with the OP, in that the vast majority of Constraint_Errors
have nothing to do with the standard library; their checks are compiled
directly into the code of your application; the only use of a library is to
raise an exception. We use special library calls for specific checks (like
the discrete range error discussed here); no strings are created in the user
code. An implementation would certainly have to do that as the alternative
would be to duplicate lots of complex code for each failed check -- but in
the absence of such information, the implementation probably uses the same
library call to raise all exceptions. Ergo, such a change probably isn't
easy for any implementation that doesn't do something like it already.

Re: Extra information in the message string of exceptions.

<t7mdi2$vlt$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8370&group=comp.lang.ada#8370

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 6 Jun 2022 21:35:45 -0500
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <t7mdi2$vlt$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me> <629e6842$0$24796$426a74cc@news.free.fr> <368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com> <cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>
Injection-Date: Tue, 7 Jun 2022 02:35:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6298794fc2e54696148ef40c1d1f6757";
logging-data="32445"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JgAWDlaoWYgn+rG0qxWMJI/olTYCfcvM="
Cancel-Lock: sha1:se6clssdBG9MBEh9uLIdjuJTZG0=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Tue, 7 Jun 2022 02:35 UTC

"Gautier write-only address" <gautier_niouzes@hotmail.com> wrote in message
news:cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com...
> GNAT provides an integrated symbolic trace-back through the -Es switch.
> Doesn't it work on your Mac setup?
> Anyway, it's much trouble for a feature which should be activated by
> default...

And I think it is in every other Ada compiler I've ever used. Ergo, don't
blame the language, blame the implementation. ::-)

Randy.

Re: Extra information in the message string of exceptions.

<lybkv4vqvd.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8371&group=comp.lang.ada#8371

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Ofu2LXXrFlhjBDnAd1biaw.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 07 Jun 2022 09:07:18 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lybkv4vqvd.fsf@pushface.org>
References: <t7ktsu$178$1@dont-email.me>
<629e6842$0$24796$426a74cc@news.free.fr>
<368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com>
<cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="63026"; posting-host="Ofu2LXXrFlhjBDnAd1biaw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:B0HYQzvb3RxCPIzkfmVqd+lM/Q4=
 by: Simon Wright - Tue, 7 Jun 2022 08:07 UTC

Gautier write-only address <gautier_niouzes@hotmail.com> writes:

> GNAT provides an integrated symbolic trace-back through the -Es
> switch. Doesn't it work on your Mac setup?

No. atos is a macOS utility.

Re: Extra information in the message string of exceptions.

<t7ncr6$5bi$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8372&group=comp.lang.ada#8372

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 7 Jun 2022 21:26:35 +1000
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <t7ncr6$5bi$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me>
<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Jun 2022 11:29:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3132443202e2650422bf11ef5d6e8d7c";
logging-data="5490"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OfH7KBJf9QIBY3Ugf/WMRllPaqTAbijo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:U8BXZVa1gDJfzM107REOsGj+im4=
In-Reply-To: <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
Content-Language: en-US
 by: Rod Kay - Tue, 7 Jun 2022 11:26 UTC

On 6/6/22 23:40, Fabien Chouteau wrote:
>
> That's a really good idea I would say. Extremely useful during development where I often start the debugger just to know what value triggered a Constraint_Error.

Starting gdb and adding 'put_Line's often is what prompted the
thought :) .

> I guess the drawback is performance as formatting string with extra information will have a cost.
> But this feature could be activated with a switch only when needed.

A compiler switch to be used during development and debugging sounds
ideal.

Re: Extra information in the message string of exceptions.

<t7nd19$99p$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8373&group=comp.lang.ada#8373

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 7 Jun 2022 21:29:52 +1000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <t7nd19$99p$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me>
<1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Jun 2022 11:32:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3132443202e2650422bf11ef5d6e8d7c";
logging-data="9529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E2NjcmwnyVUqzWBVOvhWn0GJj/KEgiPA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:Xii/xLLQU0sZmAolFOHq2khUVoc=
In-Reply-To: <1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>
Content-Language: en-US
 by: Rod Kay - Tue, 7 Jun 2022 11:29 UTC

On 7/6/22 00:31, Gautier write-only address wrote:

> hac ce_2.adb
> HAC VM: raised Constraint_Error
> Out of range: pos, -1, is below (sub)type's lower bound, 1
> Trace-back: approximate location
> ce_2.adb: CE_2 at line 5
>
> Of for...
>

... and ...

> hac ce_3.adb
> HAC VM: raised Constraint_Error
> Out of range: index (pos: 7) is above upper bound (pos: 5)
> Trace-back: approximate location
> ce_3.adb: CE_3 at line 4

.... are very much what i'd like to see.

Re: Extra information in the message string of exceptions.

<t7ne2k$t4d$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8374&group=comp.lang.ada#8374

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 7 Jun 2022 21:47:38 +1000
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <t7ne2k$t4d$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me>
<1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com>
<t7mde9$th0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Jun 2022 11:50:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3132443202e2650422bf11ef5d6e8d7c";
logging-data="29837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7KCODJkoLDGfhSX5TojpAFYc4OlMvwM8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:ZGm6wbKkVSBpcoc0EfC3sPNCs8Y=
In-Reply-To: <t7mde9$th0$1@dont-email.me>
Content-Language: en-US
 by: Rod Kay - Tue, 7 Jun 2022 11:47 UTC

On 7/6/22 12:33, Randy Brukardt wrote:
>
> Janus/Ada has *always* done this (going all the way back to the original
> Z-80 CP/M compiler).

Very nice !

This particular case is not very expensive, since one
> can use the fact that the out-of-range value is certainly in a register to
> be tested in order to construct the message. And no real program cares about
> the performance of raising Constraint_Error

I didn't think that there would be too much impact on performance.

-- the main issue is one of
> space (making the program larger).
>
I hadn't really considered the extra space required. For a
desktop/workstation/server, I expect the extra space would not be a huge
consideration. For embedded systems and such, I guess it might be,
though if the feature could be switched off for production releases
perhaps not such a big problem.

> P.S. I'd quibble with the OP, in that the vast majority of Constraint_Errors
> have nothing to do with the standard library; their checks are compiled
> directly into the code of your application.

Quite right. I should simply have said the standard exceptions,
wherever they are raised.

Re: Extra information in the message string of exceptions.

<t7ne9u$217$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8375&group=comp.lang.ada#8375

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: rodakay5@gmail.com (Rod Kay)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 7 Jun 2022 21:51:33 +1000
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <t7ne9u$217$1@dont-email.me>
References: <t7ktsu$178$1@dont-email.me> <t7ln9o$1hkn$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 7 Jun 2022 11:54:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3132443202e2650422bf11ef5d6e8d7c";
logging-data="2087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bvhJ8w/Wy4fN2jNQP6wCshPvUKqrgaec="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:qfh5HVz5+kIYBo1KwMI4Lret6Cc=
In-Reply-To: <t7ln9o$1hkn$1@gioia.aioe.org>
Content-Language: en-US
 by: Rod Kay - Tue, 7 Jun 2022 11:51 UTC

On 7/6/22 06:14, Luke A. Guest wrote:
>
> This is something which could be added to either the language or the
> compiler.

I'd prefer to see it in the standard (for the usual reasons).

> GNAT does have a dump backtrace call you could use.
>

Ah, does it show more info than just the call stack ?

Re: Extra information in the message string of exceptions.

<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8376&group=comp.lang.ada#8376

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:240a:b0:6a6:b841:a635 with SMTP id d10-20020a05620a240a00b006a6b841a635mr8084311qkn.689.1654617359107;
Tue, 07 Jun 2022 08:55:59 -0700 (PDT)
X-Received: by 2002:a25:1e83:0:b0:663:3a51:1ee2 with SMTP id
e125-20020a251e83000000b006633a511ee2mr19133019ybe.379.1654617358722; Tue, 07
Jun 2022 08:55:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 7 Jun 2022 08:55:58 -0700 (PDT)
In-Reply-To: <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=86.212.105.77; posting-account=L3mulQoAAADsXVjCD5rM6Ap3Xy0U3ckB
NNTP-Posting-Host: 86.212.105.77
References: <t7ktsu$178$1@dont-email.me> <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: fabien.chouteau@gmail.com (Fabien Chouteau)
Injection-Date: Tue, 07 Jun 2022 15:55:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1438
 by: Fabien Chouteau - Tue, 7 Jun 2022 15:55 UTC

On Monday, June 6, 2022 at 3:40:38 PM UTC+2, Fabien Chouteau wrote:
> But this feature could be activated with a switch only when needed.

Well, it turns our this is already implemented in GNAT ^^

Example here: https://godbolt.org/z/fcTEaq3xP

Re: Extra information in the message string of exceptions.

<f61f4566-85dc-4a07-b4d1-2444bb4ff64bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8377&group=comp.lang.ada#8377

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:c6e:b0:46b:c08b:c649 with SMTP id t14-20020a0562140c6e00b0046bc08bc649mr2173114qvj.59.1654620066915;
Tue, 07 Jun 2022 09:41:06 -0700 (PDT)
X-Received: by 2002:a25:c711:0:b0:65c:9f45:64e5 with SMTP id
w17-20020a25c711000000b0065c9f4564e5mr29956425ybe.189.1654620066626; Tue, 07
Jun 2022 09:41:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 7 Jun 2022 09:41:06 -0700 (PDT)
In-Reply-To: <3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=149.32.192.43; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6
NNTP-Posting-Host: 149.32.192.43
References: <t7ktsu$178$1@dont-email.me> <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f61f4566-85dc-4a07-b4d1-2444bb4ff64bn@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: anhvofrcaus@gmail.com (Anh Vo)
Injection-Date: Tue, 07 Jun 2022 16:41:06 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1602
 by: Anh Vo - Tue, 7 Jun 2022 16:41 UTC

On Tuesday, June 7, 2022 at 8:56:00 AM UTC-7, Fabien Chouteau wrote:
> On Monday, June 6, 2022 at 3:40:38 PM UTC+2, Fabien Chouteau wrote:
> > But this feature could be activated with a switch only when needed.
> Well, it turns our this is already implemented in GNAT ^^
>
> Example here: https://godbolt.org/z/fcTEaq3xP
Very nice. I love some thing like this.

Re: Extra information in the message string of exceptions.

<t7oeml$6di$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8378&group=comp.lang.ada#8378

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail
From: laguest@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Tue, 7 Jun 2022 22:06:05 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t7oeml$6di$1@gioia.aioe.org>
References: <t7ktsu$178$1@dont-email.me> <t7ln9o$1hkn$1@gioia.aioe.org>
<t7ne9u$217$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="6578"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Luke A. Guest - Tue, 7 Jun 2022 21:06 UTC

On 07/06/2022 12:51, Rod Kay wrote:
> On 7/6/22 06:14, Luke A. Guest wrote:
>>
>> This is something which could be added to either the language or the
>> compiler.
>
>    I'd prefer to see it in the standard (for the usual reasons).

Yeah, fair enough, just saying it could be added no problems (probably).

>> GNAT does have a dump backtrace call you could use.
>>
>
>    Ah, does it show more info than just the call stack ?

That I'm not sure of, been a while since I looked at it.

Re: Extra information in the message string of exceptions.

<53219f4c-cfe9-483e-b8eb-59b14c2a02d0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8379&group=comp.lang.ada#8379

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:58c:b0:305:79a:f53 with SMTP id c12-20020a05622a058c00b00305079a0f53mr64530qtb.601.1654672495849;
Wed, 08 Jun 2022 00:14:55 -0700 (PDT)
X-Received: by 2002:a0d:ee47:0:b0:2ff:85e6:9e03 with SMTP id
x68-20020a0dee47000000b002ff85e69e03mr35880178ywe.172.1654672495717; Wed, 08
Jun 2022 00:14:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 8 Jun 2022 00:14:55 -0700 (PDT)
In-Reply-To: <cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.26.236.234; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 174.26.236.234
References: <t7ktsu$178$1@dont-email.me> <629e6842$0$24796$426a74cc@news.free.fr>
<368dd024-8697-42bd-bb9c-4239cbe8fca1n@googlegroups.com> <cd0452bc-1330-4754-b88a-9c000707f098n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <53219f4c-cfe9-483e-b8eb-59b14c2a02d0n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: list_email@icloud.com (Jerry)
Injection-Date: Wed, 08 Jun 2022 07:14:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1653
 by: Jerry - Wed, 8 Jun 2022 07:14 UTC

On Monday, June 6, 2022 at 6:53:32 PM UTC-7, wrote:
> GNAT provides an integrated symbolic trace-back through the -Es switch. Doesn't it work on your Mac setup?
> Anyway, it's much trouble for a feature which should be activated by default...
It does not work. My compiler reports "unrecognized command line option '-Es'". Maybe it's a new feature. My GNAT is a few years old.

Re: Extra information in the message string of exceptions.

<574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8380&group=comp.lang.ada#8380

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:a215:0:b0:6a6:ab29:a54e with SMTP id l21-20020a37a215000000b006a6ab29a54emr14982651qke.458.1654673473254;
Wed, 08 Jun 2022 00:31:13 -0700 (PDT)
X-Received: by 2002:a81:4c8e:0:b0:300:37ba:2c1e with SMTP id
z136-20020a814c8e000000b0030037ba2c1emr37388417ywa.141.1654673473062; Wed, 08
Jun 2022 00:31:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 8 Jun 2022 00:31:12 -0700 (PDT)
In-Reply-To: <3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.26.236.234; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 174.26.236.234
References: <t7ktsu$178$1@dont-email.me> <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: list_email@icloud.com (Jerry)
Injection-Date: Wed, 08 Jun 2022 07:31:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1989
 by: Jerry - Wed, 8 Jun 2022 07:31 UTC

On Tuesday, June 7, 2022 at 8:56:00 AM UTC-7, Fabien Chouteau wrote:
> On Monday, June 6, 2022 at 3:40:38 PM UTC+2, Fabien Chouteau wrote:
> > But this feature could be activated with a switch only when needed.
> Well, it turns our this is already implemented in GNAT ^^
>
> Example here: https://godbolt.org/z/fcTEaq3xP
Indeed. The switch is -GNATeE. It provides additional information for the program at that page,

procedure Main is
procedure Test (A : Integer) is
type T is range 0 .. 42;
begin
Ada.Text_IO.Put_Line (T (A)'Img);
end;
begin
Test (-1);
end Main;

But has no effect on this program;

procedure CE_2 is
i : Positive;
j : Integer := 1;
begin
i := -j;
end CE_2;

Jerry

Re: Extra information in the message string of exceptions.

<t7pl69$f57$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8381&group=comp.lang.ada#8381

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Wed, 8 Jun 2022 10:04:26 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t7pl69$f57$1@gioia.aioe.org>
References: <t7ktsu$178$1@dont-email.me>
<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
<574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="15527"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Wed, 8 Jun 2022 08:04 UTC

On 2022-06-08 09:31, Jerry wrote:
> On Tuesday, June 7, 2022 at 8:56:00 AM UTC-7, Fabien Chouteau wrote:
>> On Monday, June 6, 2022 at 3:40:38 PM UTC+2, Fabien Chouteau wrote:
>>> But this feature could be activated with a switch only when needed.
>> Well, it turns our this is already implemented in GNAT ^^
>>
>> Example here: https://godbolt.org/z/fcTEaq3xP
> Indeed. The switch is -GNATeE. It provides additional information for the program at that page,
>
> procedure Main is
> procedure Test (A : Integer) is
> type T is range 0 .. 42;
> begin
> Ada.Text_IO.Put_Line (T (A)'Img);
> end;
> begin
> Test (-1);
> end Main;
>
> But has no effect on this program;
>
> procedure CE_2 is
> i : Positive;
> j : Integer := 1;
> begin
> i := -j;
> end CE_2;

The switches are -E for binder and -g for everything else. Try this:

--- test_ce.gpr ----------------------------------------
project Test_CE is
for Source_Files use ("test_ce.adb");
for Main use ("test_ce.adb");

package Binder is
for Default_Switches ("ada") use ("-E");
end Binder;

package Builder is
for Default_Switches ("ada") use ("-g");
end Builder;

package Compiler is
for Default_Switches ("ada") use ("-g");
end Compiler;

package Linker is
for Default_Switches ("ada") use ("-g");
end Linker;

end Test_CE;
--- test_ce.adb ----------------------------------------
with System.Exception_Traces; use System.Exception_Traces;
with System.Traceback.Symbolic;

procedure Test_CE is
i : Positive;
j : Integer := 1;
begin
Trace_On (System.Exception_Traces.Unhandled_Raise);
Set_Trace_Decorator
( System.Traceback.Symbolic.Symbolic_Traceback'Access
);
i := -j;
end Test_CE;

Notes:

1. You can just use Symbolic_Traceback whenever you want. E.g. you can
set an exception handler and dump traceback at the raising point. It is
slow as hell, of course.

2. There are problems getting symbolic traceback working on ARM.

3. This becomes pretty much useless with relocated libraries. I do not
know how to make it work with them.

4. Under Windows you will not get traceback from non-GCC compiled stuff
because it does not understand *.pdb files.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Extra information in the message string of exceptions.

<t7pour$50r$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8382&group=comp.lang.ada#8382

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Extra information in the message string of exceptions.
Date: Wed, 8 Jun 2022 11:08:44 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t7pour$50r$1@gioia.aioe.org>
References: <t7ktsu$178$1@dont-email.me>
<f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com>
<574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="5147"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Wed, 8 Jun 2022 09:08 UTC

On 2022-06-08 09:31, Jerry wrote:

> But has no effect on this program;
>
> procedure CE_2 is
> i : Positive;
> j : Integer := 1;
> begin
> i := -j;
> end CE_2;

I noticed that it requires a user-defined [sub]type AND nested subprogram:

procedure Test (A : Integer) is
subtype T is Integer range 0 .. 42;
i : T;
begin
i := A; -- This will work
end;
begin
Test (-1);

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: Extra information in the message string of exceptions.

<80571cfa-d4d0-4ea3-8587-8b9dbc5f8725n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8383&group=comp.lang.ada#8383

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:248f:b0:6a6:ee8e:712e with SMTP id i15-20020a05620a248f00b006a6ee8e712emr7121400qkn.690.1654742357320;
Wed, 08 Jun 2022 19:39:17 -0700 (PDT)
X-Received: by 2002:a25:6744:0:b0:65d:46d6:d9a0 with SMTP id
b65-20020a256744000000b0065d46d6d9a0mr37925564ybc.467.1654742357141; Wed, 08
Jun 2022 19:39:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 8 Jun 2022 19:39:16 -0700 (PDT)
In-Reply-To: <t7pl69$f57$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=174.26.236.234; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 174.26.236.234
References: <t7ktsu$178$1@dont-email.me> <f22b1f5b-e436-412e-94ba-8cb177764a31n@googlegroups.com>
<3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com> <574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com>
<t7pl69$f57$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <80571cfa-d4d0-4ea3-8587-8b9dbc5f8725n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: list_email@icloud.com (Jerry)
Injection-Date: Thu, 09 Jun 2022 02:39:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jerry - Thu, 9 Jun 2022 02:39 UTC

On Wednesday, June 8, 2022 at 1:04:32 AM UTC-7, Dmitry A. Kazakov wrote:
> On 2022-06-08 09:31, Jerry wrote:
> > On Tuesday, June 7, 2022 at 8:56:00 AM UTC-7, Fabien Chouteau wrote:
> >> On Monday, June 6, 2022 at 3:40:38 PM UTC+2, Fabien Chouteau wrote:
> >>> But this feature could be activated with a switch only when needed.
> >> Well, it turns our this is already implemented in GNAT ^^
> >>
> >> Example here: https://godbolt.org/z/fcTEaq3xP
> > Indeed. The switch is -GNATeE. It provides additional information for the program at that page,
> >
> > procedure Main is
> > procedure Test (A : Integer) is
> > type T is range 0 .. 42;
> > begin
> > Ada.Text_IO.Put_Line (T (A)'Img);
> > end;
> > begin
> > Test (-1);
> > end Main;
> >
> > But has no effect on this program;
> >
> > procedure CE_2 is
> > i : Positive;
> > j : Integer := 1;
> > begin
> > i := -j;
> > end CE_2;
> The switches are -E for binder and -g for everything else. Try this:
>
> --- test_ce.gpr ----------------------------------------
> project Test_CE is
> for Source_Files use ("test_ce.adb");
> for Main use ("test_ce.adb");
>
> package Binder is
> for Default_Switches ("ada") use ("-E");
> end Binder;
>
> package Builder is
> for Default_Switches ("ada") use ("-g");
> end Builder;
>
> package Compiler is
> for Default_Switches ("ada") use ("-g");
> end Compiler;
>
> package Linker is
> for Default_Switches ("ada") use ("-g");
> end Linker;
>
> end Test_CE;
> --- test_ce.adb ----------------------------------------
> with System.Exception_Traces; use System.Exception_Traces;
> with System.Traceback.Symbolic;
>
> procedure Test_CE is
> i : Positive;
> j : Integer := 1;
> begin
> Trace_On (System.Exception_Traces.Unhandled_Raise);
> Set_Trace_Decorator
> ( System.Traceback.Symbolic.Symbolic_Traceback'Access
> );
> i := -j;
> end Test_CE;
>
> Notes:
>
> 1. You can just use Symbolic_Traceback whenever you want. E.g. you can
> set an exception handler and dump traceback at the raising point. It is
> slow as hell, of course.
>
> 2. There are problems getting symbolic traceback working on ARM.
>
> 3. This becomes pretty much useless with relocated libraries. I do not
> know how to make it work with them.
>
> 4. Under Windows you will not get traceback from non-GCC compiled stuff
> because it does not understand *.pdb files.
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
Hmm.... I get the same "Message" i.e. no extra information and only hex traceback info. Docs say -E is the same as -Ea meaning hex traceback, plus my set-up rejects -Ea (and -Es) as illegal switches. (Not sure at this point if we're chasing symbolic traceback or extra compiler information.)

Re: Extra information in the message string of exceptions.

<b1bf3975-0029-4fd2-acc5-0652574108a5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8384&group=comp.lang.ada#8384

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:621:b0:432:5e0d:cb64 with SMTP id a1-20020a056214062100b004325e0dcb64mr84587355qvx.65.1654762890237;
Thu, 09 Jun 2022 01:21:30 -0700 (PDT)
X-Received: by 2002:a25:c711:0:b0:65c:9f45:64e5 with SMTP id
w17-20020a25c711000000b0065c9f4564e5mr37654822ybe.189.1654762890062; Thu, 09
Jun 2022 01:21:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 9 Jun 2022 01:21:29 -0700 (PDT)
In-Reply-To: <t7ktsu$178$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <t7ktsu$178$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b1bf3975-0029-4fd2-acc5-0652574108a5n@googlegroups.com>
Subject: Re: Extra information in the message string of exceptions.
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Thu, 09 Jun 2022 08:21:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1941
 by: Robin Vowels - Thu, 9 Jun 2022 08:21 UTC

On Monday, June 6, 2022 at 11:02:25 PM UTC+10, roda...@gmail.com wrote:
> Hi all,
>
> Any thoughts on pro's/con's of having the Ada standard packages
> runtime provide extra information in the message string of exceptions ?
>
> For instance, a Constraint_Error message might provide details on
> the variable name, the legal range and the erroneous value which caused
> the exception.
..
PL/I provides a description of an error, e.g. mentioning the condition
that has been raised, e.g., SUBSCRIPTRANGE, ZERODIVIDE.
The user can then take control and print the value of a variable or values of any
group of variables. E.g., for a SUBSCRIPTRANGE error, the user can also print the
upper and lower bounds of the array, though this is usually not done,
it being sufficient to print the name of the variable(s) and value(s).


devel / comp.lang.ada / Extra information in the message string of exceptions.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor