public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/29603] New: Python Watchpoints are not deleted
@ 2022-09-23  8:02 j3.soon777 at gmail dot com
  2022-09-23  8:03 ` [Bug python/29603] " j3.soon777 at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: j3.soon777 at gmail dot com @ 2022-09-23  8:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29603

            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 not be
deleted when going out of scope.

This cause gdb to incorrectly trigger the `Breakpoint.stop' function many more
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-24 14:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23  8:02 [Bug python/29603] New: Python Watchpoints are not deleted j3.soon777 at gmail dot com
2022-09-23  8:03 ` [Bug python/29603] " j3.soon777 at gmail dot com
2022-09-23  8:04 ` j3.soon777 at gmail dot com
2022-09-23  8:04 ` j3.soon777 at gmail dot com
2022-09-25  5:36 ` j3.soon777 at gmail dot com
2023-05-11 16:10 ` cvs-commit at gcc dot gnu.org
2024-01-14 14:26 ` ssbssa at sourceware dot org
2024-01-24 14:04 ` j3.soon777 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).