From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32721 invoked by alias); 29 Jun 2006 13:22:24 -0000 Received: (qmail 32705 invoked by uid 22791); 29 Jun 2006 13:22:23 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 29 Jun 2006 13:22:22 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FvwTL-0003Ly-VC for gdb-patches@sourceware.org; Thu, 29 Jun 2006 09:22:20 -0400 Date: Thu, 29 Jun 2006 13:22:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [PATCH] m32c-tdep.c: Don't choke on virtual functions in push_dummy_call Message-ID: <20060629132219.GB12662@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20060628141839.GA29012@calimero.vinschen.de> <20060628213255.GA24718@nevyn.them.org> <20060629110136.GE18873@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060629110136.GE18873@calimero.vinschen.de> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00406.txt.bz2 On Thu, Jun 29, 2006 at 01:01:36PM +0200, Corinna Vinschen wrote: > This I don't understand. Calling virtual methods works quite nicely, > at least in my m32c case here. After dereferencing the method type, > the m32c_push_dummy_call function passes all args correctly and the > return value of the call is correct, too. > > As for the problem of having to dereference the virtual function type, > Maybe it makes sense to do this in call_function_by_hand already. > Or are you suggesting that the representation of virtual methods is > incorrect in GDB? This is what a pointer to a virtual function looks like in the Itanium (GNU v3) C++ ABI: struct { int (*__pfn) (A *this); int __delta; }; If it's a virtual function, __pfn is actually an offset to the virtual table. This is what a pointer to method is supposed to look like. GDB botches this. The house of cards it has now more or less works, but that's it. I think you should be getting a TYPE_CODE_METHOD, not a pointer to method, in target specific code. -- Daniel Jacobowitz CodeSourcery