Fix deletion of FinishBreakpoints
authorJohnson Sun <j3.soon777@gmail.com>
Thu, 20 Oct 2022 17:49:18 +0000 (01:49 +0800)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 18 Nov 2022 15:50:45 +0000 (10:50 -0500)
commit6533cbeeb831224e2d2dd2a7bea54b22b798fa39
tree1485eb862e28283864b7d78cf42137d8b9444989
parent9c48a8e6f43965b8d530159e5dbb2fc9d6083646
Fix deletion of FinishBreakpoints

Currently, FinishBreakpoints are set at the return address of a frame based on
the `finish' command, and are meant to be temporary breakpoints. However, they
are not being cleaned up after use, as reported in PR python/18655. This was
happening because the disposition of the breakpoint was not being set
correctly.

This commit fixes this issue by correctly setting the disposition in the
post-stop hook of the breakpoint. It also adds a test to ensure this feature
isn't regressed in the future.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=18655
gdb/python/py-finishbreakpoint.c
gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.c [new file with mode: 0644]
gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp [new file with mode: 0644]
gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.py [new file with mode: 0644]