comp.lang.ada
 help / color / mirror / Atom feed
From: concert!news-feed-1.peachnet.edu!umn.edu!email.sp.paramax.com!not-for-mai l@gatech.edu  (Wayne E. Donaho)
Subject: Re: Meridian and ADA
Date: 3 Jun 93 20:31:40 GMT	[thread overview]
Message-ID: <1uln3c$bdh@hobbes.sp.paramax.com> (raw)

Generally speaking, if the first line of the main program (Text_IO.put_Line("Fi
rst line");) is not being reached, the problem you are encountering is an excep
tion raised during elaboration.

How to procede:
1. Check all of your declarations, if you ar initializing some variable
   to a value not contained in its type a constraint error will occur.
   Make sure all array aggregate initializations have the correct
   number of elements.
2. You may need to put in pragma elaborates to control the elaboration order
   of your code.  Some compilers have trouble determining the order
   which your packages need to be elaborated, and will pick the wrong
   order.  If a package uses a user definded operation to initialize
   data in the package body, it is generally a good idea to use pragma
   elaborate.  If part of your elaboration contains code which attempts
   to call a task entry, you must make sure that the task is elaborated
   before the call is attempted.  If I have initialization that needs
   to call a task, I will write an initialization procedure that can be
   called once the entire program has been elaborated.
3. To possibly determine which package the elaboration error is occuring in
   you may be able to put Text_IO.Put_Lines in the begin..end of the package 
   body.  Remember, the executable portion of the body is executed after
   all of the packages variables, types. procedures, functions, etc are 
   elaborated.
4. If you know what package is failing to elaborate, but do not know
   what declaration, you can write a function that outputs text to trace
   how far you are getting.  i.e.
   
   function Trace(Text:String) return integer is
   begin
     Text_IO.Put_Line(Text);
     return 1;
   end Trace;
   
   Scatter dummy integer initializations through your package body
   and you should be able to determine which declataion is giving you 
   problems.

Of all of the problems that I have encountered using ada, the hardest
to find are exceptions raised during elaboration.  Some compilers do
give you very good support for discovering these problems, others
don't.  One thing I have learned is if your compiler outputs a warning
indicating a constraint error will be raised during a units
elaboration, don't ignore it.

Good Luck, Wayne Donaho.

             reply	other threads:[~1993-06-03 20:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-03 20:31 concert!news-feed-1.peachnet.edu!umn.edu!email.sp.paramax.com!not-for-mai [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-06-03 22:25 Meridian and ADA dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!europa.eng.g
1993-06-03 12:56 Robert Dewar
1993-06-03  4:01 munnari.oz.au!newshost.anu.edu.au!csc.canberra.edu.au!birch!tp913382
replies disabled

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