aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-07-21 10:03:09 +0200
committerTom de Vries <tdevries@suse.de>2024-07-21 10:03:09 +0200
commitad88661d55f3e62d90c44c8c286223db9aa76a77 (patch)
tree008bf3184865e1804b5223bcbbb9f94169b39e4a
parentd2f8ed901998a687d52dc308bbcc4a46699b4c2a (diff)
downloadfsf-binutils-gdb-ad88661d55f3e62d90c44c8c286223db9aa76a77.zip
fsf-binutils-gdb-ad88661d55f3e62d90c44c8c286223db9aa76a77.tar.gz
fsf-binutils-gdb-ad88661d55f3e62d90c44c8c286223db9aa76a77.tar.bz2
[gdb/testsuite] Fix scopes check in gdb.dap/rust-slices.exp
When running test-case gdb.dap/rust-slices.exp on aarch64-linux (debian 12/bookworm), I run into: ... {"request_seq": 6, "type": "response", "command": "scopes", "body": {"scopes": [{"variablesReference": 1, "name": "Locals", "presentationHint": "locals", "expensive": false, "namedVariables": 3, "line": 28, "source": {"name": "rust-slices.rs", "path": "/home/linux/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/rust-slices.rs"}}, {"variablesReference": 2, "name": "Registers", "presentationHint": "registers", "expensive": false, "namedVariables": 261, "line": 28, "source": {"name": "rust-slices.rs", "path": "/home/linux/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/rust-slices.rs"}}]}, "success": true, "seq": 20}PASS: gdb.dap/rust-slices.exp: get scopes success FAIL: gdb.dap/rust-slices.exp: three scopes PASS: gdb.dap/rust-slices.exp: scope is locals PASS: gdb.dap/rust-slices.exp: locals presentation hint PASS: gdb.dap/rust-slices.exp: three vars in scope ... The test-case expects three scopes due to a rust compiler issue: ... # There are three scopes because an artificial symbol ends up in the # DWARF. See https://github.com/rust-lang/rust/issues/125126. gdb_assert {[llength $scopes] == 3} "three scopes" ... but it seems that the version used here (rustc 1.63.0, llvm 14.0.6) doesn't have this issue. Fix this by allowing two or three scopes, and changing the test name to "two scopes". Tested on aarch64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com> PR testsuite/31983 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31983
-rw-r--r--gdb/testsuite/gdb.dap/rust-slices.exp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.dap/rust-slices.exp b/gdb/testsuite/gdb.dap/rust-slices.exp
index d3bd305..4af8c11 100644
--- a/gdb/testsuite/gdb.dap/rust-slices.exp
+++ b/gdb/testsuite/gdb.dap/rust-slices.exp
@@ -59,9 +59,9 @@ set scopes [dap_check_request_and_response "get scopes" scopes \
[format {o frameId [i %d]} $frame_id]]
set scopes [dict get [lindex $scopes 0] body scopes]
-# There are three scopes because an artificial symbol ends up in the
-# DWARF. See https://github.com/rust-lang/rust/issues/125126.
-gdb_assert {[llength $scopes] == 3} "three scopes"
+# There may be three scopes instead of two if an artificial symbol ends up in
+# the DWARF. See https://github.com/rust-lang/rust/issues/125126.
+gdb_assert { [llength $scopes] == 2 || [llength $scopes] == 3 } "two scopes"
lassign $scopes scope ignore
gdb_assert {[dict get $scope name] == "Locals"} "scope is locals"