This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/838: GDB doesn't do Koenig lookup


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]