From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9iW3E93Ms2GmYwAAWB0awg (envelope-from ) for ; Fri, 10 Dec 2021 16:55:41 -0500 Received: by simark.ca (Postfix, from userid 112) id 3C6BE1F0D0; Fri, 10 Dec 2021 16:55:41 -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, NICE_REPLY_A,RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 8D3581ECEB for ; Fri, 10 Dec 2021 16:55:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28B863858031 for ; Fri, 10 Dec 2021 21:55:37 +0000 (GMT) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by sourceware.org (Postfix) with ESMTPS id 508BE3857C64 for ; Fri, 10 Dec 2021 21:55:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 508BE3857C64 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-f46.google.com with SMTP id u1so17121714wru.13 for ; Fri, 10 Dec 2021 13:55:24 -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:references:from:in-reply-to :content-transfer-encoding; bh=+LtYfQvyVqCN94SYkzx7RQ5hhRBrTv5SCndYmflnjzY=; b=z32HGBdCwsMcqiM0cogmrd57C0HVlGkwYVfZLa+rZL6a1EXPHeLVAGmLyHH7BjTmFe wC1G2pb1xhY4DK6V8pHk8/7bFfYk+5DtAeandKd4DiAT6QTtV89MmOuscZpTrvZEdfj8 tAZ6B5EQBEOV8ycJ9W5aXwYf9hesWhg43sAcK4h8bwNQBd8R41E14AnKKqolCWa3qEm0 MGDPxUwofiYSUofhiPc4Ur1Rq6dg0j/cHxOTUm7ye4uSouRMlGmTWLh80f2jVDuFRq7j AMB5OSOPSjl3A3DdSr7BB5X4qZspA4rrCsK8rWghO15ulhJt0gHXPOhPHOiVlU40/xs2 JZhA== X-Gm-Message-State: AOAM532csfCiTYE4PDImvoxvtNa36G0p1CCj2q7rqj2aRTsmcevgKCzq Bads72LMOHMFqInrGAKvThmS/FEh6so= X-Google-Smtp-Source: ABdhPJxhP0wcOn6Sjh33smQ7ssjU410iKiwcp/p+OWzQkpSC9m5iVolXTLoNOMt4Z9sZgwxwr/d3bw== X-Received: by 2002:a05:6000:1006:: with SMTP id a6mr420086wrx.493.1639173323267; Fri, 10 Dec 2021 13:55:23 -0800 (PST) Received: from ?IPV6:2001:8a0:f912:1a00:d3db:ac91:4b9e:1449? ([2001:8a0:f912:1a00:d3db:ac91:4b9e:1449]) by smtp.gmail.com with ESMTPSA id y12sm3513141wrn.73.2021.12.10.13.55.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 13:55:22 -0800 (PST) Message-ID: Date: Fri, 10 Dec 2021 21:55:20 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 05/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-child.exp Content-Language: en-US To: Lancelot SIX , gdb-patches@sourceware.org References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-6-lsix@lancelotsix.com> From: Pedro Alves In-Reply-To: <20211126230038.103225-6-lsix@lancelotsix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-11-26 23:00, Lancelot SIX via Gdb-patches wrote: > # 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" > + "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" 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" ... set expr "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" mi_list_varobj_children $expr { [list [string_to_regexp $expr]] \ {\*\*\*char_ptr} 1 {char \*}} } "get children of $expr"