diff options
author | Tom Tromey <tromey@adacore.com> | 2024-03-07 12:57:07 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-04-02 11:37:32 -0600 |
commit | 251cedaeb57fe1e0fd28798f476fbee75373bbf4 (patch) | |
tree | 02b886a94fada4b080bf23c6dac2b8ae6401907a /gdb/testsuite | |
parent | 051889c8104c3c959b903d08e9afbcb7e9670c43 (diff) | |
download | gdb-251cedaeb57fe1e0fd28798f476fbee75373bbf4.zip gdb-251cedaeb57fe1e0fd28798f476fbee75373bbf4.tar.gz gdb-251cedaeb57fe1e0fd28798f476fbee75373bbf4.tar.bz2 |
Print type name when printing Rust slice
The recent change to how unsized Rust values are printed included a
small regression from past behavior. Previously, a slice's type would
be printed, like:
(gdb) print slice
$80 = &[i32] [3]
The patch changed this to just
(gdb) print slice
$80 = [3]
This patch restores the previous behavior.
Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30330
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31517
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.rust/simple.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.rust/unsized.exp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 7f5fbad..1e6fc94 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -317,7 +317,7 @@ proc test_one_slice {svar length base range} { global hex # Just accept any array here. - set result " = \\\[.*\\\]" + set result " = &\\\[.*\\\] \\\[.*\\\]" gdb_test "print $svar" $result gdb_test "print &${base}\[${range}\]" $result diff --git a/gdb/testsuite/gdb.rust/unsized.exp b/gdb/testsuite/gdb.rust/unsized.exp index fab6557..ea5f281 100644 --- a/gdb/testsuite/gdb.rust/unsized.exp +++ b/gdb/testsuite/gdb.rust/unsized.exp @@ -33,6 +33,6 @@ if {![runto ${srcfile}:$line]} { gdb_test "ptype us" " = .*V<\\\[u8\\\]>.*" if {[rust_at_least 1.61]} { - gdb_test "print us2" " = \\\[1, 2, 3\\\]" + gdb_test "print us2" " = .*u8.* \\\[1, 2, 3\\\]" gdb_test "ptype us2" "type = .*" } |