From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DBCB38582B5; Fri, 23 Sep 2022 08:02:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DBCB38582B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663920173; bh=Hq2AXdzMZHOF+JvcjvND0FWmpsRbN3qZ0GLZCZZRorE=; h=From:To:Subject:Date:From; b=LloumzjwVIZFArMvKgIQC9It4upEf3SJEa1oHRSOKkImGiETsomMgDfAV/hM7bvtV E70JExEoBFDqn3gq/hgjaDevu6I2jg2gNknaDU91UrGS5clOwUZK4XjdjGDCgTwNQ2 nAI9a3BqTHCcwSYTeo+5buoAuKd/wxNBn7xsruFM= From: "j3.soon777 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/29603] New: Python Watchpoints are not deleted Date: Fri, 23 Sep 2022 08:02:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: j3.soon777 at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 29603 Summary: Python Watchpoints are not deleted Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: python Assignee: unassigned at sourceware dot org Reporter: j3.soon777 at gmail dot com Target Milestone: --- In Python, if we register a local software watchpoint and set the `Breakpoint.stop' function to always return `False', the watchpoint will no= t be deleted when going out of scope. This cause gdb to incorrectly trigger the `Breakpoint.stop' function many m= ore times than it should. This issue is reproduced in: - GCC 7.5.0 & GDB 10.2 on Ubuntu 18.04, - GCC 9.3.0 & GDB 9.2 on Ubuntu 20.04 (WSL on Windows), - GCC 11.2.0 & GDB 12.0.90 on Ubuntu 22.04, - and on current GDB HEAD (commit 8e037eae6823caf5b9cb5b4feb3de838abb25956). Please see the attachment for the testing files. Commands to reproduce: gcc -g test.c gdb a.out (gdb) set can-use-hw-watchpoints 0 (gdb) b main (gdb) r (gdb) source test.py (gdb) c Continuing. Watchpoint Hit: 1 Watchpoint Hit: 2 Watchpoint Hit: 3 Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 4 Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 5 Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 6 ... Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 1201 Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 1202 Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint Hit: 1203 [Inferior 1 (process 17119) exited normally] Please note that the Watchpoint in the test file should only be hit 4 times. I'm currently working on a patch to fix this bug. --=20 You are receiving this mail because: You are on the CC list for the bug.=