From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 3 Jun 93 20:31:40 GMT 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 Message-ID: <1uln3c$bdh@hobbes.sp.paramax.com> List-Id: 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.