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.182.16.163 with SMTP id h3mr61705845obd.14.1435255983762; Thu, 25 Jun 2015 11:13:03 -0700 (PDT) X-Received: by 10.140.99.44 with SMTP id p41mr101877qge.3.1435255983732; Thu, 25 Jun 2015 11:13:03 -0700 (PDT) Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!h15no8554149igd.0!news-out.google.com!k20ni3271qgd.0!nntp.google.com!q107no3303797qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 25 Jun 2015 11:13:03 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.99.95.58; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 83.99.95.58 References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> <17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com> <86y4jaqzdx.fsf@stephe-leake.org> <01ac6d30-fa93-4868-aa31-3dbec93e9a21@googlegroups.com> <9b539536-f385-434d-ad0c-a48e8877e23b@googlegroups.com> <99d819fa-148e-4e20-b7e1-c509b16ca093@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <933648a0-881e-4569-87e7-9d03d3b52998@googlegroups.com> Subject: Re: What do you think about this? From: Laurent Injection-Date: Thu, 25 Jun 2015 18:13:03 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:193783 Date: 2015-06-25T11:13:03-07:00 List-Id: On Thursday, 25 June 2015 09:29:45 UTC+2, Simon Wright wrote: >=20 > > Houston we have a problem: Exception name: SYSTEM.ASSERTIONS.ASSERT_FAI= LURE > > Message: failed precondition from common_defs_bci.ads:19 > > Load address: 0x1070dc000 > > Call stack traceback locations: > > 0x107111931 0x1070e35f1 0x1070ddf8c 0x1070de763 0x1070de147 0x1070df063 > > > > 0x0000000107111931 > > 0x00000001070E35F1 > > 0x00000001070DDF8C > > 0x00000001070DE763 > > 0x00000001070DE147 > > 0x00000001070DF063 > > > > I can interpret the 3 first lines. For the rest I will ask my cat(s). >=20 > GNAT.Traceback.Symbolic isn't useful on Mac OS X; all it does is report > the absolute addresses of the stack trace without interpretation. The > fact it does so on multiple lines addes to the inconvenience. >=20 > My little example (written for another purpose) is: >=20 > with Ada.Exceptions; > with Ada.Text_IO; use Ada.Text_IO; > procedure Raiser is > begin > begin > raise Constraint_Error; > exception > when E : Constraint_Error =3D> > Put_Line ("CE raised."); > Put_Line (Ada.Exceptions.Exception_Information (E)); > raise; > end; > end Raiser; >=20 > and when I run it I get (GNAT GPL 201[4,5], FSF GCC) >=20 > $ ./raiser=20 > CE raised. > Exception name: CONSTRAINT_ERROR > Message: raiser.adb:6 explicit raise > Load address: 0x101819000 > Call stack traceback locations: > 0x10181a987 0x10181a925 >=20 >=20 > Execution terminated by unhandled exception > Exception name: CONSTRAINT_ERROR > Message: raiser.adb:6 explicit raise > Load address: 0x101819000 > Call stack traceback locations: > 0x10181a987 0x10181a925 >=20 > The first set of messages is from Exception_Information, the last > because of dropping out of the main program. >=20 > The linker, by default, generates position-independent executables > (protection against viruses); the Load address line is where we happened > to get loaded this time. >=20 > To decode the stack traceback, use atos >=20 > $ atos -d -o raiser -l 0x101819000 0x10181a987 0x10181a925 > got symbolicator for raiser, base address 100000000 > _ada_raiser (in raiser) (raiser.adb:6) > main (in raiser) (b~raiser.adb:197) >=20 > (run atos without -d to see why it's there!) Hm I checked the man pages for atos on Yosemite. No -d option. The whole th= ing is just providing some clues where to look for the error. In my case I = have assigned a string which is longer than max length. I know where to fin= d the error because it was intentional. But if not and the program is much = larger, well good luck then to find it.