From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25859 invoked by alias); 9 Jun 2004 13:39:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 25848 invoked from network); 9 Jun 2004 13:39:41 -0000 Received: from unknown (HELO cuddles.cambridge.redhat.com) (81.96.64.123) by sourceware.org with SMTP; 9 Jun 2004 13:39:41 -0000 Received: from redhat.com (localhost.localdomain [127.0.0.1]) by cuddles.cambridge.redhat.com (8.12.8/8.12.8) with ESMTP id i59DbfVL016301; Wed, 9 Jun 2004 14:37:52 +0100 Received: (from aph@localhost) by redhat.com (8.12.8/8.12.8/Submit) id i59DbfHp016297; Wed, 9 Jun 2004 14:37:41 +0100 From: Andrew Haley MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16583.4773.74100.735457@cuddles.cambridge.redhat.com> Date: Wed, 09 Jun 2004 13:39:00 -0000 To: Daniel Jacobowitz Cc: java@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: Binary Compatibility: debug info for compiled Java programs In-Reply-To: <20040609132951.GA8017@nevyn.them.org> References: <16582.65277.81118.189889@cuddles.cambridge.redhat.com> <20040609130859.GA7514@nevyn.them.org> <16583.3516.604885.805420@cuddles.cambridge.redhat.com> <20040609132951.GA8017@nevyn.them.org> X-SW-Source: 2004-06/txt/msg00063.txt.bz2 Daniel Jacobowitz writes: > On Wed, Jun 09, 2004 at 02:16:44PM +0100, Andrew Haley wrote: > > Daniel Jacobowitz writes: > > > > > > I'm not familiar with the BC ABI (and missed the talk); could you give > > > me an example of what information you have at compile time and what you > > > generate at runtime? > > > > All structures are laid out at runtime. > > > > http://people.redhat.com/lockhart/.gcc04/MasterGCC-2side.pdf Page 169. > > So: the list of members, the inheritance tree, et cetera is static at > compile time; for their locations you have runtime tables. No, not exactly. It's possible to insert a class into the inheritance chain or add new fields. > > > I suspect that a fourth solution is possible: gcj generating DWARF > > > which describes how to read the metadata. It may not be very > > > efficient, though, and it will still require a certain amount of > > > playing with GDB. > > > > Yeah, that was suggested as well. I forgot to mention it. I don't > > know if this is possible in DWARF data: don't member offsets have to > > be constants? > > > > I must admit I like this idea least of all! Maybe I subconsciously > > suppressed the memory. > > Could you explain what you don't like about it? An odd feeling of unease, I suppose. I imagine the expressions could become rather complex. > Member offsets definitely don't have to be constant. In fact, from the > spec: > For a C++ virtual base, the data member location attribute will > usually consist of a non-trivial location expression. > The way C++ handles virtual bases is similar enough in execution that > the same thing will work here. For a member it would look like: > > # Base location of the class is on the stack > DW_OP_addr > DW_OP_constu > DW_OP_plus > DW_OP_deref (or DW_OP_deref_size ) > DW_OP_plus Okay, that's good. Would we also be able to cope with not being able to resolve our superclass till runtime? It can't just be a pointer to a symbol, because there may be many identical symbols. Andrew.