From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24340 invoked by alias); 13 Dec 2007 04:02:20 -0000 Received: (qmail 24323 invoked by uid 22791); 13 Dec 2007 04:02:18 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Dec 2007 04:01:46 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D795498052; Thu, 13 Dec 2007 04:01:41 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E7E0198022; Thu, 13 Dec 2007 04:01:40 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1J2fGL-00071T-NQ; Wed, 12 Dec 2007 23:01:29 -0500 Date: Thu, 13 Dec 2007 04:02:00 -0000 From: Daniel Jacobowitz To: Peng Yu Cc: gdb@sourceware.org Subject: Re: namespace and argument dependent name lookup (ADL) in gdb Message-ID: <20071213040129.GA26901@caradoc.them.org> Mail-Followup-To: Peng Yu , gdb@sourceware.org References: <366c6f340712121938j2fc71e6dmf69a9395ca6d8f6f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <366c6f340712121938j2fc71e6dmf69a9395ca6d8f6f@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-12-11) 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/msg00085.txt.bz2 On Wed, Dec 12, 2007 at 09:38:53PM -0600, Peng Yu wrote: > 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. That's not Koenig lookup. There's no arguments. If you were already in the namespace 'test', GDB would search it. > 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. GDB supports some kinds of context-sensitive lookup, but not this one. It is too complex to reconstruct the necessary information in the debugger to do accurate name lookup. -- Daniel Jacobowitz CodeSourcery