gdb: fix using clear command to delete non-user breakpoints(PR cli/7161)
authorEnze Li <lienze2010@hotmail.com>
Sun, 17 Apr 2022 07:09:46 +0000 (15:09 +0800)
committerEnze Li <lienze2010@hotmail.com>
Mon, 18 Apr 2022 13:40:31 +0000 (21:40 +0800)
commita5c69b1e49bae4d0dcb20f324cebb310c63495c6
treef085617e93aaf7dfb4bd774e1a8244daadf1b38b
parentcd1a989fe1350fa6a375afd34ca1d7ee5244fb48
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
gdb/breakpoint.c
gdb/testsuite/gdb.base/clear_non_user_bp.exp [new file with mode: 0644]