/* Output generating routines for GDB.
- Copyright (C) 1999-2017 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
do_end (type);
}
-struct ui_out_end_cleanup_data
-{
- struct ui_out *uiout;
- enum ui_out_type type;
-};
-
-static void
-do_cleanup_end (void *data)
-{
- struct ui_out_end_cleanup_data *end_cleanup_data
- = (struct ui_out_end_cleanup_data *) data;
-
- end_cleanup_data->uiout->end (end_cleanup_data->type);
- xfree (end_cleanup_data);
-}
-
-static struct cleanup *
-make_cleanup_ui_out_end (struct ui_out *uiout,
- enum ui_out_type type)
-{
- struct ui_out_end_cleanup_data *end_cleanup_data;
-
- end_cleanup_data = XNEW (struct ui_out_end_cleanup_data);
- end_cleanup_data->uiout = uiout;
- end_cleanup_data->type = type;
- return make_cleanup (do_cleanup_end, end_cleanup_data);
-}
-
-struct cleanup *
-make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
- const char *id)
-{
- uiout->begin (ui_out_type_tuple, id);
- return make_cleanup_ui_out_end (uiout, ui_out_type_tuple);
-}
-
-struct cleanup *
-make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
- const char *id)
-{
- uiout->begin (ui_out_type_list, id);
- return make_cleanup_ui_out_end (uiout, ui_out_type_list);
-}
-
void
ui_out::field_int (const char *fldname, int value)
{
ui_out::field_core_addr (const char *fldname, struct gdbarch *gdbarch,
CORE_ADDR address)
{
- field_string (fldname, print_core_address (gdbarch, address));
+ field_string (fldname, print_core_address (gdbarch, address),
+ ui_out_style_kind::ADDRESS);
}
void
-ui_out::field_stream (const char *fldname, string_file &stream)
+ui_out::field_stream (const char *fldname, string_file &stream,
+ ui_out_style_kind style)
{
if (!stream.empty ())
- field_string (fldname, stream.c_str ());
+ field_string (fldname, stream.c_str (), style);
else
field_skip (fldname);
stream.clear ();
}
void
-ui_out::field_string (const char *fldname, const char *string)
+ui_out::field_string (const char *fldname, const char *string,
+ ui_out_style_kind style)
{
int fldno;
int width;
verify_field (&fldno, &width, &align);
- do_field_string (fldno, width, align, fldname, string);
+ do_field_string (fldno, width, align, fldname, string, style);
+}
+
+void
+ui_out::field_string (const char *fldname, const std::string &string)
+{
+ field_string (fldname, string.c_str ());
}
/* VARARGS */
int width;
ui_align align;
- /* Will not align, but has to call anyway. */
verify_field (&fldno, &width, &align);
va_start (args, format);
}
bool
-ui_out::is_mi_like_p ()
+ui_out::is_mi_like_p () const
{
return do_is_mi_like_p ();
}