This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: So what is wrong with v3 C++
- To: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Subject: Re: So what is wrong with v3 C++
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Fri, 29 Jun 2001 14:40:40 -0400
- Cc: dan at cgsoftware dot com, gdb at sources dot redhat dot com
- References: <200106291629.JAA01818@bosch.cygnus.com>
Michael Elizabeth Chastain <chastain@cygnus.com> writes:
> Daniel Berlin writes:
>
>> The thing is, it shouldn't match against demangled forms, it should
>> match against *fully qualified* forms.
>
> Ah, I feel some illumination coming on.
>
>> Aclass a;
>> int c;
>> c = int a::george(int, int)(5, 6);
>>
>> That's what we've got now.
>
> gdb's goal is to have an expression evaluator that is some reasonable
> subset of the language under test.
>
> In K & R C, the translation from "demangled" -> "fully qualified" is trivial.
> In ANSI C, the translation from "demangled" -> "fully qualified" takes work.
> You have to convert "foo(int, int)" -> "foo".
> This conversion is actually built into a string matcher!
> In C++, the translation from "demangled" -> "fully qualified" is hairy.
> There are a lot of cases and changing the string matchers is hopeless.
>
> It sounds like we need a much more detailed demangler interface, where
> the demangler gives us the demangled name, the fully qualified name,
> plus any other forms of the name we care about.
Yup, this is what would be necessary to
1. Make the STABS reader be able to give qualified names, except in
the case of namespaces (which it still wouldn't be able to do,
without more hacks from gcc)
2. Make the new dwarf2 reader backwards compatible without having to
use linkage names at anything more than symbol reading time (we can
currently be backwards compatible by falling back on the linkage
name, and doing what we used to, which is, use it).
>
> Michael
--
"Last time I went to the movies I was thrown out for bringing my
own food. My argument was that the concession stand prices are
outrageous. Besides, I haven't had a Bar-B-Que in a long time.
"-Steven Wright