aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 368c13f..ed097cf 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -816,16 +816,14 @@ mi_tsv_modified (const struct trace_state_variable *tsv)
gdb_printf (mi->event_channel,
"tsv-modified");
- mi_uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (mi_uiout, mi->event_channel);
mi_uiout->field_string ("name", tsv->name);
mi_uiout->field_string ("initial",
- plongest (tsv->initial_value));
+ plongest (tsv->initial_value));
if (tsv->value_known)
mi_uiout->field_string ("current", plongest (tsv->value));
- mi_uiout->redirect (NULL);
-
gdb_flush (mi->event_channel);
}
}
@@ -844,7 +842,7 @@ mi_print_breakpoint_for_event (struct mi_interp *mi, breakpoint *bp)
break if anything is output to mi_uiout prior to calling the
breakpoint_created notifications. So, we use
ui_out_redirect. */
- mi_uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (mi_uiout, mi->event_channel);
try
{
@@ -857,8 +855,6 @@ mi_print_breakpoint_for_event (struct mi_interp *mi, breakpoint *bp)
{
exception_print (gdb_stderr, ex);
}
-
- mi_uiout->redirect (NULL);
}
/* Emit notification about a created breakpoint. */
@@ -1090,12 +1086,10 @@ mi_solib_loaded (struct so_list *solib)
gdb_printf (mi->event_channel, "library-loaded");
- uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (uiout, mi->event_channel);
mi_output_solib_attribs (uiout, solib);
- uiout->redirect (NULL);
-
gdb_flush (mi->event_channel);
}
}
@@ -1118,7 +1112,7 @@ mi_solib_unloaded (struct so_list *solib)
gdb_printf (mi->event_channel, "library-unloaded");
- uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (uiout, mi->event_channel);
uiout->field_string ("id", solib->so_original_name);
uiout->field_string ("target-name", solib->so_original_name);
@@ -1128,8 +1122,6 @@ mi_solib_unloaded (struct so_list *solib)
uiout->field_fmt ("thread-group", "i%d", current_inferior ()->num);
}
- uiout->redirect (NULL);
-
gdb_flush (mi->event_channel);
}
}
@@ -1157,13 +1149,11 @@ mi_command_param_changed (const char *param, const char *value)
gdb_printf (mi->event_channel, "cmd-param-changed");
- mi_uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (mi_uiout, mi->event_channel);
mi_uiout->field_string ("param", param);
mi_uiout->field_string ("value", value);
- mi_uiout->redirect (NULL);
-
gdb_flush (mi->event_channel);
}
}
@@ -1193,7 +1183,7 @@ mi_memory_changed (struct inferior *inferior, CORE_ADDR memaddr,
gdb_printf (mi->event_channel, "memory-changed");
- mi_uiout->redirect (mi->event_channel);
+ ui_out_redirect_pop redir (mi_uiout, mi->event_channel);
mi_uiout->field_fmt ("thread-group", "i%d", inferior->num);
mi_uiout->field_core_addr ("addr", target_gdbarch (), memaddr);
@@ -1210,8 +1200,6 @@ mi_memory_changed (struct inferior *inferior, CORE_ADDR memaddr,
mi_uiout->field_string ("type", "code");
}
- mi_uiout->redirect (NULL);
-
gdb_flush (mi->event_channel);
}
}
@@ -1243,8 +1231,7 @@ mi_user_selected_context_changed (user_selected_what selection)
mi_uiout = top_level_interpreter ()->interp_ui_out ();
- mi_uiout->redirect (mi->event_channel);
- ui_out_redirect_pop redirect_popper (mi_uiout);
+ ui_out_redirect_pop redirect_popper (mi_uiout, mi->event_channel);
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();