From: Jerry <list_email@icloud.com>
Subject: Re: Extra information in the message string of exceptions.
Date: Mon, 31 Oct 2022 17:05:04 -0700 (PDT) [thread overview]
Message-ID: <73e78776-5522-4f4f-b9da-a920d5174b17n@googlegroups.com> (raw)
In-Reply-To: <371ba8ca-2304-4e8a-a77f-82548d706105n@googlegroups.com>
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 wrote:
> > On 8/6/22 19:08, Dmitry A. Kazakov wrote:
> > > 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);
> > >
> > Are you sure about this ?
> >
> > I tried ...
> >
> >
> > procedure Example
> > is
> > X : Positive := 5;
> > begin
> > loop
> > X := X - 1;
> > end loop;
> > end Example;
> >
> >
> > ... with the -gnateE and saw this result ...
> >
> >
> > [rod@orth example]$ ./example
> >
> > raised CONSTRAINT_ERROR : example.adb:6:14 range check failed
> > value 0 not in 1..2147483647
> > [./example]
> > 0x55916975377f Example at example.adb:6
> > 0x559169753b74 Main at b__example.adb:193
> > [/usr/lib/libc.so.6]
> > 0x7f9230be728e
> > 0x7f9230be7348
> > [./example]
> > 0x559169753623 _start at start.S:115
> > 0xfffffffffffffffe
> So -gnateE works part of the time?
> 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 illegal on macOS
From the docs at https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gnat_ugn_unw/Symbolic-Traceback.html#Symbolic-Traceback:
"Note that this feature is not supported on all platforms. See GNAT.Traceback.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 eventually 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 with -no_pie. That is, in my gpr, I have this:
package Linker is
for Default_Switches ("Ada") use ("-Wl,-no_pie");
end Linker;
next prev parent reply other threads:[~2022-11-01 0:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 12:59 Extra information in the message string of exceptions Rod Kay
2022-06-06 13:40 ` Fabien Chouteau
2022-06-06 18:40 ` G.B.
2022-06-06 19:24 ` Dmitry A. Kazakov
2022-06-07 11:26 ` Rod Kay
2022-06-07 15:55 ` Fabien Chouteau
2022-06-07 16:41 ` Anh Vo
2022-06-08 7:31 ` Jerry
2022-06-08 8:04 ` Dmitry A. Kazakov
2022-06-09 2:39 ` Jerry
2022-06-08 9:08 ` Dmitry A. Kazakov
2022-10-27 11:56 ` Rod Kay
2022-10-29 0:35 ` Jerry
2022-10-29 3:10 ` Rod Kay
2022-10-29 6:30 ` Gautier write-only address
2022-10-29 8:59 ` G.B.
2022-11-01 0:05 ` Jerry [this message]
2022-06-06 14:31 ` Gautier write-only address
2022-06-07 2:33 ` Randy Brukardt
2022-06-07 11:47 ` Rod Kay
2022-06-07 11:29 ` Rod Kay
2022-06-06 20:14 ` Luke A. Guest
2022-06-07 11:51 ` Rod Kay
2022-06-07 21:06 ` Luke A. Guest
2022-06-06 20:49 ` DrPi
2022-06-06 23:17 ` Jerry
2022-06-07 1:53 ` Gautier write-only address
2022-06-07 2:35 ` Randy Brukardt
2022-06-07 8:07 ` Simon Wright
2022-06-08 7:14 ` Jerry
2022-06-09 8:21 ` Robin Vowels
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox