/* MI Command Set - output generating routines.
- Copyright (C) 2000-2019 Free Software Foundation, Inc.
+ Copyright (C) 2000-2020 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
const char *tblid)
{
open (tblid, ui_out_type_tuple);
- do_field_int (-1, -1, ui_left, "nr_rows", nr_rows);
- do_field_int (-1, -1, ui_left, "nr_cols", nr_cols);
+ do_field_signed (-1, -1, ui_left, "nr_rows", nr_rows);
+ do_field_signed (-1, -1, ui_left, "nr_cols", nr_cols);
open ("hdr", ui_out_type_list);
}
const std::string &col_hdr)
{
open (NULL, ui_out_type_tuple);
- do_field_int (0, 0, ui_center, "width", width);
- do_field_int (0, 0, ui_center, "alignment", alignment);
+ do_field_signed (0, 0, ui_center, "width", width);
+ do_field_signed (0, 0, ui_center, "alignment", alignment);
do_field_string (0, 0, ui_center, "col_name", col_name.c_str (),
- ui_out_style_kind::DEFAULT);
+ ui_file_style ());
do_field_string (0, width, alignment, "colhdr", col_hdr.c_str (),
- ui_out_style_kind::DEFAULT);
+ ui_file_style ());
close (ui_out_type_tuple);
}
/* Output an int field. */
void
-mi_ui_out::do_field_int (int fldno, int width, ui_align alignment,
- const char *fldname, int value)
+mi_ui_out::do_field_signed (int fldno, int width, ui_align alignment,
+ const char *fldname, LONGEST value)
{
- char buffer[20]; /* FIXME: how many chars long a %d can become? */
+ do_field_string (fldno, width, alignment, fldname, plongest (value),
+ ui_file_style ());
+}
+
+/* Output an unsigned field. */
- xsnprintf (buffer, sizeof (buffer), "%d", value);
- do_field_string (fldno, width, alignment, fldname, buffer,
- ui_out_style_kind::DEFAULT);
+void
+mi_ui_out::do_field_unsigned (int fldno, int width, ui_align alignment,
+ const char *fldname, ULONGEST value)
+{
+ do_field_string (fldno, width, alignment, fldname, pulongest (value),
+ ui_file_style ());
}
/* Used to omit a field. */
void
mi_ui_out::do_field_string (int fldno, int width, ui_align align,
const char *fldname, const char *string,
- ui_out_style_kind style)
+ const ui_file_style &style)
{
ui_file *stream = m_streams.back ();
field_separator ();
void
mi_ui_out::do_field_fmt (int fldno, int width, ui_align align,
- const char *fldname, const char *format,
- va_list args)
+ const char *fldname, const ui_file_style &style,
+ const char *format, va_list args)
{
ui_file *stream = m_streams.back ();
field_separator ();
}
void
-mi_ui_out::do_message (const char *format, va_list args)
+mi_ui_out::do_message (const ui_file_style &style,
+ const char *format, va_list args)
{
}
/* Constructor for an `mi_out_data' object. */
mi_ui_out::mi_ui_out (int mi_version)
-: m_suppress_field_separator (false),
+: ui_out (mi_version >= 3
+ ? fix_multi_location_breakpoint_output : (ui_out_flag) 0),
+ m_suppress_field_separator (false),
m_suppress_output (false),
m_mi_version (mi_version)
{
mi_ui_out *
mi_out_new (const char *mi_version)
{
- if (streq (mi_version, INTERP_MI3))
+ if (streq (mi_version, INTERP_MI3) || streq (mi_version, INTERP_MI))
return new mi_ui_out (3);
- if (streq (mi_version, INTERP_MI2) || streq (mi_version, INTERP_MI))
+ if (streq (mi_version, INTERP_MI2))
return new mi_ui_out (2);
if (streq (mi_version, INTERP_MI1))