comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <list_email@icloud.com>
Subject: Re: Extra information in the message string of exceptions.
Date: Wed, 8 Jun 2022 19:39:16 -0700 (PDT)	[thread overview]
Message-ID: <80571cfa-d4d0-4ea3-8587-8b9dbc5f8725n@googlegroups.com> (raw)
In-Reply-To: <t7pl69$f57$1@gioia.aioe.org>

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.)

  reply	other threads:[~2022-06-09  2:39 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 [this message]
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
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