This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/831: GDB doesn't know about using declarations
- From: carlton at math dot stanford dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 15 Nov 2002 23:13:55 -0000
- Subject: gdb/831: GDB doesn't know about using declarations
- Reply-to: carlton at math dot stanford dot edu
>Number: 831
>Category: gdb
>Synopsis: GDB doesn't know about using declarations
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 15 15:18: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 using declarations in C++.
(Using declarations are where you import names from
a namespace individually, as opposed to importing the
whole lot at once: the latter is a using directive.)
>How-To-Repeat:
Compile this file:
namespace A {
int x = 1;
int y = 2;
}
using A::x;
int main()
{
x;
//y;
A::y;
return 0;
}
Run GDB on it, and try to print out x.
(gdb) b main
Breakpoint 1 at 0x80484a0: file using-decl.cc, line 14.
(gdb) run
Starting program: /cartan/carlton/sync/gdb-backup/namespace/prs/using-decl
Breakpoint 1, main () at using-decl.cc:14
14 return 0;
(gdb) p x
No symbol "x" in current context.
>Fix:
A good first step would be for GCC to generate the relevant
debugging info.
>Release-Note:
>Audit-Trail:
>Unformatted: