This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/826: variables in C++ namespaces have to be enclosed in quotes
- From: carlton at math dot stanford dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 15 Nov 2002 00:56:45 -0000
- Subject: gdb/826: variables in C++ namespaces have to be enclosed in quotes
- Reply-to: carlton at math dot stanford dot edu
>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: