This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Binary Compatibility: debug info for compiled Java programs
On Thu, Jun 10, 2004 at 05:42:20PM +0100, Andrew Haley wrote:
> Daniel Jacobowitz writes:
> > I still don't see how this mechanism implements the above principle,
> > i.e. converting symbolic field names to offsets; is the otable
> > associated with the object doing the access or with the objet defining
> > the class?
>
> The object doing the access. Every class has an otable that is fixed
> up with the field offsets of every field that it accesses.
Thanks, that's what I was missing.
> > > Generating Dwarf that redirects through the otable, like the code
> > > itself does, is tempting. But is it possible? I don't see how
> > > something like 'print object' would work -- you would have to look
> > > more closely at all the reflection data to discover all the fields in
> > > a given class.
> >
> > Generating Dwarf that redirects through a particular otable is easy.
> > Generating information to describe the sort of symbolic changes to
> > inheritance and fields, on the other hand, is not.
>
> That's kinda what I expected. Is it hard to generate DWARF to
> describe class layout?
That depends. A decent-sized chunk of dwarf2out is devoted to this; on
the other hand, you've got a much simpler problem to solve since you're
only dealing with Java aggregates. The hardest part would be
describing the types of fields with appropriate cross-referencing.
I'm not sure how to do this without nasty runtime overhead; it might be
easier to keep the logic in GDB. I haven't given it much thought,
though.
--
Daniel Jacobowitz