From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20033 invoked by alias); 7 Oct 2002 18:50:09 -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 20025 invoked from network); 7 Oct 2002 18:50:08 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 7 Oct 2002 18:50:08 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g97Io6S20937; Mon, 7 Oct 2002 11:50:06 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Jim Blandy Cc: gdb Subject: Re: current namespace game plan References: From: David Carlton Date: Mon, 07 Oct 2002 11:50:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00065.txt.bz2 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. 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(); }