This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] lookup_transparent_type hack


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  <carlton@kealia.com>
 > 
 > 	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  <carlton@kealia.com>
 > 
 > 	* 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.
 > 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]