diff options
author | Enze Li <enze.li@hotmail.com> | 2022-06-24 21:57:54 +0800 |
---|---|---|
committer | Enze Li <enze.li@hotmail.com> | 2022-07-24 12:01:45 +0800 |
commit | ea892bdc4b6da5782c6ea6273aff499fb5fd5e6f (patch) | |
tree | 9a21b3a688604cfbee8d8c027ce2450f5b6f6546 | |
parent | c444385fad25c720ca6f7407f748f1d601463938 (diff) | |
download | fsf-binutils-gdb-ea892bdc4b6da5782c6ea6273aff499fb5fd5e6f.zip fsf-binutils-gdb-ea892bdc4b6da5782c6ea6273aff499fb5fd5e6f.tar.gz fsf-binutils-gdb-ea892bdc4b6da5782c6ea6273aff499fb5fd5e6f.tar.bz2 |
gdb/testsuite: add a clear test to py-breakpoint.exp
This patch adds a test case to try to clear an internal python
breakpoint using the clear command.
This was suggested by Pedro during a code review of the following
commit.
commit a5c69b1e49bae4d0dcb20f324cebb310c63495c6
Date: Sun Apr 17 15:09:46 2022 +0800
gdb: fix using clear command to delete non-user breakpoints(PR cli/7161)
Tested on x86_64 openSUSE Tumbleweed.
-rw-r--r-- | gdb/testsuite/gdb.python/py-breakpoint.exp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index 58b1af3..583408e 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -310,6 +310,26 @@ proc_with_prefix test_bkpt_internal { } { return 0 } delete_breakpoints + gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"main\", type=gdb.BP_BREAKPOINT, wp_class=gdb.WP_WRITE, internal=True )" \ + "Set internal breakpoint" 0 + + set bp_num [get_python_valueof bp1.number "*DEFAULT*"] + set bp_addr [gdb_get_bp_addr $bp_num] + + gdb_test "maint info break $bp_num" \ + "$bp_num.*$bp_addr.*" \ + "maint info breakpoint \$bp_num" + + gdb_test "python gdb.execute(\'clear *$bp_addr\')" \ + ".*No breakpoint at \\*$bp_addr.*" \ + "clear internal breakpoint" + + # Check again, make sure that GDB really didn't delete the internal breakpoint. + gdb_test "maint info break $bp_num" \ + "$bp_num.*$bp_addr.*" \ + "maint info breakpoint \$bp_num after clear" + + delete_breakpoints gdb_py_test_silent_cmd "python wp1 = gdb.Breakpoint (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE, internal=True )" \ "Set watchpoint" 0 gdb_test "info breakpoints" \ |