old-cross-binutils/gdb/testsuite/gdb.cp
Tom Tromey 805e1f1908 fix PR c++/16117
This patch fixes PR c++/16117.

gdb has an extension so that users can use expressions like FILE::NAME
to choose a variable of the given name from the given file.  The bug
is that this extension takes precedence over ordinary C++ expressions
of the same form.  You might think this is merely hypothetical, but
now that C++ headers commonly do not use an extension, it is more
common.

This patch fixes the bug by making two related changes.  First, it
changes gdb to prefer the ordinary C++ meaning of a symbol over the
extended meaning.  Second, it arranges for single-quoting of the
symbol to indicate a preference for the extension.

Built and regtested on x86-64 Fedora 18.
New test case included.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	PR c++/16117:
	* c-exp.y (lex_one_token): Add "is_quoted_name" argument.
	(classify_name): Likewise.  Prefer a field of "this" over a
	filename.
	(classify_inner_name, yylex): Update.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Variables): Note gdb rules for ambiguous cases.
	Add example.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	* gdb.cp/includefile: New file.
	* gdb.cp/filename.exp: New file.
	* gdb.cp/filename.cc: New file.
2013-11-15 08:43:14 -07:00
..
abstract-origin.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
abstract-origin.exp
ambiguous.cc
ambiguous.exp
annota2.cc
annota2.exp
annota3.cc
annota3.exp
anon-ns.cc
anon-ns.exp
anon-struct.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
anon-struct.exp
anon-union.cc
anon-union.exp
arg-reference.cc
arg-reference.exp
baseenum.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
baseenum.exp
bool.cc
bool.exp
breakpoint.cc
breakpoint.exp
bs15503.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
bs15503.exp
call-c-1.c Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
call-c.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
call-c.exp
casts.cc
casts.exp
class2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
class2.exp
classes.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
classes.exp
cmpd-minsyms.cc
cmpd-minsyms.exp
converts.cc
converts.exp
cp-relocate.cc
cp-relocate.exp
cpcompletion.exp
cpexprs.cc
cpexprs.exp
cplabel.cc
cplabel.exp
cplusfuncs.cc
cplusfuncs.exp
ctti.exp
cttiadd.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd3.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
debug-expr.exp
demangle.exp
derivation.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
derivation.exp gdb.cp/derivation.exp: s/perrro/perror/ 2013-11-02 00:06:13 +00:00
derivation2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
destrprint.cc
destrprint.exp
dispcxx.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dispcxx.exp
exception.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
exception.exp
exceptprint.cc
exceptprint.exp
expand-psymtabs-cxx.cc
expand-psymtabs-cxx.exp
expand-sals.cc
expand-sals.exp
extern-c.cc
extern-c.exp
filename.cc fix PR c++/16117 2013-11-15 08:43:14 -07:00
filename.exp fix PR c++/16117 2013-11-15 08:43:14 -07:00
formatted-ref.cc
formatted-ref.exp
fpointer.cc
fpointer.exp
gdb1355.cc
gdb1355.exp Remove superfluous semicolons from testsuite throughout. 2013-06-07 17:31:09 +00:00
gdb2384-base.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384-base.h Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384.exp
gdb2495.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2495.exp
hang.exp
hang.H
hang1.cc
hang2.cc
hang3.cc
includefile fix PR c++/16117 2013-11-15 08:43:14 -07:00
infcall-dlopen-lib.cc
infcall-dlopen.cc
infcall-dlopen.exp
inherit.exp
koenig.cc
koenig.exp
local.cc
local.exp
m-data.cc
m-data.exp
m-static.cc
m-static.exp Print nonexisting/optimized out static fields gracefully. 2013-10-25 14:03:01 +00:00
m-static.h
m-static1.cc
maint.exp
Makefile.in
mb-ctor.cc
mb-ctor.exp
mb-inline.exp
mb-inline.h Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-inline1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-inline2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-templates.cc
mb-templates.exp
member-name.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
member-name.exp
member-ptr.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
member-ptr.exp
meth-typedefs.cc
meth-typedefs.exp
method.cc
method.exp
method2.cc
method2.exp
minsym-fallback-main.cc
minsym-fallback.cc
minsym-fallback.exp
minsym-fallback.h
misc.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
misc.exp Remove superfluous semicolons from testsuite throughout. 2013-06-07 17:31:09 +00:00
namespace-enum-main.cc
namespace-enum.cc
namespace-enum.exp
namespace-nested-import.cc
namespace-nested-import.exp
namespace.cc
namespace.exp
namespace1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
nextoverthrow.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
nextoverthrow.exp
no-dmgl-verbose.cc
no-dmgl-verbose.exp
noparam.cc
noparam.exp
nsalias.cc PR c++/7539 2013-11-13 12:33:34 -08:00
nsalias.exp PR c++/7539 2013-11-13 12:33:34 -08:00
nsdecl.cc
nsdecl.exp
nsimport.cc
nsimport.exp
nsnested.cc
nsnested.exp
nsnoimports.cc
nsnoimports.exp
nsrecurs.cc
nsrecurs.exp PR c++/7539 2013-11-13 12:33:34 -08:00
nsstress.cc
nsstress.exp
nsusing.cc
nsusing.exp
operator.cc
operator.exp
oranking.cc
oranking.exp
overload-const.cc
overload-const.exp
overload.cc
overload.exp
ovldbreak.cc
ovldbreak.exp
ovsrch.exp
ovsrch.h
ovsrch1.cc
ovsrch2.cc
ovsrch3.cc
ovsrch4.cc
paren-type.cc
paren-type.exp
parse-lang.cc
parse-lang.exp
pass-by-ref.cc
pass-by-ref.exp
pr-574.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
pr-574.exp
pr-1023.cc
pr-1023.exp
pr-1210.cc
pr-1210.exp
pr9067.cc
pr9067.exp
pr9167.cc
pr9167.exp
pr9594.cc
pr9631.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
pr9631.exp
pr10687.cc
pr10687.exp
pr10728-x.cc
pr10728-x.h
pr10728-y.cc
pr10728.exp
pr12028.cc
pr12028.exp
printmethod.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
printmethod.exp
psmang.exp
psmang1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psmang2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psymtab-parameter.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psymtab-parameter.exp
ptype-cv-cp.cc
ptype-cv-cp.exp
ptype-flags.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ptype-flags.exp
punctuator.exp
re-set-overloaded.cc
re-set-overloaded.exp
readnow-language.cc
readnow-language.exp
ref-params.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ref-params.exp
ref-types.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ref-types.exp
rtti.exp
rtti.h
rtti1.cc
rtti2.cc
shadow.cc
shadow.exp
smartp.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
smartp.exp
static-method.cc
static-method.exp
static-print-quit.cc
static-print-quit.exp
temargs.cc
temargs.exp
templates.cc
templates.exp
try_catch.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
try_catch.exp
typedef-operator.cc
typedef-operator.exp
typeid.cc
typeid.exp
userdef.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
userdef.exp
using-crash.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
using-crash.exp
virtbase.cc
virtbase.exp
virtfunc.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
virtfunc.exp
virtfunc2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
virtfunc2.exp