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/826: variables in C++ namespaces have to be enclosed in quotes


>Number:         826
>Category:       gdb
>Synopsis:       variables in C++ namespaces have to be enclosed in quotes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 14 16:58:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     carlton@math.stanford.edu
>Release:        GNU gdb 2002-10-11-cvs
>Organization:
>Environment:
any
>Description:
When referring to a variable in C++ code that is inside a namespace, you have to put it inside single quotes.
>How-To-Repeat:
Compile this file:

namespace C
{
  int x = 1;
}

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

Run GDB on it, and from within main, do:

(gdb) p C::x
No symbol "C" in current context.
(gdb) p 'C::x'
$1 = 1
>Fix:
A first step would be to associate symbols to namespaces themselves, not just to variables inside namespaces...
>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]