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.129.40.198 with SMTP id o189mr35978810ywo.51.1469807863846; Fri, 29 Jul 2016 08:57:43 -0700 (PDT) X-Received: by 10.157.16.85 with SMTP id o21mr2766169oto.0.1469807863805; Fri, 29 Jul 2016 08:57:43 -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!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!c52no5756718qte.1!news-out.google.com!d68ni10612ith.0!nntp.google.com!f6no5743410ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 29 Jul 2016 08:57:43 -0700 (PDT) In-Reply-To: <1114393d-a298-4b49-bae8-43ded7879887@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.164.26.95; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 67.164.26.95 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Exception traceback when using TDM-GCC 5.1.0-3 From: Anh Vo Injection-Date: Fri, 29 Jul 2016 15:57:43 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 6842 X-Received-Body-CRC: 3026696543 Xref: news.eternal-september.org comp.lang.ada:31221 Date: 2016-07-29T08:57:43-07:00 List-Id: 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 wr= ote: > > > 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...@gmai= l.com wrote: > > > > > > > =20 > > > > > > > The exception is captured captured and handled in the excepti= on handler. In addition, the traceback information is extracted as shown be= low. > > > > > > >=20 > > > > > > > --... > > > > > > > exception=20 > > > > > > > when Error : others =3D> =20 > > > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback(Err= or)); > > > > > > > --... > > > > > >=20 > > > > > > Dear Anh, > > > > > >=20 > > > > > > Yes this is how I catch exceptions and display them symbolicall= y. > > > > > > My current problem is that although I get some kind of tracebac= k, 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 t= hat 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 g= et 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_Informa= tion(Error)); > > > > > Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback(Error)= ); > > > > > end Ce;=20 > > > > >=20 > > > > > AV > > > >=20 > > > > Sorry, what I meant was "Try Simon's code with my modification show= n below to see if you get complete traceback. By the way, it worked on my P= C." > > >=20 > > > Dear Anh, > > >=20 > > > 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. > > =20 > > I share your frustration since I was in a similar situation before. Thu= s, I have a suggestion. Use a PC having no GNAT nor TDM-GCC installed befor= e. 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, unin= stall 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 sur= prise I now get a traceback when I use gnatmake that when fed to Addr2line = 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.Trace= back.Symbolic.Symbolic_Traceback(Error) > merely produces eight lines of output - each line with the hexadecimal tr= aceback 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 0x7= 5883388 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] Anh Vo