gdb
[deliverable/binutils-gdb.git] / gdb / python / python-internal.h
index 67de6223a12786e1c7d58c0bf127f3a2f78afaaa..30d75336a4c54831227d987846f9b3a97810a494 100644 (file)
@@ -80,6 +80,8 @@ typedef int Py_ssize_t;
 /* Also needed to parse enum var_types. */
 #include "command.h"
 
+#include "exceptions.h"
+
 struct block;
 struct value;
 struct language_defn;
@@ -179,9 +181,7 @@ extern const struct language_defn *python_language;
 #define GDB_PY_HANDLE_EXCEPTION(Exception)                             \
     do {                                                               \
       if (Exception.reason < 0)                                                \
-       return PyErr_Format (Exception.reason == RETURN_QUIT            \
-                            ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \
-                            "%s", Exception.message);                  \
+       return gdbpy_convert_exception (Exception);                     \
     } while (0)
 
 /* Use this after a TRY_EXCEPT to throw the appropriate Python
@@ -190,9 +190,7 @@ extern const struct language_defn *python_language;
     do {                                                               \
       if (Exception.reason < 0)                                                \
         {                                                              \
-         PyErr_Format (Exception.reason == RETURN_QUIT                 \
-                       ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \
-                       "%s", Exception.message);                       \
+         gdbpy_convert_exception (Exception);                          \
          return -1;                                                    \
        }                                                               \
     } while (0)
@@ -222,7 +220,8 @@ int gdbpy_is_value_object (PyObject *obj);
 /* Note that these are declared here, and not in python.h with the
    other pretty-printer functions, because they refer to PyObject.  */
 PyObject *apply_varobj_pretty_printer (PyObject *print_obj,
-                                      struct value **replacement);
+                                      struct value **replacement,
+                                      struct ui_file *stream);
 PyObject *gdbpy_get_varobj_pretty_printer (struct value *value);
 char *gdbpy_get_display_hint (PyObject *printer);
 PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args);
@@ -233,8 +232,13 @@ extern PyObject *gdbpy_to_string_cst;
 extern PyObject *gdbpy_display_hint_cst;
 extern PyObject *gdbpy_enabled_cst;
 
+/* Exception types.  */
+extern PyObject *gdbpy_gdb_error;
+extern PyObject *gdbpy_gdb_memory_error;
 extern PyObject *gdbpy_gdberror_exc;
 
+extern PyObject *gdbpy_convert_exception (struct gdb_exception);
+
 int get_addr_from_python (PyObject *obj, CORE_ADDR *addr);
 
 #endif /* GDB_PYTHON_INTERNAL_H */
This page took 0.029442 seconds and 4 git commands to generate.