This is the mail archive of the
mailing list for the GDB project.
Re: namespace and argument dependent name lookup (ADL) in gdb
- From: Daniel Jacobowitz <drow at false dot org>
- To: Peng Yu <pengyu dot ut at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 12 Dec 2007 23:01:29 -0500
- Subject: Re: namespace and argument dependent name lookup (ADL) in gdb
- References: <firstname.lastname@example.org>
On Wed, Dec 12, 2007 at 09:38:53PM -0600, Peng Yu wrote:
> I don't have to write test::f in the following program because of
> 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.