From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3423 invoked by alias); 11 Jun 2003 22:42:56 -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 3409 invoked from network); 11 Jun 2003 22:42:56 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 11 Jun 2003 22:42:56 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5BMgtH06333 for ; Wed, 11 Jun 2003 18:42:55 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5BMgtI08063 for ; Wed, 11 Jun 2003 18:42:55 -0400 Received: from localhost.localdomain (vpn50-31.rdu.redhat.com [172.16.50.31]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5BMgtE21049; Wed, 11 Jun 2003 18:42:55 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h5BMgno27164; Wed, 11 Jun 2003 15:42:49 -0700 Date: Wed, 11 Jun 2003 22:42:00 -0000 From: Kevin Buettner Message-Id: <1030611224249.ZM27163@localhost.localdomain> In-Reply-To: Jim Blandy "[ppc64-linux]: register CONVERT_FROM_FUNC_PTR_ADDR method" (Jun 11, 3:53am) References: To: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: [ppc64-linux]: register CONVERT_FROM_FUNC_PTR_ADDR method MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00395.txt.bz2 On Jun 11, 3:53am, Jim Blandy wrote: > 2003-06-11 Jim Blandy > > * ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): New > function. > (ppc_linux_init_abi): Register it as the > CONVERT_FROM_FUNC_PTR_ADDR method under the PPC64 Linux ABI. Okay, but could you revise the comment to not mention RS/6000 and to make it clear that the representation in question only pertains to the 64-bit ABI? > + /* Support for CONVERT_FROM_FUNC_PTR_ADDR(ADDR). > + > + Usually a function pointer's representation is simply the address > + of the function. On the RS/6000 however, a function pointer is > + represented by a pointer to a TOC entry. This TOC entry contains > + three words, the first word is the address of the function, the > + second word is the TOC pointer (r2), and the third word is the > + static chain value. Throughout GDB it is currently assumed that a > + function pointer contains the address of the function, which is not > + easy to fix. In addition, the conversion of a function address to > + a function pointer would require allocation of a TOC entry in the > + inferior's memory space, with all its drawbacks. To be able to > + call C++ virtual methods in the inferior (which are called via > + function pointers), find_function_addr uses this function to get the > + function address from a function pointer. */ Kevin