aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2011-10-27 09:14:27 +0000
committerPhil Muldoon <pmuldoon@redhat.com>2011-10-27 09:14:27 +0000
commit76dce0be7b6b831559f41f69e85fc1e8f9d28343 (patch)
tree06396641895472efb609d0ddeb6b815a472fd3fe /gdb/python/py-breakpoint.c
parentd848dec6d9d34420121d9de18315c111d88017fd (diff)
downloadgdb-76dce0be7b6b831559f41f69e85fc1e8f9d28343.zip
gdb-76dce0be7b6b831559f41f69e85fc1e8f9d28343.tar.gz
gdb-76dce0be7b6b831559f41f69e85fc1e8f9d28343.tar.bz2
2011-10-27 Phil Muldoon <pmuldoon@redhat.com>
* python/py-breakpoint.c (bppy_set_enabled): Use TRY_CATCH. (bppy_set_task): Ditto. (bppy_delete_breakpoint): Ditto. * python/py-symbol.c (gdbpy_lookup_symbol): Ditto. (gdbpy_lookup_global_symbol): Ditto. * python/py-lazy-string.c (stpy_convert_to_value): Ditto. * python/py-frame.c (frapy_is_valid): Ditto. (frame_info_to_frame_object): Ditto. * python/py-type.c (typy_lookup_type): Ditto. (typy_getitem): Ditto. (typy_has_key): Ditto. (typy_richcompare): Use TRY_CATCH. Do not return Py_NE on error.
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index daceb99..f235bbc 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -150,6 +150,7 @@ bppy_set_enabled (PyObject *self, PyObject *newvalue, void *closure)
{
breakpoint_object *self_bp = (breakpoint_object *) self;
int cmp;
+ volatile struct gdb_exception except;
BPPY_SET_REQUIRE_VALID (self_bp);
@@ -170,10 +171,16 @@ bppy_set_enabled (PyObject *self, PyObject *newvalue, void *closure)
cmp = PyObject_IsTrue (newvalue);
if (cmp < 0)
return -1;
- else if (cmp == 1)
- enable_breakpoint (self_bp->bp);
- else
- disable_breakpoint (self_bp->bp);
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ if (cmp == 1)
+ enable_breakpoint (self_bp->bp);
+ else
+ disable_breakpoint (self_bp->bp);
+ }
+ GDB_PY_SET_HANDLE_EXCEPTION (except);
+
return 0;
}
@@ -255,6 +262,8 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
{
breakpoint_object *self_bp = (breakpoint_object *) self;
long id;
+ int valid_id = 0;
+ volatile struct gdb_exception except;
BPPY_SET_REQUIRE_VALID (self_bp);
@@ -269,7 +278,13 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
if (! gdb_py_int_as_long (newvalue, &id))
return -1;
- if (! valid_task_id (id))
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ valid_id = valid_task_id (id);
+ }
+ GDB_PY_SET_HANDLE_EXCEPTION (except);
+
+ if (! valid_id)
{
PyErr_SetString (PyExc_RuntimeError,
_("Invalid task ID."));
@@ -299,10 +314,15 @@ static PyObject *
bppy_delete_breakpoint (PyObject *self, PyObject *args)
{
breakpoint_object *self_bp = (breakpoint_object *) self;
+ volatile struct gdb_exception except;
BPPY_REQUIRE_VALID (self_bp);
- delete_breakpoint (self_bp->bp);
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ delete_breakpoint (self_bp->bp);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
Py_RETURN_NONE;
}