From: Elena Zannoni <ezannoni@redhat.com>
To: David Carlton <carlton@kealia.com>
Cc: gdb-patches@sources.redhat.com, Daniel Jacobowitz <drow@mvista.com>
Subject: Re: [rfa] lookup_transparent_type hack
Date: Sun, 18 Jan 2004 23:48:00 -0000 [thread overview]
Message-ID: <16395.6860.71349.973781@localhost.redhat.com> (raw)
In-Reply-To: <m3vfnbbg4z.fsf@coconut.kealia.com>
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.
>
next prev parent reply other threads:[~2004-01-18 23:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 23:58 David Carlton
2004-01-18 23:48 ` Elena Zannoni [this message]
2004-01-19 4:25 ` Daniel Jacobowitz
2004-01-22 22:00 ` David Carlton
2004-01-22 22:30 ` Daniel Jacobowitz
2004-01-23 23:06 ` David Carlton
2004-01-23 23:08 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16395.6860.71349.973781@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=carlton@kealia.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox