+ Py_RETURN_NONE;
+}
+
+/* Subroutine of find_pretty_printer to simplify it.
+ Look for a pretty-printer to print VALUE in the current program space.
+ The result is NULL if there's an error and the search should be terminated.
+ The result is Py_None, suitably inc-ref'd, if no pretty-printer was found.
+ Otherwise the result is the pretty-printer function, suitably inc-ref'd. */
+
+static PyObject *
+find_pretty_printer_from_progspace (PyObject *value)
+{
+ PyObject *pp_list;
+ PyObject *function;
+ PyObject *obj = pspace_to_pspace_object (current_program_space);
+
+ if (!obj)
+ return NULL;
+ pp_list = pspy_get_printers (obj, NULL);
+ function = search_pp_list (pp_list, value);
+ Py_XDECREF (pp_list);
+ return function;
+}
+
+/* Subroutine of find_pretty_printer to simplify it.
+ Look for a pretty-printer to print VALUE in the gdb module.
+ The result is NULL if there's an error and the search should be terminated.
+ The result is Py_None, suitably inc-ref'd, if no pretty-printer was found.
+ Otherwise the result is the pretty-printer function, suitably inc-ref'd. */
+
+static PyObject *
+find_pretty_printer_from_gdb (PyObject *value)
+{
+ PyObject *pp_list;
+ PyObject *function;
+