1 /* MI Command Set - MI output generating routines for GDB.
2 Copyright (C) 2000-2019 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions (a Red Hat company).
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
29 class mi_ui_out
: public ui_out
33 explicit mi_ui_out (int mi_version
);
34 virtual ~mi_ui_out ();
38 void put (struct ui_file
*stream
);
40 /* Return the version number of the current MI. */
43 bool can_emit_style_escape () const override
50 virtual void do_table_begin (int nbrofcols
, int nr_rows
, const char *tblid
)
52 virtual void do_table_body () override
;
53 virtual void do_table_header (int width
, ui_align align
,
54 const std::string
&col_name
,
55 const std::string
&col_hdr
) override
;
56 virtual void do_table_end () override
;
58 virtual void do_begin (ui_out_type type
, const char *id
) override
;
59 virtual void do_end (ui_out_type type
) override
;
60 virtual void do_field_signed (int fldno
, int width
, ui_align align
,
61 const char *fldname
, LONGEST value
) override
;
62 virtual void do_field_unsigned (int fldno
, int width
, ui_align align
,
63 const char *fldname
, ULONGEST value
)
65 virtual void do_field_skip (int fldno
, int width
, ui_align align
,
66 const char *fldname
) override
;
67 virtual void do_field_string (int fldno
, int width
, ui_align align
,
68 const char *fldname
, const char *string
,
69 ui_out_style_kind style
) override
;
70 virtual void do_field_fmt (int fldno
, int width
, ui_align align
,
71 const char *fldname
, const char *format
, va_list args
)
72 override
ATTRIBUTE_PRINTF (6,0);
73 virtual void do_spaces (int numspaces
) override
;
74 virtual void do_text (const char *string
) override
;
75 virtual void do_message (const char *format
, va_list args
) override
76 ATTRIBUTE_PRINTF (2,0);
77 virtual void do_wrap_hint (const char *identstring
) override
;
78 virtual void do_flush () override
;
79 virtual void do_redirect (struct ui_file
*outstream
) override
;
81 virtual bool do_is_mi_like_p () const override
86 void field_separator ();
87 void open (const char *name
, ui_out_type type
);
88 void close (ui_out_type type
);
90 /* Convenience method that returns the MI out's string stream cast
91 to its appropriate type. Assumes/asserts that output was not
93 string_file
*main_stream ();
95 bool m_suppress_field_separator
;
96 bool m_suppress_output
;
98 std::vector
<ui_file
*> m_streams
;
101 /* Create an MI ui-out object with MI version MI_VERSION, which should be equal
102 to one of the INTERP_MI* constants (see interps.h).
104 Return nullptr if an invalid version is provided. */
105 mi_ui_out
*mi_out_new (const char *mi_version
);
107 int mi_version (ui_out
*uiout
);
108 void mi_out_put (ui_out
*uiout
, struct ui_file
*stream
);
109 void mi_out_rewind (ui_out
*uiout
);
111 #endif /* MI_MI_OUT_H */