From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a0c:9a0d:0:b0:4b1:982e:96d4 with SMTP id p13-20020a0c9a0d000000b004b1982e96d4mr13234738qvd.114.1667261105457; Mon, 31 Oct 2022 17:05:05 -0700 (PDT) X-Received: by 2002:a0c:8e89:0:b0:4bb:62a2:b3cb with SMTP id x9-20020a0c8e89000000b004bb62a2b3cbmr13551861qvb.58.1667261105253; Mon, 31 Oct 2022 17:05:05 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.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: Mon, 31 Oct 2022 17:05:04 -0700 (PDT) In-Reply-To: <371ba8ca-2304-4e8a-a77f-82548d706105n@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=174.26.235.106; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 174.26.235.106 References: <3bc7a99c-d541-497b-b3fd-7a6db0ee0de9n@googlegroups.com> <574017e3-d354-41b9-87a1-1f3aa6edf4a2n@googlegroups.com> <371ba8ca-2304-4e8a-a77f-82548d706105n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <73e78776-5522-4f4f-b9da-a920d5174b17n@googlegroups.com> Subject: Re: Extra information in the message string of exceptions. From: Jerry Injection-Date: Tue, 01 Nov 2022 00:05:05 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4445 Xref: reader01.eternal-september.org comp.lang.ada:64570 List-Id: On Friday, October 28, 2022 at 5:35:20 PM UTC-7, Jerry wrote: > On Thursday, October 27, 2022 at 4:57:08 AM UTC-7, roda...@gmail.com wrot= e:=20 > > On 8/6/22 19:08, Dmitry A. Kazakov wrote:=20 > > > On 2022-06-08 09:31, Jerry wrote:=20 > > >=20 > > >> But has no effect on this program;=20 > > >>=20 > > >> procedure CE_2 is=20 > > >> i : Positive;=20 > > >> j : Integer :=3D 1;=20 > > >> begin=20 > > >> i :=3D -j;=20 > > >> end CE_2;=20 > > >=20 > > > I noticed that it requires a user-defined [sub]type AND nested subpro= gram:=20 > > >=20 > > > procedure Test (A : Integer) is=20 > > > subtype T is Integer range 0 .. 42;=20 > > > i : T;=20 > > > begin=20 > > > i :=3D A; -- This will work=20 > > > end;=20 > > > begin=20 > > > Test (-1);=20 > > >=20 > > Are you sure about this ?=20 > >=20 > > I tried ...=20 > >=20 > >=20 > > procedure Example=20 > > is=20 > > X : Positive :=3D 5;=20 > > begin=20 > > loop=20 > > X :=3D X - 1;=20 > > end loop;=20 > > end Example;=20 > >=20 > >=20 > > ... with the -gnateE and saw this result ...=20 > >=20 > >=20 > > [rod@orth example]$ ./example=20 > >=20 > > raised CONSTRAINT_ERROR : example.adb:6:14 range check failed=20 > > value 0 not in 1..2147483647=20 > > [./example]=20 > > 0x55916975377f Example at example.adb:6=20 > > 0x559169753b74 Main at b__example.adb:193=20 > > [/usr/lib/libc.so.6]=20 > > 0x7f9230be728e=20 > > 0x7f9230be7348=20 > > [./example]=20 > > 0x559169753623 _start at start.S:115=20 > > 0xfffffffffffffffe > So -gnateE works part of the time?=20 > Jerry I simply do not get the robust results others are reporting, and as I noted= earlier in this thread, some of the suggested switches are flagged as ille= gal on macOS >From the docs at https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gnat_ugn_unw/Symb= olic-Traceback.html#Symbolic-Traceback: "Note that this feature is not supported on all platforms. See GNAT.Traceba= ck.Symbolic spec in g-trasym.ads for a complete list of currently supported= platforms." I'm using an older version of GNAT (2017) on Mac and the list of supported = platforms is actually in s-trasym.ads and reads as such: -- The full capability is currently supported on the following targets: -- HP-UX ia64 -- GNU/Linux x86, x86_64, ia64 -- FreeBSD x86, x86_64 -- Solaris sparc and x86 -- Windows Maybe newer versions of GNAT are more Mac-friendly. So in order to get both= extra information and symbolic tracebacks I've had to write my own garbage= -y handler that redirects text output to a file, calls system stuff such as= tail and atos, bla bla bla. I hope atos is still supported when I eventual= ly move to ARM. atos I think is Apple's thing that works like addr2line. BTW, for others attempting this on macOS, turn of address randomization wit= h -no_pie. That is, in my gpr, I have this: package Linker is for Default_Switches ("Ada") use ("-Wl,-no_pie");=20 end Linker;