From patchwork Sun Dec 3 03:06:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 81219 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA0923857B8A for ; Sun, 3 Dec 2023 03:09:15 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 8806F3858C35 for ; Sun, 3 Dec 2023 03:09:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8806F3858C35 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 8806F3858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701572943; cv=none; b=CLKR3NtnvvaqiJJiFnHhxgggMnuXkexMRN1C96o34ZmXumBKkDR7ob3IQrbCF67VZObUP3NVsJfd0FpY0tdctlsXFHfUBp0GLBXKQcr7JwlApRkJTkToG8JPtD+EkivDFoWOuSD6gFdjLha1CvqVjyCOXMAuLH4ndBOkWdzz2sI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701572943; c=relaxed/simple; bh=wik7CRVwIyy3SXwyrMptr0BdLuHQ5NmTfk9+onbjxE0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RiQqrhXsNVjb1Y3SKxj1h4JoEqXzdeH88AIYqnkhtbYGxMFJD79gdXTCltB2kNTemoSlaCsQ7lqF8otLtgCMY6t7DyWe8oQth1VaskHX/tThOmVFuYXbo1JizA6J5lbDos/Z+nMh11+CpJkh7q2tLKwtWxF2jVxULABEa77A51Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701572941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pY7qfaSy/C0/PuNNYZuk1GFbpwIbX23BnMGwa1EGJI=; b=eA5I0Gxg4Iy4vtrtLvQVV7m0yUJP7azSuir1R7+xazLvgCHk7Gt/1Y/CQo1JPmJgVCHJvI g3dTXH5UuinW8BiDmZVFPqKtFIw91fw7yEILfyCknq3zHVH06A5MTpAszPZz0ta6BG9y6U 25DnFkkJ/0f12wok5NO5mEYidqXr84w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-847LItbyO_CmJ6IX9HkYzg-1; Sat, 02 Dec 2023 22:08:58 -0500 X-MC-Unique: 847LItbyO_CmJ6IX9HkYzg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id BEF80811E7B for ; Sun, 3 Dec 2023 03:08:57 +0000 (UTC) Received: from f39-1.lan (unknown [10.22.10.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 569981121306; Sun, 3 Dec 2023 03:08:56 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH] Add more 'step' tests to gdb.base/watchpoint.exp Date: Sat, 2 Dec 2023 20:06:31 -0700 Message-ID: <20231203030838.2242134-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.5 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_H3, RCVD_IN_MSPIKE_WL, 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 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+patchwork=sourceware.org@sourceware.org The test gdb.base/watchpoint.exp has a proc named 'test_stepping' which claims to "Test stepping and other mundane operations with watchpoints enabled". It sets a watchpoint on ival2, performs an inferior function call (which is not at all mundane), and uses 'next', 'until', and, finally, does a 'step'. However, that final 'step' command steps to (but not over/through) the line at which the assignment to ival2 takes place. At no time while performing these operations is a watchpoint hit. This commit adds a test to see what happens when stepping over/through the assignment to ival2. The watchpoint on ival2 should be triggered during this step. I've added another 'step' to make sure that the correct statement is reached after performing the watchpoint-hitting step. After running the 'test_stepping' proc, gdb.base/watchpoint.exp does a clean_restart before doing further tests, so nothing depends upon 'test_stepping' to stop at the particular statement at which it had been stopping. I've examined all tests which set watchpoints and step. I haven't been able to identify a(nother) test case which tests what happens when stepping over/through a statement which triggers a watchpoint. Therefore, adding these new 'step' tests is testing something which hasn't being tested elsewhere. Reviewed-By: John Baldwin --- gdb/testsuite/gdb.base/watchpoint.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 70864655c6d..24bc8276951 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -340,6 +340,15 @@ proc test_stepping {} { } gdb_test "step" "ival2 = count.*" "step to ival2 assignment" + + # Check that the watchpoint is triggered during a step. + gdb_test "step" \ + "\[Ww\]atchpoint.*: ival2.*Old value = -1.*New value = 4.*ival3 = count; ival4 = count;" \ + "step over ival2 assignment" + + # Step again and check that correct statement is reached after + # hitting a watchpoint during a step. + gdb_test "step" "marker2 \\(\\);.*" "step to marker2" } }