From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13300 invoked by alias); 26 Feb 2006 22:44:12 -0000 Received: (qmail 13291 invoked by uid 22791); 26 Feb 2006 22:44:11 -0000 X-Spam-Check-By: sourceware.org Received: from mail.math.TU-Berlin.DE (HELO mail.math.TU-Berlin.DE) (130.149.12.212) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 26 Feb 2006 22:44:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.math.TU-Berlin.DE (8.13.5/8.13.3) with ESMTP id k1QMi8U0017745 for ; Sun, 26 Feb 2006 23:44:08 +0100 (MET) Received: from mail.math.TU-Berlin.DE ([127.0.0.1]) by localhost (mail.math.tu-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 17368-03 for ; Sun, 26 Feb 2006 23:44:06 +0100 (MET) Received: from mersenne.math.TU-Berlin.DE (mersenne.math.TU-Berlin.DE [130.149.14.233]) by mail.math.TU-Berlin.DE (8.13.5/8.13.3) with ESMTP id k1QMi50B017740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 26 Feb 2006 23:44:05 +0100 (MET) Received: from mersenne.math.TU-Berlin.DE (localhost [127.0.0.1]) by mersenne.math.TU-Berlin.DE (8.13.3/8.13.3/SuSE Linux 0.7) with ESMTP id k1QMi5O8009928 for ; Sun, 26 Feb 2006 23:44:05 +0100 Received: (from thor@localhost) by mersenne.math.TU-Berlin.DE (8.13.3/8.13.3/Submit) id k1QMi4kk009927 for gdb-patches@sourceware.org; Sun, 26 Feb 2006 23:44:04 +0100 From: Thomas Richter Message-Id: <200602262244.k1QMi4kk009927@mersenne.math.TU-Berlin.DE> Subject: [PATCH] locate members in multiple-inheritance hierarchy To: gdb-patches@sourceware.org Date: Sun, 26 Feb 2006 22:48:00 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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-02/txt/msg00488.txt.bz2 Hi folks, sorry to say that gdb-6.4 has (just another) bug in locating class members in multiple-inheritance class hierarchies. The bug seems to be in lookup_struct_elt_type(), gdbtypes.c, lines 1234ff. Specifically, this code *aborts* the scan by means of "noerr" when detecting a subclass that does not contain the member being searched for. However, it should instead continue to search subclasses. To fix this problem, replace the for-loop over base classes in gdbtypes.c, lines 1234 by the following: for (i = TYPE_N_BASECLASSES (type) - 1; i1 >= 0; i--) { struct type *t = check_typedef (TYPE_BASECLASS (type, i)); /* FIX: THOR (25.2.2006): ** must check for typedefs, must not error on first tried subclass. */ t = lookup_struct_elt_type (t , name, 1 /*noerr*/); if (t != NULL) { return t; } } So long, Thomas