comp.lang.ada
 help / color / mirror / Atom feed
From: rswhite@cacd.rockwell.com (Robert S. White)
Subject: Re: debugging GNAT programs
Date: 6 Mar 1995 15:14:24 GMT
Date: 1995-03-06T15:14:24+00:00	[thread overview]
Message-ID: <3jf8sg$ik4@newssvr.cacd.rockwell.com> (raw)
In-Reply-To: 3jcmo9$skq@gnat.cs.nyu.edu

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




  parent reply	other threads:[~1995-03-06 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-02 14:52 debugging GNAT programs Marc Graham
1995-03-02 16:52 ` Robert A Duff
1995-03-03  2:47   ` Pug 156
1995-03-04  4:26     ` Tom Griest
1995-03-05 19:20       ` Bernard Banner
1995-03-06 19:34         ` Tom Griest
1995-03-02 22:23 ` Keith Thompson
1995-03-03 22:33   ` Robert S. White
1995-03-05 15:42     ` Robert Dewar
1995-03-05 15:52     ` Robert Dewar
1995-03-06  0:38       ` kkrieser
1995-03-06 15:14       ` Robert S. White [this message]
1995-03-03  4:57 ` Vladimir Vukicevic
1995-03-04 14:07   ` Cyrille Comar
replies disabled

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