* python/py-event.h (evpy_emit_event): Use
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:16:57 +0000 (20:16 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:16:57 +0000 (20:16 +0000)
        CPYCHECKER_STEALS_REFERENCE_TO_ARG.
        * python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
        New macro.

gdb/ChangeLog
gdb/python/py-event.h
gdb/python/python-internal.h

index 8b417da7032cb8556939934614eca5e6b00b6aff..49c10bce76f5db6beb067fe4ac0f461402b31120 100644 (file)
@@ -1,3 +1,10 @@
+2013-05-20  Tom Tromey  <tromey@redhat.com>
+
+        * python/py-event.h (evpy_emit_event): Use
+        CPYCHECKER_STEALS_REFERENCE_TO_ARG.
+        * python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
+        New macro.
+
 2013-05-20  Tom Tromey  <tromey@redhat.com>
 
        * py-evtregistry.c (create_event_object): Decref
index 970595b33ceed7c2d7361e2ea3886ecb94e4f8c6..1db8bd2e868d71ca4f4ec750ad1df730c06049b6 100644 (file)
@@ -106,7 +106,8 @@ extern int emit_continue_event (ptid_t ptid);
 extern int emit_exited_event (const LONGEST *exit_code, struct inferior *inf);
 
 extern int evpy_emit_event (PyObject *event,
-                            eventregistry_object *registry);
+                            eventregistry_object *registry)
+  CPYCHECKER_STEALS_REFERENCE_TO_ARG (1);
 
 extern PyObject *create_event_object (PyTypeObject *py_type);
 extern PyObject *create_thread_event_object (PyTypeObject *py_type);
index 8552c87df5444d4644f529d7ce38af345cd0c2ca..2792562f9aab3bb95db9e5b5f0b1d07e9a885696 100644 (file)
 #define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG)
 #endif
 
+#ifdef WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE
+#define CPYCHECKER_STEALS_REFERENCE_TO_ARG(n) \
+   __attribute__ ((cpychecker_steals_reference_to_arg (n)))
+#else
+#define CPYCHECKER_STEALS_REFERENCE_TO_ARG(n)
+#endif
+
 #include <stdio.h>
 
 /* Python 2.4 doesn't include stdint.h soon enough to get {u,}intptr_t