From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17758 invoked by alias); 13 Dec 2007 03:39:03 -0000 Received: (qmail 17750 invoked by uid 22791); 13 Dec 2007 03:39:03 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.179) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Dec 2007 03:38:56 +0000 Received: by wa-out-1112.google.com with SMTP id l35so807017waf.12 for ; Wed, 12 Dec 2007 19:38:54 -0800 (PST) Received: by 10.115.58.1 with SMTP id l1mr1666705wak.110.1197517134130; Wed, 12 Dec 2007 19:38:54 -0800 (PST) Received: by 10.114.209.18 with HTTP; Wed, 12 Dec 2007 19:38:53 -0800 (PST) Message-ID: <366c6f340712121938j2fc71e6dmf69a9395ca6d8f6f@mail.gmail.com> Date: Thu, 13 Dec 2007 03:39:00 -0000 From: "Peng Yu" To: gdb@sourceware.org Subject: namespace and argument dependent name lookup (ADL) in gdb MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00084.txt.bz2 Hi, I don't have to write test::f in the following program because of argument dependent name lookup. http://en.wikipedia.org/wiki/Argument_dependent_name_lookup But to debug such program, I have to write the namespace test. For example, (gdb) tb f Function "f" not defined. (gdb) tb test::f Breakpoint 1 at 0x804867c: file main.cc, line 11. I'm wondering if gdb supports ADL. In a big program, it might not be easy for me to find out which namespace is the function "f" in. If gdb support ADL, it would save user a lot of time. Thanks, Peng #include namespace test { struct A { A() : x(10) { } int x; }; void f(const A &a) { std::cout << a.x << std::endl; } } int main(){ test::A a; f(a);//do not have to write test::f }