comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Shared Generic Instance Code
Date: 1997/04/02
Date: 1997-04-02T00:00:00+00:00	[thread overview]
Message-ID: <dewar.859987468@merv> (raw)
In-Reply-To: 1997Apr1.201631.28634@ocsystems.com


Joel says

<<Well, I'll not summarize but make one point.  Environments that use code
sharing may have an easier (more human intuitive) time with with source
level debugging.  In order to set a breakpoint generic unit n a multi-
instance environment one must know which instance.  In a code-sharing
situation the code being debugged is more intuitively linked to the
source code.  Such things can certainly be overcome, but will probably
add complexity to the compiler and/or debugger (that was supposed to be
simpler).>.

That's certainly a valid point. On the other hand, shared generics add a lot
of complexity to a compiler. There is also a problem of patents. DEC holds
patents on the implementation of shared generics which make it less worth
while to investigate this approach.

A programmer definitely has to be aware of whether generics are shared or not.
In most compilers, generics are not shared (Rational and RR are notable
exceptions, and the DEC 83 compiler also does a fairly complete job of
generic sharing -- see above note on patents).

If generics are NOT shared, then you want to factor generic and non-generic
code as much as possible. Have a look at how Integer_IO is done in GNAt to
see an example of this in action.

Back to debugging: it is tricky to deal with non-shared generic instances
in debuggers. In GNAT we have the first step, the compiler fully understands
source locations with respect to generics (you can see that from the
error messages, which pinpoint the template and instantiation locations).

We are working now on passing this information through to GDB, and have
some interesting ideas on how this might be done.

Robert Dewar
Ada Core Technologies





  parent reply	other threads:[~1997-04-02  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-01  0:00 Shared Generic Instance Code david scott gibson
1997-04-01  0:00 ` Pat Rogers
1997-04-01  0:00 ` Joel VanLaven
1997-04-01  0:00   ` Robert A Duff
1997-04-02  0:00     ` Robert Dewar
1997-04-02  0:00       ` Robert A Duff
1997-04-02  0:00   ` Robert Dewar [this message]
1997-04-02  0:00     ` Robert A Duff
1997-04-01  0:00 ` Robert A Duff
1997-04-02  0:00   ` Robert Dewar
1997-04-05  0:00   ` Nick Roberts
1997-04-05  0:00     ` Robert A Duff
1997-04-05  0:00       ` Nick Roberts
1997-04-06  0:00       ` Robert Dewar
1997-04-02  0:00 ` Jon S Anthony
1997-04-02  0:00   ` Robert A Duff
1997-04-03  0:00   ` Robert Dewar
1997-04-03  0:00 ` Corey Minyard
1997-04-03  0:00 ` Bill Keen
1997-04-03  0:00   ` Robert Dewar
1997-04-04  0:00     ` Fergus Henderson
1997-04-04  0:00       ` Robert Dewar
1997-04-04  0:00   ` Robert A Duff
1997-04-03  0:00 ` Jon S Anthony
1997-04-03  0:00   ` Robert Dewar
1997-04-04  0:00 ` Bill Keen
1997-04-04  0:00   ` Robert Dewar
1997-04-05  0:00     ` Tom Moran
1997-04-06  0:00       ` Nick Roberts
1997-04-07  0:00       ` Robert Dewar
replies disabled

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