This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[using-directive] Regression against FSF GDB
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>
- Cc: archer at sourceware dot org
- Date: Wed, 28 Jan 2009 21:29:04 +0100
- Subject: [using-directive] Regression against FSF GDB
Hi Sami,
I have noticed this regression during the demo. `print x' works in cases
where it should not.
Current archer-swagiaal-using-directive:
$ ./gdb -nx -q -ex start -ex 'p x' -ex q /tmp/alias
Temporary breakpoint 1 at 0x400560: file alias.C, line 10.
Starting program: /tmp/alias
Temporary breakpoint 1, main () at alias.C:10
10 return B::x;
$1 = 9
Current FSF GDB HEAD (+also F10):
$ .../gdb -nx -q -ex start -ex 'p x' -ex q /tmp/alias
Temporary breakpoint 1 at 0x400560: file alias.C, line 10.
Starting program: /tmp/alias
Temporary breakpoint 1, main () at alias.C:10
10 return B::x;
No symbol "x" in current context.
The program is running. Quit anyway (and kill it)? (y or n) y
$ cat /tmp/alias.C
namespace A
{
int x = 9;
}
namespace B=A;
int
main (void)
{
return B::x;
}
It can be verified by gcc-c++-4.3.2-7 the reference to bare `x' is not valid:
/tmp/alias2.C: In function ‘int main()’:
/tmp/alias2.C:10: error: ‘x’ was not declared in this scope
Thanks for a fix,
Jan