From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA54D3856973; Thu, 11 May 2023 16:10:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA54D3856973 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683821408; bh=6n4w4YTCvh7lFoxzFgSqOlWtq4H432m+XKp8BhRQrZk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cize4asnW+qpuIGIgxiOp9CGQZXUDbGrkAgHWTiMtD08kg5KM8btmDoTX1bRLWCik EmIxWWY6ktc1XYWZutVvRWbUixTdFixb2b+Wv2sCvQ7XWA9DsXP0lfXCDA063GMOSO mrioS7nbR8SU1JYiZLHrs+ODGHgCEuyBf7RZw1wI= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug python/29603] Python Watchpoints are not deleted Date: Thu, 11 May 2023 16:10:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29603 --- Comment #4 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Simon Marchi : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6e96d8a9702d= 1fef3eb6de47bb84bdea578eb1bb commit 6e96d8a9702d1fef3eb6de47bb84bdea578eb1bb Author: Johnson Sun Date: Thu May 11 23:46:20 2023 +0800 Disable out-of-scope watchpoints Currently, when a local software watchpoint goes out of scope, GDB sets the watchpoint's disposition to `delete at next stop' and then normal stops (i.e., stop and wait for the next GDB command). When GDB normal stops, it automatically deletes the breakpoints with their disposition set to `delete at next stop'. Suppose a Python script decides not to normal stop when a local software watchpoint goes out of scope, the watchpoint will not be automatically deleted even when its disposition is set to `delete at next stop'. Since GDB single-steps the program and tests the watched expression after each instruction, not deleting the watchpoint causes the watchpoint to be hit many more times than it should, as reported in PR python/29603. This was happening because the watchpoint is not deleted or disabled when going out of scope. This commit fixes this issue by disabling the watchpoint when going out of scope. It also adds a test to ensure this feature isn't regressed in the future. Calling `breakpoint_auto_delete' on all kinds of stops (in `fetch_inferior_event') seem to solve this issue, but is in fact inappropriate, since `breakpoint_auto_delete' goes over all breakpoints instead of just going through the bpstat chain (which only contains the breakpoints that were hit right now). Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29603 Change-Id: Ia85e670b2bcba2799219abe4b6be3b582387e383 --=20 You are receiving this mail because: You are on the CC list for the bug.=