From: ahlan.marriott@gmail.com
Subject: Re: Exception traceback when using TDM-GCC 5.1.0-3
Date: Sat, 30 Jul 2016 01:11:33 -0700 (PDT)
Date: 2016-07-30T01:11:33-07:00 [thread overview]
Message-ID: <b78a3dc2-5d44-4d14-833f-b70dc136ea7c@googlegroups.com> (raw)
In-Reply-To: <92ae9e23-f254-41af-be05-d77c96754dd4@googlegroups.com>
On Friday, 29 July 2016 20:48:54 UTC+2, Anh Vo wrote:
> On Friday, July 29, 2016 at 8:57:44 AM UTC-7, Anh Vo wrote:
> > On Thursday, July 28, 2016 at 1:34:12 PM UTC-7, ahlan.m...@gmail.com wrote:
> > > On Thursday, 28 July 2016 18:16:14 UTC+2, Anh Vo wrote:
> > > > On Thursday, July 28, 2016 at 9:00:16 AM UTC-7, ahlan.m...@gmail.com wrote:
> > > > > On Thursday, 28 July 2016 17:44:32 UTC+2, Anh Vo wrote:
> > > > > > On Thursday, July 28, 2016 at 7:48:17 AM UTC-7, Anh Vo wrote:
> > > > > > > On Wednesday, July 27, 2016 at 11:07:02 PM UTC-7, ahlan.m...@gmail.com wrote:
> > > > > > > > >
> > > > > > > > > The exception is captured captured and handled in the exception handler. In addition, the traceback information is extracted as shown below.
> > > > > > > > >
> > > > > > > > > --...
> > > > > > > > > exception
> > > > > > > > > when Error : others =>
> > > > > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback(Error));
> > > > > > > > > --...
> > > > > > > >
> > > > > > > > Dear Anh,
> > > > > > > >
> > > > > > > > Yes this is how I catch exceptions and display them symbolically.
> > > > > > > > My current problem is that although I get some kind of traceback, it isn't complete.
> > > > > > > > I only get two of the expected eight traceback addresses.
> > > > > > > > The two I do get have very high addresses and it seems normal that these
> > > > > > > > cannot be resolved symbolically - hence they are displayed as "??" by both
> > > > > > > > Gnat.Traceback.Symbolic.Symbolic_Traceback and addr2line
> > > > > > >
> > > > > > > Try Simon's code with my modification shown below to see what I get complete traceback. By the way, it work on my PC.
> > > > > > >
> > > > > > > with Ada.Exceptions; use Ada.Exceptions;
> > > > > > > with Ada.Text_Io; use Ada.Text_Io;
> > > > > > > with GNAT.Traceback.Symbolic;
> > > > > > > procedure CE is
> > > > > > > procedure Raiser (N : Positive) is
> > > > > > > begin
> > > > > > > Raiser (N - 1);
> > > > > > > end Raiser;
> > > > > > > begin
> > > > > > > Raiser (5);
> > > > > > > exception
> > > > > > > when Error : others =>
> > > > > > > Put_Line ("Houston we have a problem: " & Exception_Information(Error));
> > > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback(Error));
> > > > > > > end Ce;
> > > > > > >
> > > > > > > AV
> > > > > >
> > > > > > Sorry, what I meant was "Try Simon's code with my modification shown below to see if you get complete traceback. By the way, it worked on my PC."
> > > > >
> > > > > Dear Anh,
> > > > >
> > > > > Yes I appreciate that..
> > > > > This is what I always try to do - and it works with GPL but not with TDM.
> > > > > But then nor does Addr2line so something is not quite right.
> > > >
> > > > I share your frustration since I was in a similar situation before. Thus, I have a suggestion. Use a PC having no GNAT nor TDM-GCC installed before. Install TDM-GCC and try it one more time. By the way, use command line "gnatmake -f -g ce.adb -bargs -E" first. If you do not have another PC, uninstall GNAT-GPL and TDM-GCC completely before reinstall TDM-GCC.
> > > >
> > > > Anh Vo
> > >
> > > Dear Anh,
> > > Although it made no real sense, I did as you suggested and much to my surprise I now get a traceback when I use gnatmake that when fed to Addr2line returns the traceback that Simon has.
> > > i.e. Address within CE.adb
> > > At least this is useful.
> > > However trying to convert this into a symbolic traceback using GNAT.Traceback.Symbolic.Symbolic_Traceback(Error)
> > > merely produces eight lines of output - each line with the hexadecimal traceback address.
> > > i.e. GNAT.Traceback.Symbolic.Symbolic_Traceback isn't working.
> > > Does it work for you?
> >
> > Yes, it does work as expected. Here are the results I got.
> >
> > Houston we have a problem: Exception name: CONSTRAINT_ERROR
> > Message: ce.adb:7 range check failed
> > Call stack traceback locations:
> > 0x40198b 0x40199b 0x40199b 0x40199b 0x40199b 0x4019bb 0x40194f 0x4013db 0x75883388 0x77949900 0x779498d3
> >
> > [C:\Ada\Test\ce.exe]
> > 0x0040198B ce.raiser at ce.adb:7
> > 0x0040199B ce.raiser at ce.adb:7
> > 0x0040199B ce.raiser at ce.adb:7
> > 0x0040199B ce.raiser at ce.adb:7
> > 0x0040199B ce.raiser at ce.adb:7
> > 0x004019BB ce at ce.adb:10
> > 0x0040194F main at b~ce.adb:221
> > 0x004013DB .tmainCRTStartup at crtexe.c:332
> >
> > [C:\Windows\syswow64\kernel32.dll]
> > [C:\Windows\SysWOW64\ntdll.dll]
>
> MIG,
>
> My apology for crewing up. The gnatmake I invoked was part of GNAT-GPL. After correcting it on my PC at home, I got same results that you did, 9 Hex addresses without traceback location.
>
> Anh Vo
Well at least my problem is reproducible by others.
I wonder what we are doing wrong?
MfG
Ahlan
next prev parent reply other threads:[~2016-07-30 8:11 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 16:40 Exception traceback when using TDM-GCC 5.1.0-3 ahlan.marriott
2016-07-20 5:33 ` jrmarino
2016-07-20 6:19 ` ahlan
2016-07-20 6:43 ` Simon Wright
2016-07-20 7:13 ` ahlan
2016-07-20 13:09 ` jrmarino
2016-07-23 16:13 ` Simon Wright
2016-07-24 8:43 ` ahlan.marriott
2016-07-24 9:44 ` Simon Wright
2016-07-24 17:14 ` jrmarino
2016-07-24 18:54 ` ahlan.marriott
2016-07-24 19:46 ` Björn Lundin
2016-07-25 8:45 ` ahlan.marriott
2016-07-25 9:04 ` gautier_niouzes
2016-07-25 18:49 ` ahlan.marriott
2016-07-25 11:34 ` Björn Lundin
2016-07-25 12:05 ` Simon Wright
2016-07-25 14:06 ` Björn Lundin
2016-07-25 18:48 ` ahlan.marriott
2016-07-26 21:20 ` jrmarino
2016-07-27 7:09 ` Markus Schöpflin
2016-07-27 7:35 ` Simon Wright
2016-07-27 10:57 ` ahlan.marriott
2016-07-27 13:22 ` Simon Wright
2016-07-27 14:11 ` ahlan.marriott
2016-07-27 15:45 ` Simon Wright
2016-07-27 19:32 ` Anh Vo
2016-07-27 20:33 ` ahlan.marriott
2016-07-27 21:03 ` Anh Vo
2016-07-28 6:07 ` ahlan.marriott
2016-07-28 6:56 ` ahlan.marriott
2016-07-28 12:26 ` Björn Lundin
2016-07-28 16:07 ` ahlan.marriott
2016-07-28 16:19 ` Björn Lundin
2016-07-28 14:48 ` Anh Vo
2016-07-28 15:44 ` Anh Vo
2016-07-28 16:00 ` ahlan.marriott
2016-07-28 16:16 ` Anh Vo
2016-07-28 20:34 ` ahlan.marriott
2016-07-28 20:55 ` Björn Lundin
2016-07-29 6:40 ` ahlan.marriott
2016-07-29 10:08 ` Björn Lundin
2016-07-30 8:10 ` ahlan.marriott
2016-07-29 7:01 ` Simon Wright
2016-07-29 8:21 ` gautier_niouzes
2016-07-31 8:26 ` ahlan
2016-07-29 15:57 ` Anh Vo
2016-07-29 18:48 ` Anh Vo
2016-07-30 8:11 ` ahlan.marriott [this message]
2016-07-27 10:41 ` ahlan.marriott
2016-07-27 7:18 ` gautier_niouzes
2016-07-27 10:45 ` ahlan.marriott
2016-07-25 7:14 ` Georg Bauhaus
2016-07-20 13:06 ` jrmarino
2016-07-21 3:51 ` gautier_niouzes
2016-07-21 7:24 ` ahlan
2016-07-21 10:33 ` gautier_niouzes
2016-07-21 12:15 ` ahlan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox