comp.lang.ada
 help / color / mirror / Atom feed
* gnat compiler hanging
@ 2017-08-24 22:16 Stephen Leake
  2017-08-24 22:36 ` Stephen Leake
  2017-08-26 21:03 ` Lucretia
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Leake @ 2017-08-24 22:16 UTC (permalink / raw)


I've got a file, which is probably bad Ada, that causes the gnat compiler to hang (or at least, take _much_ longer than normal for this file).

I vaguely recall there is an option -gnatd<something> that causes the compiler to output error messages as soon as they are discovered, rather than keeping them internal and outputing them all at the end.

But the GNAT user guide just says "see debug.adb" for the definition of '-gnatd', and I don't have the gnat sources installed.

Does anyone know what option I'm looking for?

-- Stephe

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

* Re: gnat compiler hanging
  2017-08-24 22:16 gnat compiler hanging Stephen Leake
@ 2017-08-24 22:36 ` Stephen Leake
  2017-08-25  8:18   ` Simon Wright
  2017-08-26 21:03 ` Lucretia
  1 sibling, 1 reply; 7+ messages in thread
From: Stephen Leake @ 2017-08-24 22:36 UTC (permalink / raw)


On Thursday, August 24, 2017 at 5:16:10 PM UTC-5, Stephen Leake wrote:
> I've got a file, which is probably bad Ada, that causes the gnat compiler to hang (or at least, take _much_ longer than normal for this file).
> 
> I vaguely recall there is an option -gnatd<something> that causes the compiler to output error messages as soon as they are discovered, rather than keeping them internal and outputing them all at the end.
> 
> But the GNAT user guide just says "see debug.adb" for the definition of '-gnatd', and I don't have the gnat sources installed.
> 
> Does anyone know what option I'm looking for?
> 
> -- Stephe

I found the problem, and a workaround:

--  WORKAROUND: GNAT GPL 2016 compiler hangs on this:
--  for Pattern of Table.McKenzie.Patterns loop
--     Indent_Line ("Table.Mckenzie.patterns.Append (" & Pattern.Image & ");");
--  end loop;
declare
   use WisiToken.Parser.LR.Patterns;
   I : Cursor := Table.McKenzie.Patterns.First;
begin
   loop
      exit when I = No_Element;
      Indent_Line 
        ("Table.Mckenzie.patterns.Append (" & Element (I).Image & ");");
      Next (I);
   end loop;
end;

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

* Re: gnat compiler hanging
  2017-08-24 22:36 ` Stephen Leake
@ 2017-08-25  8:18   ` Simon Wright
  2017-08-26  7:40     ` Stephen Leake
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Wright @ 2017-08-25  8:18 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> On Thursday, August 24, 2017 at 5:16:10 PM UTC-5, Stephen Leake wrote:
>> I've got a file, which is probably bad Ada, that causes the gnat
>> compiler to hang (or at least, take _much_ longer than normal for
>> this file).
[...]
>
> I found the problem, and a workaround:
>
> --  WORKAROUND: GNAT GPL 2016 compiler hangs on this:
> --  for Pattern of Table.McKenzie.Patterns loop
> --     Indent_Line ("Table.Mckenzie.patterns.Append (" & Pattern.Image & ");");
> --  end loop;
> declare
>    use WisiToken.Parser.LR.Patterns;
>    I : Cursor := Table.McKenzie.Patterns.First;
> begin
>    loop
>       exit when I = No_Element;
>       Indent_Line 
>         ("Table.Mckenzie.patterns.Append (" & Element (I).Image & ");");
>       Next (I);
>    end loop;
> end;

Could you have used the generalized iterator?

   for I in Table.McKenzie.Patterns.Iterate loop
      Indent_Line 
        ("Table.Mckenzie.patterns.Append ("
         & Table.Mckenzie.patterns.Element (I).Image
         & ");");
   end loop;

(not syntax-checked, of course)


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

* Re: gnat compiler hanging
  2017-08-25  8:18   ` Simon Wright
@ 2017-08-26  7:40     ` Stephen Leake
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Leake @ 2017-08-26  7:40 UTC (permalink / raw)


On Friday, August 25, 2017 at 3:18:20 AM UTC-5, Simon Wright wrote:
> Stephen Leake <stephen_leake@stephe-leake.org> writes:
> 
> > On Thursday, August 24, 2017 at 5:16:10 PM UTC-5, Stephen Leake wrote:
> >> I've got a file, which is probably bad Ada, that causes the gnat
> >> compiler to hang (or at least, take _much_ longer than normal for
> >> this file).
> [...]
> >
> > I found the problem, and a workaround:
> >
> > --  WORKAROUND: GNAT GPL 2016 compiler hangs on this:
> > --  for Pattern of Table.McKenzie.Patterns loop
> > --     Indent_Line ("Table.Mckenzie.patterns.Append (" & Pattern.Image & ");");
> > --  end loop;
> > declare
> >    use WisiToken.Parser.LR.Patterns;
> >    I : Cursor := Table.McKenzie.Patterns.First;
> > begin
> >    loop
> >       exit when I = No_Element;
> >       Indent_Line 
> >         ("Table.Mckenzie.patterns.Append (" & Element (I).Image & ");");
> >       Next (I);
> >    end loop;
> > end;
> 
> Could you have used the generalized iterator?
> 
>    for I in Table.McKenzie.Patterns.Iterate loop
>       Indent_Line 
>         ("Table.Mckenzie.patterns.Append ("
>          & Table.Mckenzie.patterns.Element (I).Image
>          & ");");
>    end loop;
> 
> (not syntax-checked, of course)

That gave the same symptom.


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

* Re: gnat compiler hanging
  2017-08-24 22:16 gnat compiler hanging Stephen Leake
  2017-08-24 22:36 ` Stephen Leake
@ 2017-08-26 21:03 ` Lucretia
  2017-08-27  1:49   ` Anh Vo
  1 sibling, 1 reply; 7+ messages in thread
From: Lucretia @ 2017-08-26 21:03 UTC (permalink / raw)


On Thursday, 24 August 2017 23:16:10 UTC+1, Stephen Leake  wrote:
> I've got a file, which is probably bad Ada, that causes the gnat compiler to hang (or at least, take _much_ longer than normal for this file).
> 

Which version of GCC/GNAT is this?

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

* Re: gnat compiler hanging
  2017-08-26 21:03 ` Lucretia
@ 2017-08-27  1:49   ` Anh Vo
  2017-08-27  5:44     ` Stephen Leake
  0 siblings, 1 reply; 7+ messages in thread
From: Anh Vo @ 2017-08-27  1:49 UTC (permalink / raw)


On Saturday, August 26, 2017 at 2:03:19 PM UTC-7, Lucretia wrote:
> On Thursday, 24 August 2017 23:16:10 UTC+1, Stephen Leake  wrote:
> > I've got a file, which is probably bad Ada, that causes the gnat compiler to hang (or at least, take _much_ longer than normal for this file).
> > 
> 
> Which version of GCC/GNAT is this?

I believe GNAT GPL 2016 as shown in the first line comment.


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

* Re: gnat compiler hanging
  2017-08-27  1:49   ` Anh Vo
@ 2017-08-27  5:44     ` Stephen Leake
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Leake @ 2017-08-27  5:44 UTC (permalink / raw)


On Saturday, August 26, 2017 at 8:50:00 PM UTC-5, Anh Vo wrote:
> On Saturday, August 26, 2017 at 2:03:19 PM UTC-7, Lucretia wrote:
> > On Thursday, 24 August 2017 23:16:10 UTC+1, Stephen Leake  wrote:
> > > I've got a file, which is probably bad Ada, that causes the gnat compiler to hang (or at least, take _much_ longer than normal for this file).
> > > 
> > 
> > Which version of GCC/GNAT is this?
> 
> I believe GNAT GPL 2016 as shown in the first line comment.

To be clear; there are other places in the code where the generalized loop iterators work; I don't know why this particular spot has a problem.


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

end of thread, other threads:[~2017-08-27  5:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24 22:16 gnat compiler hanging Stephen Leake
2017-08-24 22:36 ` Stephen Leake
2017-08-25  8:18   ` Simon Wright
2017-08-26  7:40     ` Stephen Leake
2017-08-26 21:03 ` Lucretia
2017-08-27  1:49   ` Anh Vo
2017-08-27  5:44     ` Stephen Leake

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