python: Use console format for output of gdb.execute command
[deliverable/binutils-gdb.git] / gdb / python / python.c
index 84f05965e1f359a30c31aceb1040f980f47aaed9..e467134849e1928eae6ba550eb1ef0fff9c80945 100644 (file)
@@ -658,10 +658,17 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
       /* Copy the argument text in case the command modifies it.  */
       char *copy = xstrdup (arg);
       struct cleanup *cleanup = make_cleanup (xfree, copy);
+      struct interp *interp;
 
       make_cleanup_restore_integer (&interpreter_async);
       interpreter_async = 0;
 
+      make_cleanup_restore_ui_out (&current_uiout);
+      /* Use the console interpreter uiout to have the same print format
+       for console or MI.  */
+      interp = interp_lookup ("console");
+      current_uiout = interp_ui_out (interp);
+
       prevent_dont_repeat ();
       if (to_string)
        result = execute_command_to_string (copy, from_tty);
This page took 0.025953 seconds and 4 git commands to generate.