2005-11-18 Andrew Stubbs <andrew.stubbs@st.com>
authorAndrew Stubbs <andrew.stubbs@st.com>
Fri, 18 Nov 2005 17:02:14 +0000 (17:02 +0000)
committerAndrew Stubbs <andrew.stubbs@st.com>
Fri, 18 Nov 2005 17:02:14 +0000 (17:02 +0000)
* mi/mi-main.c (mi_load_progress): Ensure the use of the correct mi
uiout for the duration of the function.

gdb/ChangeLog
gdb/mi/mi-main.c

index 0c70f1682ece6c7878cc1b14d64d7bc1c3e05caf..94062301410750c9bed9db879429cc6e2ac265b2 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-18  Andrew Stubbs  <andrew.stubbs@st.com>
+
+       * mi/mi-main.c (mi_load_progress): Ensure the use of the correct mi
+       uiout for the duration of the function.
+
 2005-11-18  Nick Roberts  <nickrob@snap.net.nz>
 
        * mi/gdb-mi.el (gdb-source-file-list): Declare.
index 17c9c38d51f50429f5f9e30f5e74a2c1acdf31db..e5644b58d0ad6ce7b417690a4cddaa9ff60ea882 100644 (file)
@@ -1365,9 +1365,18 @@ mi_load_progress (const char *section_name,
   static struct timeval last_update;
   static char *previous_sect_name = NULL;
   int new_section;
+  struct ui_out *saved_uiout;
 
-  if (!current_interp_named_p (INTERP_MI)
-      && !current_interp_named_p (INTERP_MI1))
+  /* This function is called through deprecated_show_load_progress
+     which means uiout may not be correct.  Fix it for the duration
+     of this function.  */
+  saved_uiout = uiout;
+
+  if (current_interp_named_p (INTERP_MI))
+    uiout = mi_out_new (2);
+  else if (current_interp_named_p (INTERP_MI1))
+    uiout = mi_out_new (1);
+  else
     return;
 
   update_threshold.tv_sec = 0;
@@ -1424,6 +1433,9 @@ mi_load_progress (const char *section_name,
       fputs_unfiltered ("\n", raw_stdout);
       gdb_flush (raw_stdout);
     }
+
+  xfree (uiout);
+  uiout = saved_uiout;
 }
 
 void
This page took 0.030876 seconds and 4 git commands to generate.