aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index d603b3a..5132ec1 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -847,26 +847,20 @@ private:
PyGILState_STATE m_state;
};
-/* Use this after a TRY_EXCEPT to throw the appropriate Python
- exception. */
+/* Use this in a 'catch' block to convert the exception to a Python
+ exception and return nullptr. */
#define GDB_PY_HANDLE_EXCEPTION(Exception) \
do { \
- if (Exception.reason < 0) \
- { \
- gdbpy_convert_exception (Exception); \
- return NULL; \
- } \
+ gdbpy_convert_exception (Exception); \
+ return nullptr; \
} while (0)
-/* Use this after a TRY_EXCEPT to throw the appropriate Python
- exception. This macro is for use inside setter functions. */
+/* Use this in a 'catch' block to convert the exception to a Python
+ exception and return -1. */
#define GDB_PY_SET_HANDLE_EXCEPTION(Exception) \
do { \
- if (Exception.reason < 0) \
- { \
- gdbpy_convert_exception (Exception); \
- return -1; \
- } \
+ gdbpy_convert_exception (Exception); \
+ return -1; \
} while (0)
int gdbpy_print_python_errors_p (void);