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/827: GDB doesn't know about namespace scope


>Number:         827
>Category:       gdb
>Synopsis:       GDB doesn't know about namespace scope
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 14 17:08:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     carlton@math.stanford.edu
>Release:        GNU gdb 2002-11-13-cvs
>Organization:
>Environment:
any
>Description:
GDB doesn't know about the C++ concept of 'namespace scope': if you're within a function defined in a namespace, it doesn't search for names defined in that namespace.

>How-To-Repeat:
Compile the following file:

namespace C
{
  int x = 1;
  void foo()
  {
    x;
  }
}

int main ()
{
  C::foo();
  
  return 0;
}

Then run GDB on it, and do the following:

(gdb) b 'C::foo'
Breakpoint 1 at 0x8048493: file scope.cc, line 7.
(gdb) run
Starting program: /cartan/carlton/sync/gdb-backup/namespace/prs/a.out 

Breakpoint 1, C::foo() () at scope.cc:7
7	  }
(gdb) p x
No symbol "x" in current context.
>Fix:
It works on carlton_dictionary_branch. :-)
>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]