From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8BE503858D1E for ; Tue, 2 May 2023 13:50:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BE503858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683035449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZWa9zsjuMoMYc4z2cIob8LjpXcEgOK8wv6OHsZzGR6I=; b=TSMQlPmwJGjX0c+9CWdOjIghmsgIOeAip1tTF5JGOLn1F9ozjQe1GjPUxMp5UMd8RafoPQ IptMlZb1GpQCUMzGNQthSKe+0uotj2xXt1jsF2LhSq4qTGaiBnZLMYJM3/jqxoLZV2lFYM PT4jbydJ9J/sOaahHIC2AyLj8k+eNO8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-UeZZHF-IMdKRc_hlhOknEQ-1; Tue, 02 May 2023 09:50:48 -0400 X-MC-Unique: UeZZHF-IMdKRc_hlhOknEQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f1754de18cso23516305e9.1 for ; Tue, 02 May 2023 06:50:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683035447; x=1685627447; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=0e+9apIN1hEv+LK3TEMrCPdBhYsvfRHc61jJRJoxN2w=; b=aR9+mhS7KwnmtsHKGE+sz48TQ+Xw2Zx7TMxH4qpof0FgQGtgFeNJzQBl22Qm38h+vL Yu6eVJhNSiW8/NyA5abS/jcnrI+9EITkbZJ7tOZmZeKQhJtttGrsHlCAuHCNSiG9A2+z TNvrI/24aWKLKqzsgT/fuRZo680HQ5tDGgRhKtHWulD0rX+swpFQIaGCtJ3tn9LXed79 olpB6HBMwEsh6HPd6kYx12ZqkUo48FmGlLZo73ytQ0un/Za8sizU4N40WZjUEhAF3324 IEdo/mAjsZeKnGZWUBrEBbiw9NT0PpNH/2MdVw0vzDuFx+SguTbEq2V4Lsb7f8XwyxfH vILw== X-Gm-Message-State: AC+VfDzvL59uGYtEQe85i5OLRpsBO+vFqXmOtzd1zJLjAtBQ8/JQfh2i EwOUCZ6iZv2X1JSlk2cHnOdkdNUcqZHDsHAx5I7nXq1yvvvQ0iDU40nl6Tatb8n1EzKjfDjPI+K RqHak9oS1W5cJR5mqcHT9LGzx21lIqg== X-Received: by 2002:a05:600c:2941:b0:3f2:5777:27d4 with SMTP id n1-20020a05600c294100b003f2577727d4mr11772899wmd.25.1683035446914; Tue, 02 May 2023 06:50:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mvwLBoG7MYhs10oUnqmp6yk9e7GfK0dglbGxw+2P6ybIkGAaFLMpdUMw9q/7wSXQiTCbKuQ== X-Received: by 2002:a05:600c:2941:b0:3f2:5777:27d4 with SMTP id n1-20020a05600c294100b003f2577727d4mr11772892wmd.25.1683035446627; Tue, 02 May 2023 06:50:46 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c181000b003f046ad52efsm38747849wmp.31.2023.05.02.06.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:50:46 -0700 (PDT) From: Andrew Burgess To: Alexandra =?utf-8?B?SMOhamtvdsOh?= , gdb-patches@sourceware.org Subject: Re: [PATCH v2] gdb.base/watchpoint-unaligned.exp: Always initialize wpoffset_to_wpnum In-Reply-To: <20230425104732.126979-1-ahajkova@redhat.com> References: <20230412210846.127441-1-ahajkova@redhat.com> <20230425104732.126979-1-ahajkova@redhat.com> Date: Tue, 02 May 2023 14:50:45 +0100 Message-ID: <87r0ry970q.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Alexandra H=C3=A1jkov=C3=A1 via Gdb-patches wr= ites: > to avoid TCL error which happens in some aarch64 types. Commit messages should ideally be written as proper sentences, so start with a capital letter. > > ERROR: in testcase /root/build/gdb/testsuite/../../../binutils-gdb/gdb/te= stsuite/gdb.base/watchpoint-unaligned.exp > ERROR: can't read "wpoffset_to_wpnum(1)": no such element in array > ERROR: tcl error code TCL READ VARNAME > ERROR: tcl error info: > can't read "wpoffset_to_wpnum(1)": no such element in array > while executing > > Fixes bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30340 Looking through the commit log there's only one other instances of 'Fixes bug:', the GDB style is usually just 'Bug:' -- being consistent makes it much easier to search for these labels. Also, at one point we had to reference the traditional bug tag in order to get this commit automatically linked with the bugzilla report - so we needed to include something like 'PR gdb/30340'. I don't know if this is still needed or not -- I've never bothered to find out as I just include both forms. > --- > The test uses gdb_test_multiple, and there are plenty of other reasons (s= ee gdb_test_multiple in lib/gdb.exp) that a test using gdb_test_multiple mi= ght fail. We're never going to recreate each of those in the gdb.base/watc= hpoint-unaligned.exp script just so that we can ensure the variable is init= ialized. Instead we should just ensure the variable is always initialized. It's not clear if this is intended to be part of the commit message or not. It seems like there's helpful text in here, but it's not wrapped to a reasonable width. That said, for such a small change, maybe we don't need to include any additional text, folk can just figure out what's going on from the code change. > =20 > gdb/testsuite/gdb.base/watchpoint-unaligned.exp | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsu= ite/gdb.base/watchpoint-unaligned.exp > index ce5a1e5bf66..d31a9cdc2c8 100644 > --- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp > +++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp > @@ -103,6 +103,8 @@ foreach wpcount {4 7} { > for {set wpoffset 1} {$wpoffset <=3D $wpcount} {incr wpoffset} { > =09set test "$rwatch data.u.size1\[$wpoffset\]" > =09set wpnum "" > +=09# Initialize the result incase the test fails. > +=09set wpoffset_to_wpnum($wpoffset) 0 > =09gdb_test_multiple $test $test { > =09 -re "$rwatch_exp (\[0-9\]+): .*\r\n$gdb_prompt $" { > =09=09set wpoffset_to_wpnum($wpoffset) $expect_out(1,string) > @@ -113,7 +115,6 @@ foreach wpcount {4 7} { > =09=09 setup_xfail breakpoints/23131 "arm*-*-*" > =09=09} > =09=09fail $test > -=09=09set wpoffset_to_wpnum($wpoffset) 0 > =09 } > =09} > } The change itself looks great. Reviewed-By: Andrew Burgess Thanks, Andrew > --=20 > 2.40.0