aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-08-12 07:13:26 -0600
committerTom Tromey <tromey@adacore.com>2025-08-12 07:18:42 -0600
commit2bbe3bb5d938a83c871cdc995b5f8a9ff5bec100 (patch)
treeb3a8d47e2a02e0d4fa7896ac774f7756c596c02c
parentbbb7a2e2c579beda6fd4e81692b2fe90715ba884 (diff)
downloadbinutils-2bbe3bb5d938a83c871cdc995b5f8a9ff5bec100.zip
binutils-2bbe3bb5d938a83c871cdc995b5f8a9ff5bec100.tar.gz
binutils-2bbe3bb5d938a83c871cdc995b5f8a9ff5bec100.tar.bz2
Avoid scopes.exp failure on certain architectures
A buildbot pointed out that my changes to gdb.dap/scopes.exp caused a test failure. The new code iterates over all the registers, fetching their children (when possible). The failure comes because this code failed to consider that a register might have "indexed" children, which I believe can occur when a register is vector-like. This patch fixes the problem by arranging to fetch indexed children when indicated.
-rw-r--r--gdb/testsuite/gdb.dap/scopes.exp11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.dap/scopes.exp b/gdb/testsuite/gdb.dap/scopes.exp
index bce7746..52efa68 100644
--- a/gdb/testsuite/gdb.dap/scopes.exp
+++ b/gdb/testsuite/gdb.dap/scopes.exp
@@ -152,10 +152,17 @@ lassign [dap_check_request_and_response "fetch all registers" \
foreach var [dict get $val body variables] {
set regvar [dict get $var variablesReference]
if {$regvar > 0} {
+ # If variablesReference is non-zero, then there must be either
+ # named or indexed children.
+ if {[dict exists $var namedVariables]} {
+ set n [dict get $var namedVariables]
+ } else {
+ set n [dict get $var indexedVariables]
+ }
+
dap_check_request_and_response "fetch register children for $regvar" \
"variables" \
- [format {o variablesReference [i %d] count [i %d]} \
- $regvar [dict get $var namedVariables]]
+ [format {o variablesReference [i %d] count [i %d]} $regvar $n]
}
}