From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19567 invoked by alias); 4 Dec 2003 21:16:39 -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 19557 invoked from network); 4 Dec 2003 21:16:38 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 4 Dec 2003 21:16:38 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 853F61A42DB; Thu, 4 Dec 2003 16:16:37 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16335.42037.408141.286736@localhost.redhat.com> Date: Thu, 04 Dec 2003 21:16:00 -0000 To: mec.gnu@mindspring.com (Michael Elizabeth Chastain) Cc: dan@debian.org, ezannoni@redhat.com, gdb-patches@sources.redhat.com, jimb@redhat.com, carlton@kealia.com Subject: Re: [rfa/symtab/c++] fix c++ rtti type lookup In-Reply-To: <20031127070903.48F634B40B@berman.michael-chastain.com> References: <20031127070903.48F634B40B@berman.michael-chastain.com> X-SW-Source: 2003-12/txt/msg00138.txt.bz2 Michael Elizabeth Chastain writes: > This patch is a partial fix for PR c++/1465, which is the bug where RTTI > lookup gets the "namespace" symbol instead of the class symbol. It also > fixes PR c++/1377, which was another manifestation of the same bug. > > http://sources.redhat.com/gdb/bugs/1465 > http://sources.redhat.com/gdb/bugs/1377 > > These bugs are regressions versus gdb 6.0 so they are high priority. > > First, lookup_rtti_type is a new function which takes a name and a block > and returns the class type of that name. It's basically a block of code > extracted from gnuv3_rtti_type. gnuv3_rtti_type calls lookup_rtti_type > now. > > Then I changed gnuv2_rtti_type to call lookup_rtti_type. This > changes the symbol lookup from VAR_DOMAIN to STRUCT_DOMAIN. > > lookup_rtti_type is full of checks and warnings so that it doesn't > return crap to its caller. > > This fixes the simple cases of the bug. > > More work is needed: > > . The calls to lookup_rtti_type need a proper "block" parameter. > The old code needed this too; I haven't regressed anything. > I put FIXME notes in for this. > > . hpacc_value_rtti_type has the same buggy code. > I can't change the code because I can't test it, > but I can put it a big FIXME into it. > (I wonder if anyone still uses HP aCC with gdb). > here is a quandary. Should we carry around such code if nobody uses it. If we cannot test it we might as well explicitly admit it. > . Nested types give a warning and don't work. > It would be nice to make them work. > is there a bug/testcase? > . Types with virtual bases appear to work with v3, but give a warning > and don't work with v2. "don't work" probably means that they fall back > to the static type rather than the dynamic type. > > Testing: I tested with gcc v2 and v3, dwarf-2 and stabs+. > Nothing got worse. gdb.cp/class2.exp has a specific test for this, > which now passes. > > Some tests in virtfunc.exp that broke after the 2003-09-11 namespace > commit started working again. That was pr gdb/1377. > > I think I need approval from a symtab maintainer to add the If you move the function to cp-support.c and cp-support.h I think you can avoid touching symtab.h altogether. > new utility function "lookup_rtti_type", and then approval > from a C++ maintainer to change gnuv2_rtti_type and gnuv3_rtti_type > to call lookup_rtti_type. > > Okay to commit? > I think David ok'd it already. elena