From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.176.4.106 with SMTP id 97mr38429858uav.14.1469866293598; Sat, 30 Jul 2016 01:11:33 -0700 (PDT) X-Received: by 10.157.32.22 with SMTP id n22mr2982868ota.2.1469866293498; Sat, 30 Jul 2016 01:11:33 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!j37no5603631qta.0!news-out.google.com!d130ni19065ith.0!nntp.google.com!f6no5912140ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 30 Jul 2016 01:11:33 -0700 (PDT) In-Reply-To: <92ae9e23-f254-41af-be05-d77c96754dd4@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1205:c68c:9d90:5cf8:1b94:6d63:c0a0; posting-account=Pm0FhgoAAAAiPscNT3etSZ15tHNZGXm_ NNTP-Posting-Host: 2a02:1205:c68c:9d90:5cf8:1b94:6d63:c0a0 References: <3e02dbb0-69e3-429b-b8c5-d4762dbeb187@googlegroups.com> <66240de6-d3a8-458d-9eb9-1214f790831c@googlegroups.com> <22f2e37f-dc90-42ce-a6d3-42f0a471c4d6@googlegroups.com> <6178bf6c-6125-43b2-86c4-aeb08be48442@googlegroups.com> <273d77a5-55a6-4de6-abbe-93bb61ecfdc3@googlegroups.com> <4bd0a4ff-8262-41ee-bb5c-23672206a59a@googlegroups.com> <8a97f7ff-7fda-480b-9f6e-68a4f2995b83@googlegroups.com> <26fc8fd2-f81b-45f6-a584-e8558239eae0@googlegroups.com> <1114393d-a298-4b49-bae8-43ded7879887@googlegroups.com> <92ae9e23-f254-41af-be05-d77c96754dd4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Exception traceback when using TDM-GCC 5.1.0-3 From: ahlan.marriott@gmail.com Injection-Date: Sat, 30 Jul 2016 08:11:33 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31225 Date: 2016-07-30T01:11:33-07:00 List-Id: 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 wr= ote: > > > 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.co= m 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: > > > > > > > > > =20 > > > > > > > > > The exception is captured captured and handled in the exc= eption handler. In addition, the traceback information is extracted as show= n below. > > > > > > > > >=20 > > > > > > > > > --... > > > > > > > > > exception=20 > > > > > > > > > when Error : others =3D> =20 > > > > > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback= (Error)); > > > > > > > > > --... > > > > > > > >=20 > > > > > > > > Dear Anh, > > > > > > > >=20 > > > > > > > > Yes this is how I catch exceptions and display them symboli= cally. > > > > > > > > My current problem is that although I get some kind of trac= eback, 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 norm= al that these > > > > > > > > cannot be resolved symbolically - hence they are displayed = as "??" by both > > > > > > > > Gnat.Traceback.Symbolic.Symbolic_Traceback and addr2line > > > > > > >=20 > > > > > > > Try Simon's code with my modification shown below to see what= I get complete traceback. By the way, it work on my PC. > > > > > > >=20 > > > > > > > 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 =3D> > > > > > > > Put_Line ("Houston we have a problem: " & Exception_Inf= ormation(Error)); > > > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback(Er= ror)); > > > > > > > end Ce;=20 > > > > > > >=20 > > > > > > > AV > > > > > >=20 > > > > > > 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." > > > > >=20 > > > > > Dear Anh, > > > > >=20 > > > > > Yes I appreciate that.. > > > > > This is what I always try to do - and it works with GPL but not w= ith TDM. > > > > > But then nor does Addr2line so something is not quite right. > > > > =20 > > > > 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 b= efore. Install TDM-GCC and try it one more time. By the way, use command li= ne "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. > > > >=20 > > > > Anh Vo > > >=20 > > > 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 Addr2l= ine returns the traceback that Simon has.=20 > > > i.e. Address within CE.adb > > > At least this is useful. > > > However trying to convert this into a symbolic traceback using GNAT.T= raceback.Symbolic.Symbolic_Traceback(Error) > > > merely produces eight lines of output - each line with the hexadecima= l traceback address. > > > i.e. GNAT.Traceback.Symbolic.Symbolic_Traceback isn't working. > > > Does it work for you? > >=20 > > Yes, it does work as expected. Here are the results I got. > >=20 > > 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 > >=20 > > [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 > >=20 > > [C:\Windows\syswow64\kernel32.dll] > > [C:\Windows\SysWOW64\ntdll.dll] > =20 > MIG, >=20 > My apology for crewing up. The gnatmake I invoked was part of GNAT-GPL. A= fter correcting it on my PC at home, I got same results that you did, 9 Hex= addresses without traceback location. >=20 > Anh Vo Well at least my problem is reproducible by others. I wonder what we are doing wrong? MfG Ahlan