diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 19:41:17 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 19:41:17 +0000 |
commit | 36b11add17bf287b541a107ee64f7e313e77092f (patch) | |
tree | 10896f0386763977ee0ed611c252dac694387d88 /gdb/testsuite | |
parent | 3343315ba7c882c948decb9aaad83e4c048a4527 (diff) | |
download | gdb-36b11add17bf287b541a107ee64f7e313e77092f.zip gdb-36b11add17bf287b541a107ee64f7e313e77092f.tar.gz gdb-36b11add17bf287b541a107ee64f7e313e77092f.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-entry-value.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/koenig.cc | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/koenig.exp | 3 |
4 files changed, 28 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 74826cf..e3df529a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,16 @@ 2011-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> + 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. + +2011-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> + Display @entry parameter values (without references). * gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2) (different, validity, invalid): New functions. diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp index fcccdd8..10a82ab 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp @@ -51,7 +51,9 @@ gdb_continue_to_breakpoint "entry: breakhere" gdb_test "bt" "^bt\r\n#0 +d *\\(i=31, i@entry=30, j=31\\.5, j@entry=30\\.5\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in main .*" \ "entry: bt" gdb_test "p i" " = 31" "entry: p i" +gdb_test "p i@entry" " = 30" "entry: p i@entry" gdb_test "p j" { = 31\.5} "entry: p j" +gdb_test "p j@entry" { = 30\.5} "entry: p j@entry" # Test @entry values when parameter in function is locexpr (and not loclist). @@ -76,9 +78,13 @@ gdb_test "bt" "^bt\r\n#0 +stacktest *\\(r1=r1@entry=1, r2=r2@entry=2, \[^\r\n\]+ "entry_stack: bt" gdb_test "p s1" " = 3" "entry_stack: p s1" +gdb_test "p s1@entry" " = 11" "entry_stack: p s1@entry" gdb_test "p s2" " = 4" "entry_stack: p s2" +gdb_test "p s2@entry" " = 12" "entry_stack: p s2@entry" gdb_test "p d9" " = 3\\.5" "entry_stack: p d9" +gdb_test "p d9@entry" " = 11\\.5" "entry_stack: p d9@entry" gdb_test "p da" " = 4\\.5" "entry_stack: p da" +gdb_test "p da@entry" " = 12\\.5" "entry_stack: p da@entry" # Test various kinds of `set print entry-values'. @@ -159,7 +165,9 @@ gdb_continue_to_breakpoint "tailcall: breakhere" gdb_test "bt" "^bt\r\n#0 +d *\\(i=71, i@entry=70, j=73\\.5, j@entry=72\\.5\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in c \\(i=i@entry=7, j=j@entry=7\\.25\\) \[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in b \\(i=i@entry=5, j=j@entry=5\\.25\\) \[^\r\n\]*\r\n#3 +0x\[0-9a-f\]+ in main \[^\r\n\]*" \ "tailcall: bt" gdb_test "p i" " = 71" "tailcall: p i" +gdb_test "p i@entry" " = 70" "tailcall: p i@entry" gdb_test "p j" " = 73\\.5" "tailcall: p j" +gdb_test "p j@entry" " = 72\\.5" "tailcall: p j@entry" # Test $sp simulation for tail call frames. #gdb_test {p/x $sp} " = 0x.*" 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" |