From 36b11add17bf287b541a107ee64f7e313e77092f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sun, 9 Oct 2011 19:41:17 +0000 Subject: gdb/ Support @entry in input expressions. * c-exp.y (ENTRY, unknown_cpp_name): New. (exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'. (unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY) (variable: name_not_typename '@' ENTRY, name: ENTRY) (name_not_typename: ENTRY): New. (yylex): Recognize ENTRY. * eval.c (evaluate_subexp_standard): Support also OP_VAR_ENTRY_VALUE. * expprint.c (print_subexp_standard, dump_subexp_body_standard): Likewise. * parse.c (operator_length_standard): Likewise. * std-operator.def: New operator OP_VAR_ENTRY_VALUE. gdb/doc/ Support @entry in input expressions. * gdb.texinfo (Variables): Describe @entry names suffix. (Print Settings): Add anchor for `set print entry-values'. gdb/testsuite/ Support @entry in input expressions. * gdb.arch/amd64-entry-value.exp (entry: p i@entry, entry: p j@entry) (entry_stack: p s1@entry, entry_stack: p s2@entry) (entry_stack: p d9@entry, entry_stack: p da@entry, tailcall: p i@entry) (tailcall: p j@entry): New tests. * gdb.cp/koenig.cc (A::entry): New function. (main): Call it. * gdb.cp/koenig.exp (p entry (c)): New test. --- gdb/testsuite/gdb.cp/koenig.cc | 6 ++++++ gdb/testsuite/gdb.cp/koenig.exp | 3 +++ 2 files changed, 9 insertions(+) (limited to 'gdb/testsuite/gdb.cp') diff --git a/gdb/testsuite/gdb.cp/koenig.cc b/gdb/testsuite/gdb.cp/koenig.cc index e2190f1..01e2637 100644 --- a/gdb/testsuite/gdb.cp/koenig.cc +++ b/gdb/testsuite/gdb.cp/koenig.cc @@ -24,6 +24,11 @@ namespace A return 33; } + int + entry (C c) + { + return 44; + } } struct B @@ -245,6 +250,7 @@ main () A::first (c); first (0, c); second (0, 0, c, 0, 0); + entry (c); A::first (b.c); E::O eo; diff --git a/gdb/testsuite/gdb.cp/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp index 7d5e5ab..6ee3562 100644 --- a/gdb/testsuite/gdb.cp/koenig.exp +++ b/gdb/testsuite/gdb.cp/koenig.exp @@ -33,6 +33,9 @@ gdb_test "p first(c)" "= 11" # the qualifying parameter gdb_test "p second(0,0,c,0,0)" "= 33" +# Test the name "entry" being used for `variablename@entry' entry values. +gdb_test "p entry (c)" " = 44" + # Test that koenig lookup finds correct function # even if it is overloaded gdb_test "p first(0,c)" "= 22" -- cgit v1.1