From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3onqLvWg7WZYgzEAWB0awg (envelope-from ) for ; Fri, 20 Sep 2024 12:21:09 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e5TLcUZM; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9C3291E353; Fri, 20 Sep 2024 12:21:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-12.8 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4C5341E05C for ; Fri, 20 Sep 2024 12:21:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE7D93858C98 for ; Fri, 20 Sep 2024 16:21:00 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id E04C33858D29 for ; Fri, 20 Sep 2024 16:20:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E04C33858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E04C33858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726849239; cv=none; b=CdbWA3J0nVPFx/ynk31lMV03QEQc33CjkVIbRJaWzymr2eamc+tWyofBn7dzxKrY4Bb4dFQDxM9iaSli/U3Roiq1eLVXNT5iMBFTH0Xce3pASefMKW/xQJpe+XPlaDlmkHCQDHKaKIfYjEB1B/K5ORKFLvvwE9GHBDRHtZa7OsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726849239; c=relaxed/simple; bh=WVUF9U/dZhNaKHufMtl3vnT5aEUAAs8ebfwkWFnTSBs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=uSa62+Iss4nK+RvVlZ6eJzTfR8TUDw6xbvi+cgFyk/N3mXHYYhJRXG72K2XWyGln5MZXrDJKc0+rzfTrrrPeGQW6GixX5o5jFH8OgMZSgHQ3DF0t6UjPqvP7STWREbQHvsQdA4TiOiNkZ4+yqzpBRMVg9eIehNDftljjYzwMU4A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726849236; 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=E46saFLbSnl1ctJ7wr+3oQgv+sgnyMgyKSYbvTXsguo=; b=e5TLcUZMOu0YW8ZygA8Rf6VB2RjiXHhlYad9mqAoPSrfExQDEzYQ7n182nNbDU6lND4Ldb yBCqPJq7MnVodUCYflSrEHmyMiuRXGAGiE+g8ncXSecBEz5u0pgNwGyR/zjBZ7hWBrAFEa LIwbqv1pIimIrM1yNAz6ZmSEGmhfqvs= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-567-eHRwkg1YPqKZPW-Pog33MQ-1; Fri, 20 Sep 2024 12:20:35 -0400 X-MC-Unique: eHRwkg1YPqKZPW-Pog33MQ-1 Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-3e27a0f8613so225580b6e.2 for ; Fri, 20 Sep 2024 09:20:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726849234; x=1727454034; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E46saFLbSnl1ctJ7wr+3oQgv+sgnyMgyKSYbvTXsguo=; b=W63dJ/8iBwDryQ+2Laeb55V3UlYm2wQ/hPQJj/l2InF8t9ZnGFS/37NZKb50P9RWO1 a/YTIrEOLTYHGzOQ7VCyEH3shbf6jw2ctcIs0H9YfaI+x1QeSb/dx77/4Q/x1x/oypJ8 lD9IWYlp71dkis5enbc5kiw81gyJsx8nkTP5b6L6jq/4a20O4vrgn/65jb9UezkKa6y5 VpKd8L8DmoT+rSo4620AcBU4zwv+3SboTnPZXAXnDE/hsbTk+v2mv5WqmfGtDTZM9yp3 d1Bawx3cKqvxvrDdJ9KSefg3ItNnRK3dR5WzvIN5TtMbz537XD6Cmr5pqOJw6mJ+xS+L q6Rg== X-Forwarded-Encrypted: i=1; AJvYcCWzUkxInGGeqApPlxqfny0sHEO95Yuq1OH29HUxXevnsjrQ7eU4mPXWOza1T8ZqXOj0hw9fRIqVrTK3cQ==@sourceware.org X-Gm-Message-State: AOJu0YxKtusQl8TXGRG4ekatTMTDtm5YV6AZChMdN7h09un6IwKRLNOW 2GV9ikZoPbYpAY3dmsATUzqjM30/VTCaYPmJN73+vbJ3cZkp3N0fzl4Z1PPYrayBguejdBFZN+t hWqBxg2ONhKnwQqWUhfnF3QTbOUa09chU7zBr6UAwYWkcmBDrTNFwg+jVfwg= X-Received: by 2002:a05:6359:5a96:b0:1ac:f3e8:b93 with SMTP id e5c5f4694b2df-1bc976465c7mr147400955d.20.1726849234526; Fri, 20 Sep 2024 09:20:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHI9Kklzh8mL4vsqHCL9FDf4nYZ9vMtCjhkcfwFhtSClHO1hkC4qQa2cAQRcvOPRslrvZ8d9Q== X-Received: by 2002:a05:6359:5a96:b0:1ac:f3e8:b93 with SMTP id e5c5f4694b2df-1bc976465c7mr147399455d.20.1726849234148; Fri, 20 Sep 2024 09:20:34 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1000? ([2804:14d:8084:92c5::1000]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45b178f2d71sm19362411cf.76.2024.09.20.09.20.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Sep 2024 09:20:33 -0700 (PDT) Message-ID: Date: Fri, 20 Sep 2024 13:20:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/testsuite: rework bp-cond-failure to not depend on inlining To: Keith Seitz , gdb-patches@sourceware.org References: <20240919124204.1465834-1-blarsen@redhat.com> <1940030f-122d-4656-a293-44e5b5a98c92@redhat.com> From: Guinevere Larsen In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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 On 9/20/24 12:58 PM, Keith Seitz wrote: > On 9/20/24 8:56 AM, Guinevere Larsen wrote: >> On 9/20/24 12:35 PM, Keith Seitz wrote: >>> >>> For the casual visitor to this file that has often been burned by >>> hard-coded line numbers or locations, it would, at least, save me some >>> grief. >> At the top of the exp file, the comment that explains the purpose of >> the test ends with the following: >> >> # We check that the correct breakpoint number appears in the error >> # message, and that the error is reported at the correct source >> # location. >> >> Would you still like me to add the comment in context, or do you >> think that is enough? > > Okay, fully optional now, but please consider adding a comment referring > to that explanation, at least. Again, I missed it entirely. :-) I've given some more thought and I think a couple of comments could help anyway. Here's my suggestion, thought? diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/gdb.base/bp-cond-failure.exp index 403e7db9032..b4c046c4bd6 100644 --- a/gdb/testsuite/gdb.base/bp-cond-failure.exp +++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp @@ -57,9 +57,18 @@ proc run_test { cond_eval access_type bpexpr nloc } {      # Setup the conditional breakpoint and record its number.      gdb_breakpoint "${bpexpr} if (*(${access_type} *) 0) == 0" + +    # This test aims to test that GDB displays the correct breakpoint number +    # and location when there is an error testing a breakpoint condition, +    # so it is important to hardcode the breakpoint number into the regex, +    # along with the location, if applicable.      set bp_num [get_integer_valueof "\$bpnum" "*UNKNOWN*"]      if { $nloc > 1 } { +       # We hardcode location 2 because, for some reason, Clang will always +       # order the debug information so we hit the second location.  For +       # simplicity the .c is ordered in such a way that GCC will also order +       # the debug info to have us land on location 2.         gdb_test "continue" \             [multi_line \                  "Continuing\\." \ -- Cheers, Guinevere Larsen She/Her/Hers > > Keith >