summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.rust
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-09-13 10:56:34 -0600
committerTom Tromey <tom@tromey.com>2018-09-13 10:57:40 -0600
commit4a3fe98f885a2d1db804584e7ea265ab3ccef4d7 (patch)
tree26d5b44bfa4d40c4358b4b78b65f57e5552ae2ea /gdb/testsuite/gdb.rust
parent098b2108a2b61531c0bc8ea16854f773083a95d7 (diff)
downloadbinutils-gdb-4a3fe98f885a2d1db804584e7ea265ab3ccef4d7.tar.gz
Make Rust error message mention the field name
I noticed a spot in rust-lang.c where the placeholder "foo" was used instead of the actual field name. This patch fixes the bug. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23650: * rust-lang.c (rust_evaluate_subexp): Use field name, not "foo". gdb/testsuite/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23650: * gdb.rust/simple.exp: Add test for enum field access error.
Diffstat (limited to 'gdb/testsuite/gdb.rust')
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 07b25122200..956a6ca6fee 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -134,6 +134,8 @@ gdb_test "print univariant" " = simple::Univariant::Foo{a: 1}"
gdb_test "print univariant.a" " = 1"
gdb_test "print univariant_anon" " = simple::UnivariantAnon::Foo\\(1\\)"
gdb_test "print univariant_anon.0" " = 1"
+gdb_test "print univariant_anon.sss" \
+ "Attempting to access named field sss of tuple variant simple::UnivariantAnon::Foo, which has only anonymous fields"
gdb_test_sequence "ptype simple::Univariant" "" {
"type = enum simple::Univariant \\{"