+
+ testsuite/
+ * gdb.base/dprintf-detach.exp: Cope with local patch. Ref# 2180247
+--- README.google 2015-09-05 18:55:44.000000000 -0700
++++ README.google 2015-09-05 18:59:16.000000000 -0700
++
++2015-09-05 Doug Evans <dje@google.com>
++
++ * python/python.c (gdbpy_top_interpreter_is_mi): New function.
++ (GdbMethods): New member top_interpreter_is_mi.
++
++ testsuite/
++ * gdb.python/py-mi.exp: Add tests for gdb.top_interpreter_is_mi.
do_cleanups (cleanups);
}
+/* Return True if the top interpreter is MI-like. */
+
+static PyObject *
+gdbpy_top_interpreter_is_mi (PyObject *unused1, PyObject *unused2)
+{
+ if (ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ())))
+ Py_RETURN_TRUE;
+ Py_RETURN_FALSE;
+}
+
#else /* HAVE_PYTHON */
/* Dummy implementation of the gdb "python-interactive" and "python"
mi_gdb_test "-var-set-visualizer fake.private gdb.default_visualizer" \
"\\^done" "Install visualizer on a cplus_fake_child"
+
+# Test top_interpreter_is_mi.
+
+gdb_exit
+gdb_start
+gdb_test "python print gdb.top_interpreter_is_mi()" "False" \
+ "top_interpreter_is_mi when false"
+
+gdb_exit
+if ![mi_gdb_start] {
+ mi_gdb_test "python print gdb.top_interpreter_is_mi()" \
+ ".*~\"True\\\\n\"\r\n\\^done" \
+ "top_interpreter_is_mi when true"
+}