This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/18832] New: mi_command_param_changed should protect redirection with a cleanup
- From: "xdje42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 17 Aug 2015 01:10:44 +0000
- Subject: [Bug mi/18832] New: mi_command_param_changed should protect redirection with a cleanup
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=18832
Bug ID: 18832
Summary: mi_command_param_changed should protect redirection
with a cleanup
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: mi
Assignee: unassigned at sourceware dot org
Reporter: xdje42 at gmail dot com
Target Milestone: ---
Filing this so I don't forget.
This code should protect the restoration of the redirection with a cleanup.
An audit of all of MI might be in order.
static void
mi_command_param_changed (const char *param, const char *value)
{
struct mi_interp *mi = top_level_interpreter_data ();
struct ui_out *mi_uiout = interp_ui_out (top_level_interpreter ());
if (mi_suppress_notification.cmd_param_changed)
return;
target_terminal_ours ();
fprintf_unfiltered (mi->event_channel,
"cmd-param-changed");
ui_out_redirect (mi_uiout, mi->event_channel);
ui_out_field_string (mi_uiout, "param", param);
ui_out_field_string (mi_uiout, "value", value);
ui_out_redirect (mi_uiout, NULL);
gdb_flush (mi->event_channel);
}
Another issue is that we only support one level of redirection in mi_out_data
(if we're already in the middle of a redirection, doing another will leave gdb
in a bad state and possible future segv, but that's a separate bug).
--
You are receiving this mail because:
You are on the CC list for the bug.