comp.lang.ada
 help / color / mirror / Atom feed
* Re:I'm baffled...
@ 2001-10-30 22:39 ANH_VO
  2001-10-31 10:06 ` I'm baffled Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: ANH_VO @ 2001-10-30 22:39 UTC (permalink / raw)
  To: comp.lang.ada

I am afraid that more codes need to be posted in order for me at least to find
out what is going on. In fact, it is not easy to reproduce the Constraint_Error
without knowing the exact Word_List.

Anh Vo

____________________Reply Separator____________________
Subject:    I'm baffled...
Author: Wes Groleau <wwgrol@sparc01.ftw.rsc.raytheon.com>
Date:       10/30/01 5:16 PM


Probably something simple, but I don't see it ....

I don't think it's a compiler bug because
I get the same error from Apex that I get from GNAT.

But how can I get a constraint_error on line 166
of ada.strings.maps?  That line is:
   Identity : constant Character_Mapping :=

I can't get either debugger to let me examine things
in the run-time.

Code excerpt:

   package ASF renames Ada.Strings.Fixed;
   package AS renames Ada.Strings;

   function Position_Of (Pattern : String) return Index is

      Result : Index := 47;
      -- just to make it any old legal value

      Checkpoint : Character := 'A';

   begin
      Checkpoint := 'B';
      Result := ASF.Index
                (Source  => Word_List (Current_Index + 1 ..
Word_List'Last),
                 Pattern => Pattern,
                 Going   => AS.Forward );
      Checkpoint := 'C';
      
      if Result /= 0 then
      Checkpoint := 'D';
         return Result;
      else
      Checkpoint := 'E';
         return ASF.Index
                (Source  => Word_List ( Word_List'First .. Current_Index
- 1),
                 Pattern => Pattern,
                 Going   => AS.Backward );
      Checkpoint := 'F';
      end if;
      Checkpoint := 'G';

   exception
      when E : others =>
        Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information(E));
        Ada.Text_IO.Put_Line ("Checkpoint    => " & Checkpoint);
        Ada.Text_IO.Put_Line ("Context       => " & Word_List
(Current_Index - 10 .. Current_Index + 10) );
        Ada.Text_IO.Put_Line ("Pattern       => " & Pattern);
        Ada.Text_IO.Put_Line ("Current_Index => " & Integer'Image
(Current_Index));
        Ada.Text_IO.Put_Line ("Result        => " & Integer'Image
(Result));

      raise;

   end Position_Of;

Typical error output:

Exception name: CONSTRAINT_ERROR
Message: a-strmap.ads:166

Checkpoint    => B
Context       => addenda addendum adhe
Pattern       =>  pri
Current_Index =>  117947
Result        =>  47

(Word_List is a BIG string)

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau
_______________________________________________



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I'm baffled...
  2001-10-30 22:39 Re:I'm baffled ANH_VO
@ 2001-10-31 10:06 ` Robert Dewar
  2001-10-31 10:08 ` Robert Dewar
  2001-10-31 16:13 ` Wes Groleau
  2 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2001-10-31 10:06 UTC (permalink / raw)


ANH_VO@udlp.com wrote in message news:<mailman.1004489444.3618.comp.lang.ada@ada.eu.org>...
> I am afraid that more codes need to be posted in order for me at least to find
> out what is going on. In fact, it is not easy to reproduce the Constraint_Error
> without knowing the exact Word_List.
> 
> Anh Vo

Fair enough, a reasonable reply, but you then posted the
ENTIRE original message. Please don't do this, it generates
piles of junk in the archives, and is entirely unnecessary.
I post this because I notice lots of other people making
this elementary error. In a newsgroup, you really need very
little context to establish what you are replying to, given
that messages are all tracked, and indeed most people are
using threaded readers of some kind. Just give a bare minimum of
context so that people know what you are replying to. Some newsreaders
actually prevent you from
posting messages of this kind (e.g. allowing no more quote
lines than message lines). That's a bit draconian, and any
arbitrary rule can be annoying, but as a general principle
that's an excellent limit to respect.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I'm baffled...
  2001-10-30 22:39 Re:I'm baffled ANH_VO
  2001-10-31 10:06 ` I'm baffled Robert Dewar
@ 2001-10-31 10:08 ` Robert Dewar
  2001-10-31 16:13 ` Wes Groleau
  2 siblings, 0 replies; 5+ messages in thread
From: Robert Dewar @ 2001-10-31 10:08 UTC (permalink / raw)


ANH_VO@udlp.com wrote in message news:<mailman.1004489444.3618.comp.lang.ada@ada.eu.org>...

> I can't get either debugger to let me examine things
> in the run-time.

It is perfectly possible with GNAT to examine runtime
data, of course the runtime must be compiled with debugging
information (consult GNAT documentation on how) (or send
message to report for further help)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:I'm baffled...
@ 2001-10-31 13:30 ANH_VO
  0 siblings, 0 replies; 5+ messages in thread
From: ANH_VO @ 2001-10-31 13:30 UTC (permalink / raw)
  To: comp.lang.ada

On second thought, I could duplicate the problem providing one confirmation. Is
Index type, returned by function Position_Of, look like? It must NOT be Natural.

A. Vo

I am afraid that more codes need to be posted in order for me at least to find
out what is going on. In fact, it is not easy to reproduce the Constraint_Error
without knowing the exact Word_List.

Anh Vo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I'm baffled...
  2001-10-30 22:39 Re:I'm baffled ANH_VO
  2001-10-31 10:06 ` I'm baffled Robert Dewar
  2001-10-31 10:08 ` Robert Dewar
@ 2001-10-31 16:13 ` Wes Groleau
  2 siblings, 0 replies; 5+ messages in thread
From: Wes Groleau @ 2001-10-31 16:13 UTC (permalink / raw)




ANH_VO@udlp.com wrote:
> 
> I am afraid that more codes need to be posted in order for me at least to find
> out what is going on. In fact, it is not easy to reproduce the Constraint_Error
> without knowing the exact Word_List.

Word_List is over 100 Kilobytes in length,
which is why I didn't post it.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-31 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-30 22:39 Re:I'm baffled ANH_VO
2001-10-31 10:06 ` I'm baffled Robert Dewar
2001-10-31 10:08 ` Robert Dewar
2001-10-31 16:13 ` Wes Groleau
  -- strict thread matches above, loose matches on Subject: below --
2001-10-31 13:30 baffled ANH_VO

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