This is the mail archive of the
mailing list for the GDB project.
Re: namespace and argument dependent name lookup (ADL) in gdb
On Dec 12, 2007 10:01 PM, Daniel Jacobowitz <firstname.lastname@example.org> wrote:
> 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.
Why there is no argument? a is f's argument.
> If you were already
> in the namespace 'test', GDB would search it.
What if I'm in the function body of "main"?
> > 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.
What is the best strategy to debug su