- for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix)
- {
- struct cleanup *back_to2;
- char *c;
- char *name;
-
- back_to2 = make_cleanup_ui_out_tuple_begin_end (uiout, "variable");
-
- name = concat ("$", tsv->name, (char *) NULL);
- make_cleanup (xfree, name);
- ui_out_field_string (uiout, "name", name);
- ui_out_field_string (uiout, "initial", plongest (tsv->initial_value));
-
- if (tsv->value_known)
- c = plongest (tsv->value);
- else if (ui_out_is_mi_like_p (uiout))
- /* For MI, we prefer not to use magic string constants, but rather
- omit the field completely. The difference between unknown and
- undefined does not seem important enough to represent. */
- c = NULL;
- else if (current_trace_status ()->running || traceframe_number >= 0)
- /* The value is/was defined, but we don't have it. */
- c = "<unknown>";
- else
- /* It is not meaningful to ask about the value. */
- c = "<undefined>";
- if (c)
- ui_out_field_string (uiout, "current", c);
- ui_out_text (uiout, "\n");