Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Tom Tromey <tromey@redhat.com>, java@gcc.gnu.org, gdb@sources.redhat.com
Subject: Re: Binary Compatibility: debug info for compiled Java programs
Date: Thu, 10 Jun 2004 16:44:00 -0000	[thread overview]
Message-ID: <16584.36716.621979.766824@cuddles.cambridge.redhat.com> (raw)
In-Reply-To: <20040610163718.GA24803@nevyn.them.org>

Daniel Jacobowitz writes:
 > On Wed, Jun 09, 2004 at 04:25:01PM -0600, Tom Tromey wrote:
 > > However, this is only part of the picture.  The other part is that the
 > > Java runtime environment can differ from the compile-time environment.
 > > In particular, a given class can be loaded into a running virtual
 > > machine any number of times, via different ClassLoaders.  And since
 > > all references used by a class are symbolic, and since a ClassLoader
 > > mediates the name->class lookup, it follows that each separately
 > > loaded instance of such a class can have different superclasses.
 > > 
 > > I.e., we load class Derived, which inherits from class Base, twice.
 > > We load it once via ClassLoader A and once via ClassLoader B.  Then we
 > > can end up with different versions of Base, that might have different
 > > properties.  E.g., B's Base might have extra private fields.  (Exactly
 > > what changes are valid is what is described in that chapter of the
 > > JLS.)
 > > 
 > > 
 > > In our BC ABI, we add a new level of indirection.  So, a field lookup
 > > isn't just *(object+offset), but instead *(object+otable[index]),
 > > where the otable ("offset table") is computed at class initialization
 > > time.
 > 
 > 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.

 > > 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?

Andrew.


  parent reply	other threads:[~2004-06-10 16:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 12:15 Andrew Haley
2004-06-09 13:09 ` Daniel Jacobowitz
2004-06-09 13:19   ` Andrew Haley
2004-06-09 13:29     ` Daniel Jacobowitz
2004-06-09 13:39       ` Andrew Haley
2004-06-09 22:17         ` Daniel Jacobowitz
2004-06-09 22:37           ` Tom Tromey
2004-06-10 16:37             ` Daniel Jacobowitz
2004-06-10 16:42               ` Tom Tromey
2004-06-10 16:47                 ` Ian Lance Taylor
2004-06-10 16:58                   ` Andrew Haley
2004-06-10 17:12                     ` Ian Lance Taylor
2004-06-10 17:25                       ` Andrew Haley
2004-06-10 16:44               ` Andrew Haley [this message]
2004-06-10 16:54                 ` Daniel Jacobowitz
2004-06-09 14:13 ` Per Bothner
2004-06-09 14:20   ` Andrew Haley
2004-06-09 20:46 ` Anthony Green
2004-06-09 21:26   ` Andrew Cagney
2004-06-09 22:11     ` Anthony Green
2004-06-11 13:04     ` Andrew Haley
2004-06-11 15:11       ` Andrew Cagney
2004-06-11 15:17         ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16584.36716.621979.766824@cuddles.cambridge.redhat.com \
    --to=aph@redhat.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=java@gcc.gnu.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox