From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uFboFgCKvGH9CgAAWB0awg (envelope-from ) for ; Fri, 17 Dec 2021 08:00:48 -0500 Received: by simark.ca (Postfix, from userid 112) id 4DEA61F0CE; Fri, 17 Dec 2021 08:00:48 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4BC3F1EDEE for ; Fri, 17 Dec 2021 08:00:46 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5861B3858435 for ; Fri, 17 Dec 2021 13:00:45 +0000 (GMT) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by sourceware.org (Postfix) with ESMTPS id B26B13858D28 for ; Fri, 17 Dec 2021 13:00:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B26B13858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f48.google.com with SMTP id t26so3913825wrb.4 for ; Fri, 17 Dec 2021 05:00:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=dVL889sqzzMWLYf8B1TX3GEVyGLyu6Md6obGB0sWIYM=; b=6m3suf78M50DkNMzHCCb4AWli3wg2ufUX9OJf1dTg474nJEgijpdE88FCUCDk1QPit mZVf0tbFCDphG3zT4qKgqcogKJqkSoqZrqnA0CeRMN2CIWTgbrupLzoRfjT7RCKEC/aT zWg22LUREbREAYb3eS7SjlOxGYEfLEs0+1AWIatv0CQJvS5bmJjDS/slcj5qRC6OKRh9 v65EgwQ9zRby9Gol6ByArwXTfgXTuflN4rvhZf3YMd84gFZA7mdtR6RP0GYOwRnVW+Xg bmSeUWAK9AunfPZD3O1xkRKlBi67zabwoJf+3GKXZYFzCkMXwf+ogGSWm1SmyzJbNQsZ DdGA== X-Gm-Message-State: AOAM531p4DiDJlWkvx5ii4Ni2lFX8jSA3lN/NaefW2pziggU6Ax4LKrQ WrM9aqAGEskv9hDHNDG2CkUhSC4Tkro= X-Google-Smtp-Source: ABdhPJwS7tLIVjf4VZffT0uR5ZMPYmUsQq6I0h+TYXX/uzOj2uY/VBn7IrDJ7b24JAUPfa6po+Vp4g== X-Received: by 2002:adf:ea0d:: with SMTP id q13mr2378761wrm.597.1639746026450; Fri, 17 Dec 2021 05:00:26 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:fb57:3faf:e98:b979? ([2001:8a0:f912:1a00:fb57:3faf:e98:b979]) by smtp.gmail.com with ESMTPSA id n24sm7181334wms.45.2021.12.17.05.00.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Dec 2021 05:00:25 -0800 (PST) Message-ID: <55e612b6-645a-b044-da7c-a2ee48298de0@palves.net> Date: Fri, 17 Dec 2021 13:00:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: [PATCH] gdb/testsuite: Remove some duplication from gdb.mi/mi-var-child.exp Content-Language: en-US To: Lancelot SIX References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-6-lsix@lancelotsix.com> <20211216234049.zendtecxswjceyki@Plymouth> From: Pedro Alves In-Reply-To: <20211216234049.zendtecxswjceyki@Plymouth> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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 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