aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:19:54 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:19:54 +0000
commit5d153bd188d03fcd90deb4d3a51e93f77e095894 (patch)
treec22c47c0d2982677307259692743724e6f7857cb
parent56cc411c4ba10261e0149bdb80d613969c3ab130 (diff)
downloadbinutils-5d153bd188d03fcd90deb4d3a51e93f77e095894.zip
binutils-5d153bd188d03fcd90deb4d3a51e93f77e095894.tar.gz
binutils-5d153bd188d03fcd90deb4d3a51e93f77e095894.tar.bz2
* python/py-event.h (gdbpy_initialize_event_generic): Use
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. * python/py-evts.c (add_new_registry): Use CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. * python/python-internal.h (CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION): New macro.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/python/py-event.h7
-rw-r--r--gdb/python/py-evts.c2
-rw-r--r--gdb/python/python-internal.h7
4 files changed, 21 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cb3768c..949ae19 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2013-05-20 Tom Tromey <tromey@redhat.com>
+ * python/py-event.h (gdbpy_initialize_event_generic): Use
+ CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
+ * python/py-evts.c (add_new_registry): Use
+ CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
+ * python/python-internal.h
+ (CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION): New macro.
+
+2013-05-20 Tom Tromey <tromey@redhat.com>
+
* python/py-arch.c (archpy_disassemble): Update.
* python/py-type.c (typy_get_composite, typy_lookup_typename)
(typy_lookup_type): Use GDB_PY_HANDLE_EXCEPTION.
diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h
index 1db8bd2..4850f1a 100644
--- a/gdb/python/py-event.h
+++ b/gdb/python/py-event.h
@@ -115,8 +115,9 @@ extern int emit_new_objfile_event (struct objfile *objfile);
extern void evpy_dealloc (PyObject *self);
extern int evpy_add_attribute (PyObject *event,
- char *name, PyObject *attr);
-int gdbpy_initialize_event_generic (PyTypeObject *type, char *name);
-
+ char *name, PyObject *attr)
+ CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
+int gdbpy_initialize_event_generic (PyTypeObject *type, char *name)
+ CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
#endif /* GDB_PY_EVENT_H */
diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c
index 4c079e2..427b6d5 100644
--- a/gdb/python/py-evts.c
+++ b/gdb/python/py-evts.c
@@ -37,7 +37,7 @@ static struct PyModuleDef EventModuleDef =
/* Initialize python events. */
-static int
+static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
add_new_registry (eventregistry_object **registryp, char *name)
{
*registryp = create_eventregistry_object ();
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 2b4244c..2e09096 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -53,6 +53,13 @@
#define CPYCHECKER_SETS_EXCEPTION
#endif
+#ifdef WITH_CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION_ATTRIBUTE
+#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION \
+ __attribute__ ((cpychecker_negative_result_sets_exception))
+#else
+#define CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
+#endif
+
#include <stdio.h>
/* Python 2.4 doesn't include stdint.h soon enough to get {u,}intptr_t