From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10981 invoked by alias); 11 Oct 2005 05:49:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10970 invoked by uid 22791); 11 Oct 2005 05:49:02 -0000 Received: from ausmtp01.au.ibm.com (HELO ausmtp01.au.ibm.com) (202.81.18.186) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 11 Oct 2005 05:49:02 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp01.au.ibm.com (8.12.10/8.12.10) with ESMTP id j9B5pb7k275600 for ; Tue, 11 Oct 2005 15:51:39 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j9B5pba2184290 for ; Tue, 11 Oct 2005 15:51:38 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id j9B5makK012744 for ; Tue, 11 Oct 2005 15:48:37 +1000 Received: from [9.181.133.252] ([9.181.133.252]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id j9B5mYgx012674; Tue, 11 Oct 2005 15:48:35 +1000 Date: Tue, 11 Oct 2005 05:49:00 -0000 From: Wu Zhou To: Daniel Jacobowitz cc: gdb-patches@sources.redhat.com Subject: Re: Removing TYPE_VPTR_FIELDNO uses (was: Re: [patch ping] Set TYPE_VPTR_BASETYPE/TYPE_VPTR_FIELDNO of XL C++ virtual class) In-Reply-To: <20051002222103.GA32728@nevyn.them.org> Message-ID: References: <1127969598.433b733eedab9@imap.linux.ibm.com> <20051002222103.GA32728@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-10/txt/msg00098.txt.bz2 Hi Daniel, I have one more question about the offset of vptr. On Sun, 2 Oct 2005, Daniel Jacobowitz wrote: > > - gnu-v3-abi.c: VPTRs is used for rtti, virtual function and virtual base > > class offset. > > In this file, I think we can skip all the rigamarole with debug > information to find the vptr. It's very easy: it's the size of a > pointer, and it's at offset 0. Always. By saying above, do you means that the pointer to the vtable is always at the beginning of the fields, so we can calculate the vtable_address using the following code? vtable_address = value_as_address (value_field (value, 0 /* TYPE_VPTR_FIELDNO (values_type) */)); But I found that in some testcase (such as class A in gdb.cp/virtfunc.cc), the offset is 1. Did I misunderstand something? If so, please help me point out. Thanks a bunch! Best Regards - Wu Zhou