Update gdb.rust tests for Rust 1.49

Rust 1.49 was released today, and it includes some library changes
which caused some gdb.rust tests to fail.  This patch adapts the test
suite to the new output.  I also verified that this continues to work
with Rust 1.48.

gdb/testsuite/ChangeLog
2020-12-31  Tom Tromey  <tom@tromey.com>

	* gdb.rust/simple.exp: Update output for Rust 1.49.
This commit is contained in:
Tom Tromey 2020-12-31 14:55:27 -07:00
parent cab3f4da68
commit 9b243007ba
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2020-12-31 Tom Tromey <tom@tromey.com>
* gdb.rust/simple.exp: Update output for Rust 1.49.
2020-12-31 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gdb.cp/step-and-next-inline.exp: Fix test case.

View File

@ -262,8 +262,14 @@ gdb_test_multiple "print str_none" "" {
gdb_test "print int_some" " = core::option::Option<u8>::Some\\(1\\)"
gdb_test "print int_none" " = core::option::Option<u8>::None"
gdb_test "print box_some" " = core::option::Option<\[a-z:\]*Box<u8>>::Some\\(.*\\)"
gdb_test "print box_none" " = core::option::Option<\[a-z:\]*Box<u8>>::None"
# The result expressions are a bit lax here, to handle the fact that
# the output varies between Rust versions. Mostly we just want to
# check for the presence "Option", "Box", "u8", and either "Some" or
# "None".
gdb_test "print box_some" \
" = core::option::Option<\[a-z:\]*Box<u8.*>>::Some\\(.*\\)"
gdb_test "print box_none" \
" = core::option::Option<\[a-z:\]*Box<u8.*>>::None"
set pass_pattern \
" = simple::NonZeroOptimized::Value\\(\[a-z\]+::string::String .*"
@ -332,11 +338,11 @@ gdb_test "print (1)" " = 1"
gdb_test "print 23..97.0" "Range expression with different types"
gdb_test "print (*parametrized.next.val)" \
" = simple::ParametrizedStruct<i32> {next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Empty, value: 1}"
" = simple::ParametrizedStruct<i32> {next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>.*>>::Empty, value: 1}"
gdb_test "print parametrized.next.val" \
" = \\(\\*mut simple::ParametrizedStruct<i32>\\) $hex"
gdb_test "print parametrized" \
" = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"
" = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>.*>>::Val\\{val: $hex\\}, value: 0\\}"
gdb_test_sequence "ptype/o SimpleLayout" "" {
"/\\* offset | size \\*/ type = struct simple::SimpleLayout {"