mi->log = mi->err;
mi->targ = new mi_console_file (mi->raw_stdout, "@", '"');
mi->event_channel = new mi_console_file (mi->raw_stdout, "=", 0);
- mi->mi_uiout = mi_out_new (name ());
+ mi->mi_uiout = mi_out_new (name ()).release ();
gdb_assert (mi->mi_uiout != nullptr);
mi->cli_uiout = new cli_ui_out (mi->out);
which means uiout may not be correct. Fix it for the duration
of this function. */
- std::unique_ptr<ui_out> uiout (mi_out_new (current_interpreter ()->name ()));
+ auto uiout = mi_out_new (current_interpreter ()->name ());
if (uiout == nullptr)
return;
/* See mi/mi-out.h. */
-mi_ui_out *
+std::unique_ptr<mi_ui_out>
mi_out_new (const char *mi_version)
{
if (streq (mi_version, INTERP_MI4) || streq (mi_version, INTERP_MI))
- return new mi_ui_out (4);
+ return gdb::make_unique<mi_ui_out> (4);
if (streq (mi_version, INTERP_MI3))
- return new mi_ui_out (3);
+ return gdb::make_unique<mi_ui_out> (3);
if (streq (mi_version, INTERP_MI2))
- return new mi_ui_out (2);
+ return gdb::make_unique<mi_ui_out> (2);
return nullptr;
}
to one of the INTERP_MI* constants (see interps.h).
Return nullptr if an invalid version is provided. */
-mi_ui_out *mi_out_new (const char *mi_version);
+std::unique_ptr<mi_ui_out> mi_out_new (const char *mi_version);
void mi_out_put (ui_out *uiout, struct ui_file *stream);
void mi_out_rewind (ui_out *uiout);