From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cd24ffa36ebe3ef6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-06 09:01:25 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!news.ksu.ksu.edu!lazrus.cca.rockwell.com!cacd.rockwell.com!usenet From: rswhite@cacd.rockwell.com (Robert S. White) Newsgroups: comp.lang.ada Subject: Re: debugging GNAT programs Date: 6 Mar 1995 15:14:24 GMT Organization: Rockwell International, CACD Message-ID: <3jf8sg$ik4@newssvr.cacd.rockwell.com> References: <1995Mar2.095243.14051@sei.cmu.edu> <3j85fv$31s@newssvr.cacd.rockwell.com> <3jcmo9$skq@gnat.cs.nyu.edu> NNTP-Posting-Host: pc110437.cacd.rockwell.com Mime-Version: 1.0 X-Newsreader: WinVN 0.93.11 Date: 1995-03-06T15:14:24+00:00 List-Id: In article <3jcmo9$skq@gnat.cs.nyu.edu>, dewar@cs.nyu.edu says... >> This step could eventually be skipped IMHO . > The step referred to is generating a source program from the binder for > the main program (although I think the writer also was under the > mis-conception that other Ada compilation went through C). But, but, I SAID "GNU compilers use an intermediate code which is not C for the optimization pass". This weekend I did some more RTFM (by doing: "gcc --help" getting a nice Windows Help file) and did find very clear documentation that GNATBIND generates a C source main program for startup and elaboration purposes. Looking at the examples I see that it fetches command line parameters, calls elaboration routines, calls the actual Ada program, may call some "system__finalization_implementation__" stuff, calls the C library exit() routine to return the program error status and finally has a table of symbols and objects data. > But with regards to the binder, it is *very* important that source code is > generated, because it means you can step through the elaboration code just > as you would debug any other source code using whatever source level > debugger you normally use for the rest of the program. There have been some > Ada systems which precisely skipped this step, and as a consequence > debugging the elaboration code could be tricky. Agreed, in working on embedded systems it seems like the nastiest bugs (hardest to debug) occur during elaboration. We always have had at least an assembler list file of the calls to elaboration routines but users find it alien to debug problems there rather than in their Ada module. > We think it is a definite advantage to generate source for the main program, > and have no intention of changing it. As I mentioned before, we do intend > to have the option of generating the main program in Ada (indeed we will > probably make this the deault), but that's for later. We have introduced > attributes that let an Ada program call the elaboration routines for > packages precisely so that the main program can easily be written in Ada. We certainly need source for the main (external wrapper/elaborating) program. I don't care if it is in C or Ada except when I have to train software engineers unfamiliar with C in C (yes there are a few!). It is interesting to hear the plans for future GNAT changes in this area. ------------------------------------------- Robert S. White -- speaking for myself only 76166.1137@compuserve.com