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/python | |
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/python')
-rw-r--r-- | gdb/python/py-breakpoint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 64e30ef..88d9930 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -283,6 +283,23 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure) return 0; } +/* Python function which deletes the underlying GDB breakpoint. This + triggers the breakpoint_deleted observer which will call + gdbpy_breakpoint_deleted; that function cleans up the Python + sections. */ + +static PyObject * +bppy_delete_breakpoint (PyObject *self, PyObject *args) +{ + breakpoint_object *self_bp = (breakpoint_object *) self; + + BPPY_REQUIRE_VALID (self_bp); + + delete_breakpoint (self_bp->bp); + + Py_RETURN_NONE; +} + /* Python function to set the ignore count of a breakpoint. */ static int @@ -843,6 +860,8 @@ static PyMethodDef breakpoint_object_methods[] = { { "is_valid", bppy_is_valid, METH_NOARGS, "Return true if this breakpoint is valid, false if not." }, + { "delete", bppy_delete_breakpoint, METH_NOARGS, + "Delete the underlying GDB breakpoint." }, { NULL } /* Sentinel. */ }; |