static PyObject * thpy_get_ptid (PyObject *self, void *closure) { thread_object *thread_obj = (thread_object *) self; THPY_REQUIRE_VALID (thread_obj); return gdbpy_create_ptid_object (thread_obj->thread->ptid); }
static PyObject * create_inferior_call_event_object (inferior_call_kind flag, ptid_t ptid, CORE_ADDR addr) { int pid; long tid, lwp; PyObject *event; PyObject *ptid_obj = NULL; PyObject *addr_obj = NULL; int failed; struct cleanup *cleanups; struct cleanup *member_cleanups; switch (flag) { case INFERIOR_CALL_PRE: event = create_event_object (&inferior_call_pre_event_object_type); break; case INFERIOR_CALL_POST: event = create_event_object (&inferior_call_post_event_object_type); break; default: return NULL; } cleanups = make_cleanup_py_decref (event); ptid_obj = gdbpy_create_ptid_object (ptid); if (ptid_obj == NULL) goto fail; member_cleanups = make_cleanup_py_decref (ptid_obj); failed = evpy_add_attribute (event, "ptid", ptid_obj) < 0; if (failed) goto fail; addr_obj = PyLong_FromLongLong (addr); if (addr_obj == NULL) goto fail; make_cleanup_py_decref (addr_obj); failed = evpy_add_attribute (event, "address", addr_obj) < 0; if (failed) goto fail; do_cleanups (member_cleanups); discard_cleanups (cleanups); return event; fail: do_cleanups (cleanups); return NULL; }