diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:19:03 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:19:03 +0000 |
commit | 56cc411c4ba10261e0149bdb80d613969c3ab130 (patch) | |
tree | 683d852a50581846ce1488f049781ff7ee36871f /gdb/python/python-internal.h | |
parent | 8919e1746d5618284d7c16bcc5256bcf813ea030 (diff) | |
download | fsf-binutils-gdb-56cc411c4ba10261e0149bdb80d613969c3ab130.zip fsf-binutils-gdb-56cc411c4ba10261e0149bdb80d613969c3ab130.tar.gz fsf-binutils-gdb-56cc411c4ba10261e0149bdb80d613969c3ab130.tar.bz2 |
* 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.
* python/py-utils.c (gdbpy_convert_exception): Return 'void'.
* python/python-internal.h (CPYCHECKER_SETS_EXCEPTION): New
macro.
(GDB_PY_HANDLE_EXCEPTION): Update.
(gdbpy_convert_exception): Update. Use CPYCHECKER_SETS_EXCEPTION.
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r-- | gdb/python/python-internal.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 643bdcf..2b4244c 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -47,6 +47,12 @@ #define CPYCHECKER_STEALS_REFERENCE_TO_ARG(n) #endif +#ifdef WITH_CPYCHECKER_SETS_EXCEPTION_ATTRIBUTE +#define CPYCHECKER_SETS_EXCEPTION __attribute__ ((cpychecker_sets_exception)) +#else +#define CPYCHECKER_SETS_EXCEPTION +#endif + #include <stdio.h> /* Python 2.4 doesn't include stdint.h soon enough to get {u,}intptr_t @@ -352,11 +358,14 @@ extern const struct language_defn *python_language; /* Use this after a TRY_EXCEPT to throw the appropriate Python exception. */ -#define GDB_PY_HANDLE_EXCEPTION(Exception) \ - do { \ - if (Exception.reason < 0) \ - return gdbpy_convert_exception (Exception); \ - } while (0) +#define GDB_PY_HANDLE_EXCEPTION(Exception) \ + do { \ + if (Exception.reason < 0) \ + { \ + gdbpy_convert_exception (Exception); \ + return NULL; \ + } \ + } while (0) /* Use this after a TRY_EXCEPT to throw the appropriate Python exception. This macro is for use inside setter functions. */ @@ -414,7 +423,8 @@ extern PyObject *gdbpy_gdb_error; extern PyObject *gdbpy_gdb_memory_error; extern PyObject *gdbpy_gdberror_exc; -extern PyObject *gdbpy_convert_exception (struct gdb_exception); +extern void gdbpy_convert_exception (struct gdb_exception) + CPYCHECKER_SETS_EXCEPTION; int get_addr_from_python (PyObject *obj, CORE_ADDR *addr); |