aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dap/ptrref.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-11-13 14:03:58 -0700
committerTom Tromey <tromey@adacore.com>2023-11-17 08:36:21 -0700
commit4a1b9a4badc8954221926b231b81392fa625653c (patch)
tree3409a3a23cb794807111c654f226c870729cfe28 /gdb/testsuite/gdb.dap/ptrref.exp
parentcfd00e8050a58aacc6489ec0379908be1a12be73 (diff)
downloadgdb-4a1b9a4badc8954221926b231b81392fa625653c.zip
gdb-4a1b9a4badc8954221926b231b81392fa625653c.tar.gz
gdb-4a1b9a4badc8954221926b231b81392fa625653c.tar.bz2
Ignore static members in NoOpStructPrinter
Hannes' patch to show local variables in the TUI pointed out that NoOpStructPrinter should ignore static members. This patch implements this.
Diffstat (limited to 'gdb/testsuite/gdb.dap/ptrref.exp')
-rw-r--r--gdb/testsuite/gdb.dap/ptrref.exp9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.dap/ptrref.exp b/gdb/testsuite/gdb.dap/ptrref.exp
index e0cc745..456774a 100644
--- a/gdb/testsuite/gdb.dap/ptrref.exp
+++ b/gdb/testsuite/gdb.dap/ptrref.exp
@@ -55,7 +55,7 @@ gdb_assert {[llength $scopes] == 2} "two scopes"
lassign $scopes scope reg_scope
gdb_assert {[dict get $scope name] == "Locals"} "scope is locals"
-gdb_assert {[dict get $scope namedVariables] == 3} "three vars in scope"
+gdb_assert {[dict get $scope namedVariables] == 4} "three vars in scope"
set num [dict get $scope variablesReference]
set refs [lindex [dap_check_request_and_response "fetch variables" \
@@ -97,6 +97,13 @@ foreach var [dict get $refs body variables] {
"$name has exactly one child"
fetch_pointer $name $var
}
+ "aggregate" {
+ gdb_assert {[dict get $var variablesReference] != 0} \
+ "$name has children"
+ # This should omit the static field.
+ gdb_assert {[dict get $var namedVariables] == 2} \
+ "$name has exactly 2 children"
+ }
}
}