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: border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: confusing string error Date: Sat, 15 Feb 2014 18:29:29 +0000 Organization: A noiseless patient Spider Message-ID: References: <87ha81u9r7.fsf@adaheads.sparre-andersen.dk> <3kdtf9l42gimm37vgia3eibsmr638r27ig@4ax.com> <8eouf9logko4l4ee6806hlufrjosbl9h3s@4ax.com> <6b15a672-d9af-4580-88b9-435b90789d47@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="f3a204fd0da52c1307d65ca023946f38"; logging-data="1052"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eBpS6sA9BjMkoOLIKx/YVjkJpX7F+E5s=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:+XeSwAL38ItB2npD0ZZZUL78/zI= sha1:+sWJ39ZsAZSsATi8jgWHliG98CY= Xref: number.nntp.dca.giganews.com comp.lang.ada:184882 Date: 2014-02-15T18:29:29+00:00 List-Id: adambeneschan@gmail.com writes: > On Saturday, February 15, 2014 4:53:42 AM UTC-8, ag...@drrob1.com wrote: >> On Sat, 15 Feb 2014 09:33:25 +0000, Simon Wright wrote: > >> I guess this is a case of the error code does not match the error. I >> kept getting an error message about the character appending line. >> >> I tried GDB and stepped through, and seemed to get the same error. > > Sometimes the Put_Line debugger does a better job than other debuggers. > > >> I still don't understand why stepping line by line did not show me the >> correct failure point. > > I don't have a way to tell. (I found out what line it was because I > tried it using Irvine Compiler's debugger, which did tell me what the > correct line was.) There are some possible reasons that I can think > of why incorrect lines might show up (based on my general experience, > not on any particular knowledge of GNAT/GDB). The source files could > just be out of sync; e.g. you edited a file to add some comments but > didn't recompile it, or you linked using an object file from the wrong > place. If your source was in one large file, and GNATCHOP was called > on to split it up, the line may refer to the larger file rather than > the split-up one or vice versa. Finally, optimization can cause > problems when the compiler rearranges code; it can be very difficult > to get it to display correct line numbers. Plus we can't rule out a > compiler bug. GNAT/GDB finds it correctly for me; (gdb) catch exception Catchpoint 1: all Ada exceptions (gdb) run Starting program: /Users/simon/tmp/testtokenizea Input line : 1+ Number of characters read is 2. Value of s'last is 2561, token.state = DGT, sum= 1, DELIMCH= +, DELIMSTATE= OP Catchpoint 1, ADA.STRINGS.INDEX_ERROR at 0x0000000100001cdb in tokenizea__getopcode (token=...) at tokenizea.adb:121 121 CH2 := Element(Token.UStr,2);