From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29974 invoked by alias); 27 Mar 2003 14:24:18 -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 29967 invoked from network); 27 Mar 2003 14:24:18 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 27 Mar 2003 14:24:18 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h2REOHQ27023 for ; Thu, 27 Mar 2003 09:24:17 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h2REOGQ10539 for ; Thu, 27 Mar 2003 09:24:17 -0500 Received: from cygbert.vinschen.de (vpn50-14.rdu.redhat.com [172.16.50.14]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h2REOF518677 for ; Thu, 27 Mar 2003 06:24:15 -0800 Received: (from corinna@localhost) by cygbert.vinschen.de (8.11.6/8.9.3/Linux sendmail 8.9.3) id h2REOCE11842 for gdb@sources.redhat.com; Thu, 27 Mar 2003 15:24:12 +0100 Date: Thu, 27 Mar 2003 14:24:00 -0000 From: Corinna Vinschen To: gdb@sources.redhat.com Subject: Problem with virtual function pointers Message-ID: <20030327142412.GK23762@cygbert.vinschen.de> Reply-To: gdb@sources.redhat.com Mail-Followup-To: gdb@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-03/txt/msg00369.txt.bz2 Hi, I'm just investigating a problem which XStormy16 gets in gdb.c++/printmethod.exp: print theA->virt^M $1 = invalid pointer to member function^M FAIL: gdb.c++/printmethod.exp: print virtual method. It turned out that the error happens in xstormy16_pointer_to_address(). This function converts an address to a jump table entry into a pointer to the actual function. To do this, it calls a conversion routine, which is only called if the following condition applies: enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type)); if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD) convert(); Surprisingly (at least for me) this fails for the above case. Looking into type, I found that type is TYPE_CODE_PTR which is correct, but target_type is TYPE_CODE_VOID! Sure, the above virtual method is of type void but is that really ok? Shouldn't that be type: TYPE_CODE_PTR type->target_type: TYPE_CODE_METHOD type->target_type->target_type: TYPE_CODE_VOID ? Does somebody know why that happens? Is that just a bug in gdb? Or could that be related to incorrect debug info from gcc? Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen@redhat.com