aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorAndrew Stubbs <andrew.stubbs@st.com>2005-11-18 17:02:14 +0000
committerAndrew Stubbs <andrew.stubbs@st.com>2005-11-18 17:02:14 +0000
commit0be75e027327b04542afb919c0917f78becd764a (patch)
treeb196f3e03a273f7bd85410702f5196131e33ed2b /gdb/mi
parent73562ad0c76e78ffc052085507181352daea9e7c (diff)
downloadgdb-0be75e027327b04542afb919c0917f78becd764a.zip
gdb-0be75e027327b04542afb919c0917f78becd764a.tar.gz
gdb-0be75e027327b04542afb919c0917f78becd764a.tar.bz2
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.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 17c9c38..e5644b5 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -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