summaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-10-03 20:02:13 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-10-03 20:02:13 +0000
commitecf9b9dd514652c58daaca58aec066ef2b372956 (patch)
treea52d0cc392a9ec7855233d9092be8dfe2aa50fd2 /gdb/mi
parent144bf394fcb4db36fbe21707ad871393b20ad011 (diff)
downloadgdb-ecf9b9dd514652c58daaca58aec066ef2b372956.tar.gz
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.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/ChangeLog7
-rw-r--r--gdb/mi/mi-cmd-var.c30
2 files changed, 32 insertions, 5 deletions
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 7a1552f4d23..1574dd6efa7 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -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
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index cb5e939e9f1..114906609ef 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -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);