static PyObject * frapy_is_valid (PyObject *self, PyObject *args) { struct frame_info *frame = NULL; volatile struct gdb_exception except; TRY_CATCH (except, RETURN_MASK_ALL) { frame = frame_object_to_frame_info (self); }
static PyObject * frapy_is_valid (PyObject *self, PyObject *args) { struct frame_info *frame; frame = frame_object_to_frame_info ((frame_object *) self); if (frame == NULL) Py_RETURN_FALSE; Py_RETURN_TRUE; }
static PyObject * frapy_is_valid (PyObject *self, PyObject *args) { struct frame_info *frame = NULL; TRY { frame = frame_object_to_frame_info (self); } CATCH (except, RETURN_MASK_ALL) { GDB_PY_HANDLE_EXCEPTION (except); }
static int bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs) { static char *keywords[] = { "frame", "internal", NULL }; struct finish_breakpoint_object *self_bpfinish = (struct finish_breakpoint_object *) self; PyObject *frame_obj = NULL; int thread; struct frame_info *frame = NULL; /* init for gcc -Wall */ struct frame_info *prev_frame = NULL; struct frame_id frame_id; PyObject *internal = NULL; int internal_bp = 0; CORE_ADDR pc; struct symbol *function; if (!PyArg_ParseTupleAndKeywords (args, kwargs, "|OO", keywords, &frame_obj, &internal)) return -1; TRY { /* Default frame to newest frame if necessary. */ if (frame_obj == NULL) frame = get_current_frame (); else frame = frame_object_to_frame_info (frame_obj); if (frame == NULL) { PyErr_SetString (PyExc_ValueError, _("Invalid ID for the `frame' object.")); } else { prev_frame = get_prev_frame (frame); if (prev_frame == 0) { PyErr_SetString (PyExc_ValueError, _("\"FinishBreakpoint\" not " "meaningful in the outermost " "frame.")); } else if (get_frame_type (prev_frame) == DUMMY_FRAME) { PyErr_SetString (PyExc_ValueError, _("\"FinishBreakpoint\" cannot " "be set on a dummy frame.")); } else { frame_id = get_frame_id (prev_frame); if (frame_id_eq (frame_id, null_frame_id)) PyErr_SetString (PyExc_ValueError, _("Invalid ID for the `frame' object.")); } } } CATCH (except, RETURN_MASK_ALL) { gdbpy_convert_exception (except); return -1; }