From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30191 invoked by alias); 18 Jan 2004 23:48:26 -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 30182 invoked from network); 18 Jan 2004 23:48:23 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 18 Jan 2004 23:48:23 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 2692B1A440D; Sun, 18 Jan 2004 18:46:20 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16395.6860.71349.973781@localhost.redhat.com> Date: Sun, 18 Jan 2004 23:48:00 -0000 To: David Carlton Cc: gdb-patches@sources.redhat.com, Daniel Jacobowitz Subject: Re: [rfa] lookup_transparent_type hack In-Reply-To: References: X-SW-Source: 2004-01/txt/msg00486.txt.bz2 David Carlton writes: > This is a hack for lookup_transparent_type, as a partial workaround > for PR gdb/1511. The problem there is, if the compiler doesn't > generate DW_TAG_namespace, then, if we have a class C defined inside a > namespace N, then when GDB sees an abstract declaration for N::C, it > will think it's called "C" instead of "N::C". Then > lookup_transparent_type will get passed "C", and it won't find the > full definition for the class (which is called "N::C"). > > I don't see what we can do about this without full debugging info - > GDB can't very well look in all the namespaces out there. One > heuristic which has proved useful, however, is to try looking in the > namespaces associated to the function we're currently within (if any), > on the theory that we're a bit more likely to be dealing with types in > those namespaces than types in other namespaces. It's a hack, but it > does seem to help. > > Here's a patch to do that. It needs C++ approval, and it would be > nice if a symtab person would confirm that it's okay to make > lookup_transparent_type language-dependent. Tested on > i686-pc-linux-gnu, DWARF-2, GCC 3.2 both with and without > DW_AT_namespace; no regressions, and the new test passes in both > cases. (It shouldn't affect stabs, though I'm running the testsuite > now just to double-check.) > > Okay to commit? > I have no objections, but I think it should be tested with gcc2.95.3 and -gdwarf-2, since MichaelC is doing that, and turning out interesting regressions. elena > David Carlton > carlton@kealia.com > > 2004-01-16 David Carlton > > Partial workaround for PR c++/1511: > * cp-namespace.c: Include frame.h. > (cp_lookup_transparent_type): New > (cp_lookup_transparent_type_loop): New. > * cp-support.h: Declare cp_lookup_transparent_type. > * symtab.c (basic_lookup_transparent_type): Renamed from > lookup_transparent_type. > (lookup_transparent_type): Replace old body by a call to > current_language->la_lookup_transparent_type. > * symtab.h: Update copyright. Declare > basic_lookup_transparent_type. > * language.h: Update copyright. > (struct language_defn): Add la_lookup_transparent_type. > * language.c: Update copyright. > (unknown_language_defn): Add basic_lookup_transparent_type. > (auto_language_defn): Add basic_lookup_transparent_type. > (local_language_defn): Add basic_lookup_transparent_type. > * ada-lang.c: Update copyright. > (ada_language_defn): Add basic_lookup_transparent_type. > * c-lang.c: Update copyright. > (c_language_defn): Add basic_lookup_transparent_type. > (cplus_language_defn): Add basic_lookup_transparent_type. > (asm_language_defn): Add basic_lookup_transparent_type. > (minimal_language_defn): Add basic_lookup_transparent_type. > * f-lang.c: Update copyright. > (f_language_defn): Add basic_lookup_transparent_type. > * jv-lang.c: Update copyright. > (java_language_defn): Add basic_lookup_transparent_type. > * m2-lang.c: Update copyright. > (m2_language_defn): Add basic_lookup_transparent_type. > * objc-lang.c: Update copyright. > (objc_language_defn): Add basic_lookup_transparent_type. > * p-lang.c: Update copyright. > (p_language_defn): Add basic_lookup_transparent_type. > * scm-lang.c: Update copyright. > (scm_language_defn): Add basic_lookup_transparent_type. > * Makefile.in (cp-namespace.o): Depend on frame.h. > > 2004-01-16 David Carlton > > * gdb.cp/rtti.exp: Don't include full path in ${srcfile}. Add > test for cp_lookup_transparent_type. > * gdb.cp/rtti1.cc: Update copyright. Add n2::func and call to it. >