From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19362 invoked by alias); 6 Apr 2002 06:02:46 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19355 invoked from network); 6 Apr 2002 06:02:45 -0000 Received: from unknown (HELO duracef.shout.net) (204.253.184.12) by sources.redhat.com with SMTP; 6 Apr 2002 06:02:45 -0000 Received: (from mec@localhost) by duracef.shout.net (8.11.6/8.11.6) id g3662gK28119; Sat, 6 Apr 2002 00:02:42 -0600 Date: Fri, 05 Apr 2002 22:02:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200204060602.g3662gK28119@duracef.shout.net> To: gdb@sources.redhat.com, jimb@redhat.com Subject: Re: C++ nested classes, namespaces, structs, and compound statements Cc: bkoz@redhat.com, dan@dberlin.org X-SW-Source: 2002-04/txt/msg00075.txt.bz2 I'll bite. > In summary, the data structure GDB needs to represent C++ structs > (classes, unions, whatever) has a lot of similarities to the structure > GDB needs to represent the local variables of a compound statement. Sounds reasonable to me. It also sounds dangerous. It's true that namespaces, structs, and compound statements are all identifier binding contexts. But if you start treating a struct as a type of compound statement you could get into a maze of twisty forced meanings. You have to reach down and create a new paradigm and then port both structs and compound statements to it. Think about how much context information an identifier-binding-object needs to do its job. I think it would be difficult to come up with a universal context object that both structs and compound statements can use. Each identifier-binding-object has its own specialized context requirements. > - And what about ambiguous member names? The C++ language spec says: if class A inherits from both class B and class C, and both B and C have a member "foo_", then an unqualified reference to a.foo_ is illegal. The programmer has to say a::B.foo_ or a::C.foo_. The last time I checked, gdb just grabs one of the a.foo_ values and uses it. I think it would be a lot better for gdb to enforce the ambiguity rule. What happens right now if 10 C source files have a static variable named "i" and I say "print i" and I am not in any of those source files at the moment? What *should* happen? It's late ... I'm rambling. Michael C