This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/838: GDB doesn't do Koenig lookup
- From: carlton at math dot stanford dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 19 Nov 2002 22:22:23 -0000
- Subject: gdb/838: GDB doesn't do Koenig lookup
- Reply-to: carlton at math dot stanford dot edu
>Number: 838
>Category: gdb
>Synopsis: GDB doesn't do Koenig lookup
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 19 14:28:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: carlton@math.stanford.edu
>Release: GNU gdb 2002-11-15-cvs
>Organization:
>Environment:
any
>Description:
GDB doesn't know about Koenig lookup in C++. (Koenig lookup
tells the compiler to search in extra namespaces when trying
to find a function, based on the namespaces that the types
of its args live in.)
>How-To-Repeat:
Compile the following file:
namespace A {
class C {
};
void foo(C arg)
{
}
}
int main()
{
A::C theC;
foo(theC);
}
Run GDB on it, and try to print out foo(theC) (as
opposed to, say, 'A::foo'(theC).
(gdb) b main
Breakpoint 1 at 0x80484a6: file koenig.cc, line 14.
(gdb) r
Starting program: /cartan/carlton/sync/gdb-backup/namespace/prs/koenig
Breakpoint 1, main () at koenig.cc:14
14 foo(theC);
(gdb) p foo(theC)
No symbol "foo" in current context.
(gdb) p 'A::foo'(theC)
$1 = void
>Fix:
This will take a little while...
>Release-Note:
>Audit-Trail:
>Unformatted: