struct varobj *var;
struct varobj **rootlist;
struct varobj **cr;
+ struct cleanup *cleanup;
char *name;
int nv;
if ((*name == '*') && (*(name + 1) == '\0'))
{
nv = varobj_list (&rootlist);
- ui_out_tuple_begin (uiout, "changelist");
+ if (mi_version (uiout) <= 1)
+ cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
+ else
+ cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
if (nv <= 0)
{
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup);
return MI_CMD_DONE;
}
cr = rootlist;
cr++;
}
xfree (rootlist);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup);
}
else
{
if (var == NULL)
error ("mi_cmd_var_update: Variable object not found");
- ui_out_tuple_begin (uiout, "changelist");
+ if (mi_version (uiout) <= 1)
+ cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
+ else
+ cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
varobj_update_one (var);
- ui_out_tuple_end (uiout);
+ do_cleanups (cleanup);
}
return MI_CMD_DONE;
}
{
struct varobj **changelist;
struct varobj **cc;
+ struct cleanup *cleanup = NULL;
int nc;
nc = varobj_update (&var, &changelist);
return 1;
else if (nc == -1)
{
+ if (mi_version (uiout) > 1)
+ cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", varobj_get_objname(var));
ui_out_field_string (uiout, "in_scope", "false");
+ if (mi_version (uiout) > 1)
+ do_cleanups (cleanup);
return -1;
}
else if (nc == -2)
{
+ if (mi_version (uiout) > 1)
+ cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", varobj_get_objname (var));
ui_out_field_string (uiout, "in_scope", "true");
ui_out_field_string (uiout, "new_type", varobj_get_type(var));
ui_out_field_int (uiout, "new_num_children",
varobj_get_num_children(var));
+ if (mi_version (uiout) > 1)
+ do_cleanups (cleanup);
}
else
{
cc = changelist;
while (*cc != NULL)
{
+ if (mi_version (uiout) > 1)
+ cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
ui_out_field_string (uiout, "in_scope", "true");
ui_out_field_string (uiout, "type_changed", "false");
+ if (mi_version (uiout) > 1)
+ do_cleanups (cleanup);
cc++;
}
xfree (changelist);