2002-10-03 Jeff Johnston <jjohnstn@redhat.com>

* mi-cmd-var.c (mi_cmd_var_update): Fix for PR gdb/672.  For m2,
        output list begin and end for "changelist" rather than tuple begin/end.
        (varobj_update_one): For m2, add tuple begin and end for varobj
        update output.
This commit is contained in:
Jeff Johnston 2002-10-03 20:02:13 +00:00
parent 8607b6c98d
commit 3a387118eb
2 changed files with 32 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2002-10-03 Jeff Johnston <jjohnstn@redhat.com>
* mi-cmd-var.c (mi_cmd_var_update): Fix for PR gdb/672. For m2,
output list begin and end for "changelist" rather than tuple begin/end.
(varobj_update_one): For m2, add tuple begin and end for varobj
update output.
2002-10-02 Elena Zannoni <ezannoni@redhat.com>
* mi-main.c (mi_cmd_exec_return): Don't use

View File

@ -405,6 +405,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
struct varobj *var;
struct varobj **rootlist;
struct varobj **cr;
struct cleanup *cleanup;
char *name;
int nv;
@ -419,10 +420,13 @@ mi_cmd_var_update (char *command, char **argv, int argc)
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;
@ -432,7 +436,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
cr++;
}
xfree (rootlist);
ui_out_tuple_end (uiout);
do_cleanups (cleanup);
}
else
{
@ -441,9 +445,12 @@ mi_cmd_var_update (char *command, char **argv, int argc)
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;
}
@ -457,6 +464,7 @@ varobj_update_one (struct varobj *var)
{
struct varobj **changelist;
struct varobj **cc;
struct cleanup *cleanup = NULL;
int nc;
nc = varobj_update (&var, &changelist);
@ -469,17 +477,25 @@ varobj_update_one (struct varobj *var)
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
{
@ -487,9 +503,13 @@ varobj_update_one (struct varobj *var)
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);