From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22826 invoked by alias); 29 Dec 2006 19:06:08 -0000 Received: (qmail 22688 invoked by uid 22791); 29 Dec 2006 19:06:06 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Dec 2006 19:06:05 +0000 Received: (qmail 17910 invoked from network); 29 Dec 2006 19:06:03 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Dec 2006 19:06:03 -0000 To: gdb-patches@sourceware.org Subject: Re: [c++] Pointer to member overhaul References: <20061229025509.GA29152@nevyn.them.org> From: Jim Blandy Date: Fri, 29 Dec 2006 19:06:00 -0000 In-Reply-To: <20061229025509.GA29152@nevyn.them.org> (Daniel Jacobowitz's message of "Thu, 28 Dec 2006 21:55:09 -0500") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00349.txt.bz2 This is great! I think TYPE_CODE_MEMBERPTR and TYPE_CODE_METHODPTR are definitely the right approach; data members and member functions are not merely a different kind of pointer target in the sense that, say, functions are. Since the change is so large, I just looked at the changes to the cp-abi.h and gdbtypes.h interfaces, which I'm assuming pretty much drive the rest of the stuff. The comments in cp-abi.h refer to 'cplus_method_ptr_to_target', which isn't defined anywhere. The sentence "CONTENTS is the bytes forming the pointer to method" isn't grammatical. What is the use of TYPE_CODE_METHOD now? Is it equivalent to TYPE_CODE_FUNC, except that it expects a 'this' pointer? Is the representation of a pointer to a data member always simply an offset from the start of the member pointer's class? It would be nice if the comment for TYPE_CODE_MEMBERPTR said this; similarly, it would be nice if the comment for TYPE_CODE_METHODPTR explained that the representation varies from one ABI to the next, and one should use the cp-abi.h methods to work with them. Say the word, and I'll write these for you. Why are vtable_function_descriptors and vbit_in_delta gdbarch methods instead of cp-abi.h methods?