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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782 Date: Mon, 15 Jan 2018 18:48:03 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <4ff1db1f-cf2e-4683-9882-da9a907d07b0@googlegroups.com> NNTP-Posting-Host: f8WEMHpTPFsoaovNG/8BOQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: reader02.eternal-september.org comp.lang.ada:49924 Date: 2018-01-15T18:48:03+01:00 List-Id: On 2018-01-15 18:22, Anh Vo wrote: > On Monday, January 15, 2018 at 12:29:41 AM UTC-8, Dmitry A. Kazakov wrote: >> On 15/01/2018 02:18, Mehdi Saada wrote: >>> This if statement exactly, seems to raise >>> "ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782"(No indication of line, so I can't know more). >> >> There is a list of funny numbers following the exception message. Pass >> that list to >> >> addr2line --exe= >> >> That will give you the stack trace. > > It is even better to use GNAT addition to print out full stack trace as shown in the snippet. > > -- ... > > exception > > when Err : others => > > Text_Io.Put_Line ("Houston we have a problem: " & > Exceptions.Exception_Information (Err)); > Text_Io.Put_Line ("Traceback => " & GNAT.Traceback.Symbolic.Symbolic_Traceback(Err)); > end [Ada Unit Name]; Even better to make AdaCore make this the default behavior when dealing with unhandled exception. However considering that it took 20 years or so to stop disabling integer overflow checks by default... P.S. When GPS is running with the switch --server= one can make it open the window with the source code at the error line! (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de