comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: confusing string error
Date: Sat, 15 Feb 2014 18:29:29 +0000
Date: 2014-02-15T18:29:29+00:00	[thread overview]
Message-ID: <lyr4742prq.fsf@pushface.org> (raw)
In-Reply-To: 6b15a672-d9af-4580-88b9-435b90789d47@googlegroups.com

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);


  reply	other threads:[~2014-02-15 18:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 12:38 confusing string error agent
2014-02-14 13:03 ` Jacob Sparre Andersen
2014-02-15  0:46   ` agent
2014-02-15  1:50     ` adambeneschan
2014-02-15  8:41       ` Simon Wright
2014-02-15  1:57     ` adambeneschan
2014-02-15  9:33     ` Simon Wright
2014-02-15 12:53       ` agent
2014-02-15 16:58         ` adambeneschan
2014-02-15 18:29           ` Simon Wright [this message]
2014-02-17 12:57             ` agent
2014-02-15 13:15       ` agent
2014-02-15 17:56         ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox