PR python/14387:
[deliverable/binutils-gdb.git] / gdb / python / py-event.c
index 7d4ff14457668643b10d6fd6db2870df363ceb9c..7c88fcd1b1e5267fe39a7e990ec834ac0c030be3 100644 (file)
@@ -48,7 +48,8 @@ create_event_object (PyTypeObject *py_type)
 
 /* Add the attribute ATTR to the event object EVENT.  In
    python this attribute will be accessible by the name NAME.
-   returns 0 if the operation succeeds and -1 otherwise.  */
+   returns 0 if the operation succeeds and -1 otherwise.  This
+   function acquires a new reference to ATTR.  */
 
 int
 evpy_add_attribute (PyObject *event, char *name, PyObject *attr)
@@ -132,6 +133,13 @@ evpy_emit_event (PyObject *event,
   return -1;
 }
 
+static PyGetSetDef event_object_getset[] =
+{
+  { "__dict__", gdb_py_generic_dict, NULL,
+    "The __dict__ for this event.", &event_object_type },
+  { NULL }
+};
+
 PyTypeObject event_object_type =
 {
   PyObject_HEAD_INIT (NULL)
@@ -164,7 +172,7 @@ PyTypeObject event_object_type =
   0,                                          /* tp_iternext */
   0,                                          /* tp_methods */
   0,                                          /* tp_members */
-  0,                                          /* tp_getset */
+  event_object_getset,                       /* tp_getset */
   0,                                          /* tp_base */
   0,                                          /* tp_dict */
   0,                                          /* tp_descr_get */
This page took 0.023695 seconds and 4 git commands to generate.