aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorEnze Li <lienze2010@hotmail.com>2022-04-17 15:09:46 +0800
committerEnze Li <lienze2010@hotmail.com>2022-04-18 21:40:31 +0800
commita5c69b1e49bae4d0dcb20f324cebb310c63495c6 (patch)
treef085617e93aaf7dfb4bd774e1a8244daadf1b38b /gdb/breakpoint.c
parentcd1a989fe1350fa6a375afd34ca1d7ee5244fb48 (diff)
downloadgdb-a5c69b1e49bae4d0dcb20f324cebb310c63495c6.zip
gdb-a5c69b1e49bae4d0dcb20f324cebb310c63495c6.tar.gz
gdb-a5c69b1e49bae4d0dcb20f324cebb310c63495c6.tar.bz2
gdb: fix using clear command to delete non-user breakpoints(PR cli/7161)
The clear command shouldn't delete momentary and internal breakpoints, nor internal breakpoints created via Python's gdb.Breakpoint. This patch fixes this issue and adds a testcase. Regression tested on x86_64 openSUSE Tumbleweed(VERSION_ID="20220413"). Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7161
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 1a227e5..ff27174 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10921,7 +10921,8 @@ clear_command (const char *arg, int from_tty)
{
int match = 0;
/* Are we going to delete b? */
- if (b->type != bp_none && !is_watchpoint (b))
+ if (b->type != bp_none && !is_watchpoint (b)
+ && user_breakpoint_p (b))
{
for (bp_location *loc : b->locations ())
{