diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2010-11-29 13:49:05 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2010-11-29 13:49:05 +0000 |
commit | 94b6973efeb6d14a07e90ef5013c506efec59320 (patch) | |
tree | 0bedfdef24028ed68cb86448e0441e3d0f965820 /gdb/testsuite | |
parent | 950386c651f7a852fe7e1215d7481caf7f2c91d0 (diff) | |
download | gdb-94b6973efeb6d14a07e90ef5013c506efec59320.zip gdb-94b6973efeb6d14a07e90ef5013c506efec59320.tar.gz gdb-94b6973efeb6d14a07e90ef5013c506efec59320.tar.bz2 |
2010-11-29 Phil Muldoon <pmuldoon@redhat.com>
PR python/12199
* python/py-breakpoint.c (bppy_delete_breakpoint): New function.
2010-11-29 Phil Muldoon <pmuldoon@redhat.com>
PR python/12199
* gdb.python/py-breakpoint.exp: Test the delete method.
2010-11-29 Phil Muldoon <pmuldoon@redhat.com>
PR python/12199
* gdb.texinfo (Breakpoints In Python): Document "delete" method.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-breakpoint.exp | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e1cd9bb..22c3476 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-11-29 Phil Muldoon <pmuldoon@redhat.com> + + PR python/12199 + + * gdb.python/py-breakpoint.exp: Test the delete method. + 2010-11-28 Jan Kratochvil <jan.kratochvil@redhat.com> Fix step_resume_breakpoint unsaved during an infcall. diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp index d030b55..34a64a3 100644 --- a/gdb/testsuite/gdb.python/py-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp @@ -91,6 +91,29 @@ if ![runto_main] then { return 0 } +# Test breakpoints are deleted correctly. +set deltst_location [gdb_get_line_number "Break at multiply."] +set end_location [gdb_get_line_number "Break at end."] +gdb_py_test_silent_cmd "python dp1 = gdb.Breakpoint (\"$deltst_location\")" "Set breakpoint" 0 +gdb_breakpoint [gdb_get_line_number "Break at end."] +gdb_py_test_silent_cmd "python del_list = gdb.breakpoints()" "Get Breakpoint List" 0 +gdb_test "python print len(del_list)" "3" "Number of breakpoints before delete" +gdb_continue_to_breakpoint "Break at multiply." ".*/$srcfile:$deltst_location.*" +gdb_py_test_silent_cmd "python dp1.delete()" "Delete Breakpoint" 0 +gdb_test "python print dp1.number" "RuntimeError: Breakpoint 2 is invalid.*" "Check breakpoint invalidated" +gdb_py_test_silent_cmd "python del_list = gdb.breakpoints()" "Get Breakpoint List" 0 +gdb_test "python print len(del_list)" "2" "Number of breakpoints after delete" +gdb_continue_to_breakpoint "Break at end." ".*/$srcfile:$end_location.*" + + +# Start with a fresh gdb. +clean_restart ${testfile} + +if ![runto_main] then { + fail "Cannot run to main." + return 0 +} + # Test conditional setting. set bp_location1 [gdb_get_line_number "Break at multiply."] gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"$bp_location1\")" "Set breakpoint" 0 |