From: Pedro Alves <pedro@palves.net>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: [PATCH] gdb/testsuite: Remove some duplication from gdb.mi/mi-var-child.exp
Date: Fri, 17 Dec 2021 13:00:23 +0000 [thread overview]
Message-ID: <55e612b6-645a-b044-da7c-a2ee48298de0@palves.net> (raw)
In-Reply-To: <20211216234049.zendtecxswjceyki@Plymouth>
On 2021-12-16 23:40, Lancelot SIX wrote:
>>
>> Did you consider using variables to eliminate risk of these ever diverging? Something like:
>>
>> set expr "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr"
>> mi_gdb_test "-var-info-num-children $expr" \
>> "\\^done,numchild=\"0\"" \
>> "get number of children of $expr"
>>
>> ...
>
> Actually, not that much. This file is 1k+ lines with plenty of tests
> just like this one. Do not get me wrong, doing this would be a big
> plus, but given the extend of changes I would think it is a bit out of
> the scope of what I want to achieve.
>
> Do you mind if I postpone this refactoring? i.e. I get it out of my
> mind until next time I have to come back to this file, or want to spend
> time just doing this.
That is certainly fine. Please go ahead with what you had.
I gave it another look, and noticed that at least the "get number of children" tests
can be easily factored out, like below. This applies on top of your patch.
WDYT?
From 1fe228ef69838a1687692b45c4d6b7f4d34be5de Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Fri, 17 Dec 2021 11:00:31 +0000
Subject: [PATCH] gdb/testsuite: Remove some duplication from
gdb.mi/mi-var-child.exp
Add a new procedure to test -var-info-num-children, reducing
duplication throughout.
There are no gdb.sum message changes after this.
Tested on x86_64-linux.
Change-Id: I0767d8abdb2045e4eaabd8e935e862d9a4e4ebe2
---
gdb/testsuite/gdb.mi/mi-var-child.exp | 238 ++++++++------------------
1 file changed, 73 insertions(+), 165 deletions(-)
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index cec433a4c8c..0ee2d98c2cd 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -43,6 +43,14 @@ mi_runto do_children_tests
set line_dlt_first_real [gdb_get_line_number "weird = &struct_declarations;"]
mi_continue_to_line $line_dlt_first_real "step to real start of do_children_test"
+# Check that -var-info-num-children reports EXPECTED children for
+# EXPRESSION.
+
+proc test_number_of_children {expression expected} {
+ mi_gdb_test "-var-info-num-children $expression" \
+ "\\^done,numchild=\"$expected\"" \
+ "get number of children of $expression"
+}
##### #####
# #
@@ -81,9 +89,7 @@ mi_list_varobj_children "struct_declarations" {
# Test: c_variable-4.4
# Desc: number of children of struct_declarations
-mi_gdb_test "-var-info-num-children struct_declarations" \
- "\\^done,numchild=\"11\"" \
- "get number of children of struct_declarations"
+test_number_of_children "struct_declarations" 11
# Test: c_variable-4.5
# Desc: children of struct_declarations.integer
@@ -92,9 +98,7 @@ mi_list_varobj_children "struct_declarations.integer" {} \
# Test: c_variable-4.6
# Desc: number of children of struct_declarations.integer
-mi_gdb_test "-var-info-num-children struct_declarations.integer" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.integer"
+test_number_of_children "struct_declarations.integer" 0
# Test: c_variable-4.7
# Desc: children of struct_declarations.character
@@ -103,9 +107,7 @@ mi_list_varobj_children "struct_declarations.character" {} \
# Test: c_variable-4.8
# Desc: number of children of struct_declarations.character
-mi_gdb_test "-var-info-num-children struct_declarations.character" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.character"
+test_number_of_children "struct_declarations.character" 0
# Test: c_variable-4.9
# Desc: children of struct_declarations.char_ptr
@@ -115,9 +117,7 @@ mi_list_varobj_children "struct_declarations.char_ptr" {
# Test: c_variable-4.10
# Desc: number of children of struct_declarations.char_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of struct_declarations.char_ptr"
+test_number_of_children "struct_declarations.char_ptr" 1
# Test: c_variable-4.11
# Desc: children of struct_declarations.long_int
@@ -126,9 +126,7 @@ mi_list_varobj_children "struct_declarations.long_int" {} \
# Test: c_variable-4.12
# Desc: number of children of struct_declarations.long_int
-mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_int"
+test_number_of_children "struct_declarations.long_int" 0
# Test: c_variable-4.13
# Desc: children of int_ptr_ptr
@@ -142,9 +140,7 @@ mi_list_varobj_children "struct_declarations.int_ptr_ptr" {
# Test: c_variable-4.14
# Desc: number of children of int_ptr_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of struct_declarations.int_ptr_ptr"
+test_number_of_children "struct_declarations.int_ptr_ptr" 1
# Test: c_variable-4.15
@@ -155,9 +151,7 @@ mi_list_array_varobj_children "struct_declarations.long_array" 12 \
# Test: c_variable-4.16
# Desc: number of children of struct_declarations.long_array
-mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
- "\\^done,numchild=\"12\"" \
- "get number of children of struct_declarations.long_array"
+test_number_of_children "struct_declarations.long_array" 12
# Test: c_variable-4.17
# Desc: children of struct_declarations.func_ptr
@@ -166,9 +160,7 @@ mi_list_varobj_children "struct_declarations.func_ptr" {} \
# Test: c_variable-4.18
# Desc: number of children of struct_declarations.func_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.func_ptr"
+test_number_of_children "struct_declarations.func_ptr" 0
# Test: c_variable-4.19
@@ -178,9 +170,7 @@ mi_list_varobj_children "struct_declarations.func_ptr_struct" {} \
# Test: c_variable-4.20
# Desc: number of children of struct_declarations.func_ptr_struct
-mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.func_ptr_struct"
+test_number_of_children "struct_declarations.func_ptr_struct" 0
# Test: c_variable-4.21
@@ -190,9 +180,7 @@ mi_list_varobj_children "struct_declarations.func_ptr_ptr" {} \
# Test: c_variable-4.22
# Desc: number of children of struct_declarations.func_ptr_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.func_ptr_ptr"
+test_number_of_children "struct_declarations.func_ptr_ptr" 0
# Test: c_variable-4.23
# Desc: children of struct_declarations.u1
@@ -205,9 +193,7 @@ mi_list_varobj_children "struct_declarations.u1" {
# Test: c_variable-4.24
# Desc: number of children of struct_declarations.u1
-mi_gdb_test "-var-info-num-children struct_declarations.u1" \
- "\\^done,numchild=\"4\"" \
- "get number of children of struct_declarations.u1"
+test_number_of_children "struct_declarations.u1" 4
# Test: c_variable-4.25
# Desc: children of struct_declarations.s2
@@ -224,18 +210,14 @@ mi_list_varobj_children "struct_declarations.s2" {
# Test: c_variable-4.26
# Desc: number of children of struct_declarations.s2
-mi_gdb_test "-var-info-num-children struct_declarations.s2" \
- "\\^done,numchild=\"4\"" \
- "get number of children of struct_declarations.s2"
+test_number_of_children "struct_declarations.s2" 4
for {set i 1} {$i <= 9} {incr i} {
mi_list_varobj_children "struct_declarations.long_array.$i" {} \
"get children of struct_declarations.long_array.$i"
- mi_gdb_test "-var-info-num-children struct_declarations.long_array.$i" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.$i"
+ test_number_of_children "struct_declarations.long_array.$i" 0
}
# Test: c_variable-4.45
@@ -245,9 +227,7 @@ mi_list_varobj_children "struct_declarations.u1.a" {} \
# Test: c_variable-4.46
# Desc: number of children of struct_declarations.u1.a
-mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.u1.a"
+test_number_of_children "struct_declarations.u1.a" 0
# Test: c_variable-4.47
# Desc: children of struct_declarations.u1.b
@@ -257,9 +237,7 @@ mi_list_varobj_children "struct_declarations.u1.b" {
# Test: c_variable-4.48
# Desc: number of children of struct_declarations.u1.b
-mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
- "\\^done,numchild=\"1\"" \
- "get number of children of struct_declarations.u1.b"
+test_number_of_children "struct_declarations.u1.b" 1
# Test: c_variable-4.49
# Desc: children of struct_declarations.u1.c
@@ -268,9 +246,7 @@ mi_list_varobj_children "struct_declarations.u1.c" {} \
# Test: c_variable-4.50
# Desc: number of children of struct_declarations.u1.c
-mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.u1.c"
+test_number_of_children "struct_declarations.u1.c" 0
# Test: c_variable-4.51
# Desc: children of struct_declarations.u1.d
@@ -280,9 +256,7 @@ mi_list_varobj_children "struct_declarations.u1.d" {} \
# Test: c_variable-4.52
# Desc: number of children of struct_declarations.u1.d
-mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.u1.d"
+test_number_of_children "struct_declarations.u1.d" 0
# Test: c_variable-4.53
@@ -295,9 +269,7 @@ mi_list_varobj_children "struct_declarations.s2.u2" {
# Test: c_variable-4.54
# Desc: number of children of struct_declarations.s2.u2
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
- "\\^done,numchild=\"3\"" \
- "get number of children of struct_declarations.s2.u2"
+test_number_of_children "struct_declarations.s2.u2" 3
# Test: c_variable-4.55
# Desc: children of struct_declarations.s2.g
@@ -306,9 +278,7 @@ mi_list_varobj_children struct_declarations.s2.g {} \
# Test: c_variable-4.56
# Desc: number of children of struct_declarations.s2.g
-mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.g"
+test_number_of_children "struct_declarations.s2.g" 0
# Test: c_variable-4.57
@@ -318,9 +288,7 @@ mi_list_varobj_children struct_declarations.s2.h {} \
# Test: c_variable-4.58
# Desc: number of children of struct_declarations.s2.h
-mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.h"
+test_number_of_children "struct_declarations.s2.h" 0
# Test: c_variable-4.59
@@ -334,9 +302,7 @@ mi_list_varobj_children struct_declarations.s2.i $t \
# Test: c_variable-4.60
# Desc: number of children of struct_declarations.s2.i
-mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
- "\\^done,numchild=\"10\"" \
- "get number of children of struct_declarations.s2.i"
+test_number_of_children "struct_declarations.s2.i" 10
# Test: c_variable-4.61
# Desc: children of struct_declarations.s2.u2.u1s1
@@ -349,9 +315,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s1 {
# Test: c_variable-4.62
# Desc: number of children of struct_declarations.s2.u2.u1s1
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
- "\\^done,numchild=\"4\"" \
- "get number of children of struct_declarations.s2.u2.u1s1"
+test_number_of_children "struct_declarations.s2.u2.u1s1" 4
# Test: c_variable-4.63
# Desc: children of struct_declarations.s2.u2.f
@@ -360,9 +324,7 @@ mi_list_varobj_children struct_declarations.s2.u2.f {} \
# Test: c_variable-4.64
# Desc: number of children of struct_declarations.s2.u2.f
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.u2.f"
+test_number_of_children "struct_declarations.s2.u2.f" 0
# Test: c_variable-4.65
# Desc: children of struct_declarations.s2.u2.u1s2
@@ -373,9 +335,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s2 {
# Test: c_variable-4.66
# Desc: number of children of struct_declarations.s2.u2.u1s2
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
- "\\^done,numchild=\"2\"" \
- "get number of children of struct_declarations.s2.u2.u1s2"
+test_number_of_children "struct_declarations.s2.u2.u1s2" 2
# Test: c_variable-4.67
# Desc: children of struct_declarations.s2.u2.u1s1.d
@@ -384,9 +344,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s1.d {} \
# Test: c_variable-4.68
# Desc: number of children of struct_declarations.s2.u2.u1s1.d
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.u2.u1s1.d"
+test_number_of_children "struct_declarations.s2.u2.u1s1.d" 0
# Test: c_variable-4.69
# Desc: children of struct_declarations.s2.u2.u1s1.e
@@ -399,9 +357,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s1.e $t \
# Test: c_variable-4.70
# Desc: number of children of struct_declarations.s2.u2.u1s1.e
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
- "\\^done,numchild=\"10\"" \
- "get number of children of struct_declarations.s2.u2.u1s1.e"
+test_number_of_children "struct_declarations.s2.u2.u1s1.e" 10
# Test: c_variable-4.71
@@ -411,9 +367,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s1.func {} \
# Test: c_variable-4.72
# Desc: number of children of struct_declarations.s2.u2.u1s1.func
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.u2.u1s1.func"
+test_number_of_children "struct_declarations.s2.u2.u1s1.func" 0
# Test: c_variable-4.73
@@ -423,9 +377,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s1.foo {} \
# Test: c_variable-4.74
# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.u2.u1s1.foo"
+test_number_of_children "struct_declarations.s2.u2.u1s1.foo" 0
# Test: c_variable-4.75
@@ -437,9 +389,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s2.array_ptr {
# Test: c_variable-4.76
# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
- "\\^done,numchild=\"2\"" \
- "get number of children of struct_declarations.s2.u2.u1s2.array_ptr"
+test_number_of_children "struct_declarations.s2.u2.u1s2.array_ptr" 2
# Test: c_variable-4.77
# Desc: children of struct_declarations.s2.u2.u1s2.func
@@ -448,9 +398,7 @@ mi_list_varobj_children struct_declarations.s2.u2.u1s2.func {} \
# Test: c_variable-4.78
# Desc: number of children of struct_declarations.s2.u2.u1s2.func
-mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.s2.u2.u1s2.func"
+test_number_of_children "struct_declarations.s2.u2.u1s2.func" 0
# Test: c_variable-4.79
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
@@ -461,9 +409,7 @@ mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" {
# Test: c_variable-4.80
# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
-mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+test_number_of_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" 1
# Step to "struct_declarations.integer = 123;"
@@ -495,9 +441,7 @@ mi_list_varobj_children "weird" {
# Test: c_variable-4.83
# Desc: number of children of weird
-mi_gdb_test "-var-info-num-children weird" \
- "\\^done,numchild=\"11\"" \
- "get number of children of weird"
+test_number_of_children "weird" 11
# Test: c_variable-4.84
@@ -510,9 +454,7 @@ mi_list_array_varobj_children weird.long_array 12 "long" \
# Test: c_variable-4.85
# Desc: number of children of weird.long_array
-mi_gdb_test "-var-info-num-children weird.long_array" \
- "\\^done,numchild=\"12\"" \
- "get number of children of weird.long_array"
+test_number_of_children "weird.long_array" 12
# Test: c_variable-4.86
# Desc: children of weird.int_ptr_ptr
@@ -525,9 +467,7 @@ mi_list_varobj_children weird.int_ptr_ptr {
# Test: c_variable-4.87
# Desc: number of children of weird.int_ptr_ptr
-mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of weird.int_ptr_ptr"
+test_number_of_children "weird.int_ptr_ptr" 1
# Test: c_variable-4.88
# Desc: children of *weird->int_ptr_ptr
@@ -540,9 +480,7 @@ mi_list_varobj_children "weird.int_ptr_ptr.*int_ptr_ptr" {
# Test: c_variable-4.89
# Desc: number of children *weird->int_ptr_ptr
-mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of weird.int_ptr_ptr.*int_ptr_ptr"
+test_number_of_children "weird.int_ptr_ptr.*int_ptr_ptr" 1
# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
@@ -557,9 +495,7 @@ mi_list_varobj_children "weird->int_ptr_ptr" {
# Test: c_variable-4.92
# Desc: number of children of (weird->int_ptr_ptr)
-mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of weird->int_ptr_ptr"
+test_number_of_children "weird->int_ptr_ptr" 1
# Test: c_variable-4.93
# Desc: children of *(weird->int_ptr_ptr)
@@ -570,9 +506,7 @@ mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" {
# Test: c_variable-4.94
# Desc: number of children of *(weird->int_ptr_ptr)
-mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+test_number_of_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" 1
# Test: c_variable-4.95
# Desc: children of *(*(weird->int_ptr_ptr))
@@ -857,9 +791,7 @@ mi_list_varobj_children "psnp->char_ptr" {
# Test: c_variable-5.12
# Desc: number of children of psnp->char_ptr
-mi_gdb_test "-var-info-num-children psnp->char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->char_ptr"
+test_number_of_children "psnp->char_ptr" 1
# Test: c_variable-5.13
# Desc: children of *(psnp->char_ptr)
@@ -870,9 +802,7 @@ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" {
# Test: c_variable-5.14
# Desc: number of children of *(psnp->char_ptr)
-mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->char_ptr.*psnp->char_ptr"
+test_number_of_children "psnp->char_ptr.*psnp->char_ptr" 1
# Test: c_variable-5.15
# Desc: children of *(*(psnp->char_ptr))
@@ -883,9 +813,7 @@ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" {
# Test: c_variable-5.16
# Desc: number of children of *(*(psnp->char_ptr))
-mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+test_number_of_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" 1
# Test: c_variable-5.17
# Desc: children of *(*(*(psnp->char_ptr)))
@@ -896,9 +824,9 @@ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp
# Test: c_variable-5.18
# Desc: number of children of *(*(*(psnp->char_ptr)))
-mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+test_number_of_children \
+ "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ 1
# Test: c_variable-5.17B
# Desc: children of *(*(*(*(psnp->char_ptr))))
@@ -907,9 +835,9 @@ mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp
# Test: c_variable-5.18B
# Desc: number of children of *(*(*(*(psnp->char_ptr))))
-mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+test_number_of_children \
+ "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ 0
# Test: c_variable-5.19
# Desc: create psnp->long_ptr
@@ -924,9 +852,7 @@ mi_list_varobj_children "psnp->long_ptr" {
# Test: c_variable-5.21
# Desc: number of children of psnp->long_ptr
-mi_gdb_test "-var-info-num-children psnp->long_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->long_ptr"
+test_number_of_children "psnp->long_ptr" 1
# Test: c_variable-5.22
# Desc: children of *(psnp->long_ptr)
@@ -937,9 +863,7 @@ mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" {
# Test: c_variable-5.23
# Desc: number of children of *(psnp->long_ptr)
-mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->long_ptr.*psnp->long_ptr"
+test_number_of_children "psnp->long_ptr.*psnp->long_ptr" 1
# Test: c_variable-5.24
# Desc: children of *(*(psnp->long_ptr))
@@ -950,9 +874,7 @@ mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
# Test: c_variable-5.25
# Desc: number of children of *(*(psnp->long_ptr))
-mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+test_number_of_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" 1
# Test: c_variable-5.26
# Desc: children of *(*(*(psnp->long_ptr)))
@@ -963,9 +885,9 @@ mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp
# Test: c_variable-5.27
# Desc: number of children of *(*(*(psnp->long_ptr)))
-mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+test_number_of_children \
+ "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ 1
# Test: c_variable-5.28
# Desc: children of *(*(*(*(psnp->long_ptr))))
@@ -974,9 +896,9 @@ mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp
# Test: c_variable-5.29
# Desc: number of children of *(*(*(*(psnp->long_ptr))))
-mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+test_number_of_children \
+ "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ 0
# Test: c_variable-5.30
# Desc: create psnp->ptrs
@@ -993,9 +915,7 @@ mi_list_varobj_children "psnp->ptrs" {
# Test: c_variable-5.32
# Desc: number of children of psnp->ptrs
-mi_gdb_test "-var-info-num-children psnp->ptrs" \
- "\\^done,numchild=\"3\"" \
- "get number of children of psnp->ptrs"
+test_number_of_children "psnp->ptrs" 3
# Test: c_variable-5.33
# Desc: children of psnp->ptrs[0]
@@ -1008,9 +928,7 @@ mi_list_varobj_children "psnp->ptrs.0" {
# Test: c_variable-5.34
# Desc: number of children of psnp->ptrs[0]
-mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
- "\\^done,numchild=\"4\"" \
- "get number of children of psnp->ptrs.0"
+test_number_of_children "psnp->ptrs.0" 4
# Test: c_variable-5.35
# Desc: children of psnp->ptrs[0]->next
@@ -1025,9 +943,7 @@ mi_list_varobj_children "psnp->ptrs.0.next" {
# Test: c_variable-5.36
# Desc: number of children of psnp->ptrs[0]->next
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
- "\\^done,numchild=\"4\"" \
- "get number of children of psnp->ptrs.0.next"
+test_number_of_children "psnp->ptrs.0.next" 4
# Test: c_variable-5.37
@@ -1042,9 +958,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr" {
# Test: c_variable-5.38
# Desc: number of children of psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->ptrs.0.next.char_ptr"
+test_number_of_children "psnp->ptrs.0.next.char_ptr" 1
# Test: c_variable-5.39
# Desc: children of *psnp->ptrs[0]->next->char_ptr
@@ -1054,9 +968,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr" {
# Test: c_variable-5.40
# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+test_number_of_children "psnp->ptrs.0.next.char_ptr.*char_ptr" 1
# Test: c_variable-5.41
# Desc: children of **psnp->ptrs[0]->next->char_ptr
@@ -1067,9 +979,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" {
# Test: c_variable-5.42
# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+test_number_of_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" 1
# Test: c_variable-5.43
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
@@ -1080,9 +990,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char
# Test: c_variable-5.44
# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
- "\\^done,numchild=\"1\"" \
- "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+test_number_of_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" 1
# Test: c_variable-5.43B
# Desc: children of ****psnp->ptrs[0]->next->char_ptr
@@ -1091,9 +999,9 @@ mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char
# Test: c_variable-5.44B
# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr"
+test_number_of_children \
+ "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ 0
# Test: c_variable-5.45
# Desc: children of psnp->ptrs[0]->next->next
base-commit: 72994b6028360eccb5d25b39d2e18b386d091426
prerequisite-patch-id: 47ccdbc92dcdecc6aca9bf4388cfa9422e412470
--
2.26.2
next prev parent reply other threads:[~2021-12-17 13:00 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 23:00 [PATCH 00/12] Remove DUPLICATEs warnings Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 01/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-syn-frame.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 02/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nsthrexec.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 03/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-watch.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp Lancelot SIX via Gdb-patches
2021-12-10 21:55 ` Pedro Alves
2021-12-16 23:27 ` Lancelot SIX via Gdb-patches
2021-12-17 12:21 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 05/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-child.exp Lancelot SIX via Gdb-patches
2021-12-10 21:55 ` Pedro Alves
2021-12-16 23:40 ` Lancelot SIX via Gdb-patches
2021-12-17 13:00 ` Pedro Alves [this message]
2021-12-17 23:24 ` [PATCH] gdb/testsuite: Remove some duplication " Lancelot SIX via Gdb-patches
2022-01-06 16:44 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 06/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-var-child.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 07/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 08/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-16 23:48 ` Lancelot SIX via Gdb-patches
2021-12-17 13:52 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 09/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-rtti.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 10/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-language.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-16 23:59 ` Lancelot SIX via Gdb-patches
2021-12-17 13:53 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 11/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-17 22:57 ` Lancelot SIX via Gdb-patches
2022-01-06 16:49 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 12/12] gdb/testsuite: Remove duplicates from gdb.threads/staticthreads.ex Lancelot SIX via Gdb-patches
2021-12-09 18:15 ` [PATCH 00/12] Remove DUPLICATEs warnings Tom Tromey
2021-12-10 22:01 ` Pedro Alves
2022-01-07 22:43 ` Lancelot SIX via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55e612b6-645a-b044-da7c-a2ee48298de0@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox