From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2218 invoked by alias); 16 Oct 2002 18:14:50 -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 2205 invoked from network); 16 Oct 2002 18:14:49 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 16 Oct 2002 18:14:49 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g9GHs9w25261 for ; Wed, 16 Oct 2002 13:54:09 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9GIEmf10923 for ; Wed, 16 Oct 2002 14:14:48 -0400 Received: from localhost.redhat.com (IDENT:bbJaJjg0sYggq6UpBHK/4x0k60Wi8/IN@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9GIEmT04521 for ; Wed, 16 Oct 2002 14:14:48 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 88D64FF79; Wed, 16 Oct 2002 14:09:28 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15789.43864.432576.737958@localhost.redhat.com> Date: Wed, 16 Oct 2002 11:14:00 -0000 To: David Carlton Cc: Jim Blandy , gdb Subject: Re: current namespace game plan In-Reply-To: References: X-SW-Source: 2002-10/txt/msg00125.txt.bz2 David Carlton writes: > On 04 Oct 2002 21:43:20 -0500, Jim Blandy said: > > > For my own sake, at least, it would be nice to have specific > > examples of code and commands that GDB gets wrong at present. > > I'm including a file with examples after my signature: break in main > and try to print out each expression listed in the body of main; > you'll have problems. And break in B::b2 and try to print out b1; > you'll have problems. > > For some of these (u1, a1, and b1, but not the foo expression, D::b1, > or e2), GDB actually prints out an answer that is incorrect, rather > than saying that there isn't a symbol by that name. Pretty weird; I > just noticed that, and I really don't understand why GDB would do so. > I'll have to look into that, but if you happen to understand what's > going on with those examples, please tell me. > [back from vacation...] Could you start writing some test files with these examples? Even if the tests are not passing, I find it is really useful while working on something, to monitor my own progress. You could put these tests on the branch(es), so that anybody can look at them. Or we could even add them to mainline with KFAILs. Elena > David Carlton > carlton@math.stanford.edu > > namespace { > int u1 = 1; > } > > namespace A { > int a1 = 1; > } > > using namespace A; > > namespace B { > int b1 = 1; > > int b2() > { > return b1; > } > } > > namespace C { > class c1 {}; > void foo(c1 x) > { > } > } > > namespace D = B; > > namespace E { > int e1 = 1; > int e2 = 2; > } > > using E::e2; > > int main() > { > // For each of these, try to print out the expression in question, > // as typed here. (Well, you should probably enclose them in single > // quotes.) GDB either won't let you or will print out garbage. > > // GDB can't see unnamed namespaces. > u1; > // GDB can't see using directives. > a1; > // GDB can't do Koenig lookup. > foo(C::c1()); > // GDB can't see namespace aliases. > D::b1; > // GDB can't see using declarations. > e2; > > // For this one, break in B::b2 and try to print b1. GDB won't let you. > B::b2(); > }