GDB (xrefs)

mi-out.h
Go to the documentation of this file.
1 /* MI Command Set - MI output generating routines for GDB.
2 Copyright (C) 2000-2018 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions (a Red Hat company).
4
5 This file is part of GDB.
6
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.
11
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.
16
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/>. */
19
20 #ifndef MI_OUT_H
21 #define MI_OUT_H 1
22
23 #include <vector>
24
25 struct ui_out;
26 struct ui_file;
27
28
29 class mi_ui_out : public ui_out
30 {
31 public:
32
33 explicit mi_ui_out (int mi_version);
34 virtual ~mi_ui_out ();
35
36 /* MI-specific */
37 void rewind ();
38 void put (struct ui_file *stream);
39
40 /* Return the version number of the current MI. */
41 int version ();
42
43 protected:
44
45 virtual void do_table_begin (int nbrofcols, int nr_rows, const char *tblid)
46 override;
47 virtual void do_table_body () override;
48 virtual void do_table_header (int width, ui_align align,
49 const std::string &col_name,
50 const std::string &col_hdr) override;
51 virtual void do_table_end () override;
52
53 virtual void do_begin (ui_out_type type, const char *id) override;
54 virtual void do_end (ui_out_type type) override;
55 virtual void do_field_int (int fldno, int width, ui_align align,
56 const char *fldname, int value) override;
57 virtual void do_field_skip (int fldno, int width, ui_align align,
58 const char *fldname) override;
59 virtual void do_field_string (int fldno, int width, ui_align align,
60 const char *fldname, const char *string) override;
61 virtual void do_field_fmt (int fldno, int width, ui_align align,
62 const char *fldname, const char *format, va_list args)
63 override ATTRIBUTE_PRINTF (6,0);
64 virtual void do_spaces (int numspaces) override;
65 virtual void do_text (const char *string) override;
66 virtual void do_message (const char *format, va_list args) override
67 ATTRIBUTE_PRINTF (2,0);
68 virtual void do_wrap_hint (const char *identstring) override;
69 virtual void do_flush () override;
70 virtual void do_redirect (struct ui_file *outstream) override;
71
72 virtual bool do_is_mi_like_p () override
73 { return true; }
74
75 private:
76
77 void field_separator ();
78 void open (const char *name, ui_out_type type);
79 void close (ui_out_type type);
80
81 /* Convenience method that returns the MI out's string stream cast
82 to its appropriate type. Assumes/asserts that output was not
83 redirected. */
84 string_file *main_stream ();
85
86 bool m_suppress_field_separator;
87 bool m_suppress_output;
88 int m_mi_version;
89 std::vector<ui_file *> m_streams;
90 };
91
92 mi_ui_out *mi_out_new (int mi_version);
93 int mi_version (ui_out *uiout);
94 void mi_out_put (ui_out *uiout, struct ui_file *stream);
95 void mi_out_rewind (ui_out *uiout);
96
97 #endif /* MI_OUT_H */
mi_ui_out::close
void close(ui_out_type type)
Definition: mi-out.c:218
string
const char * string
Definition: signals.c:50
mi_ui_out::mi_ui_out
mi_ui_out(int mi_version)
Definition: mi-out.c:276
mi_ui_out::do_field_fmt
virtual void do_field_fmt(int fldno, int width, ui_align align, const char *fldname, const char *format, va_list args) override ATTRIBUTE_PRINTF(6
Definition: mi-out.c:130
mi_ui_out::field_separator
void field_separator()
Definition: mi-out.c:183
mi_ui_out::m_suppress_output
bool m_suppress_output
Definition: mi-out.h:87
mi_ui_out::put
void put(struct ui_file *stream)
Definition: mi-out.c:258
mi_ui_out::do_table_end
virtual void do_table_end() override
Definition: mi-out.c:52
mi_ui_out::main_stream
string_file * main_stream()
Definition: mi-out.c:240
mi_ui_out::do_flush
virtual void do_flush() override
Definition: mi-out.c:167
mi_ui_out::do_spaces
virtual void virtual void do_spaces(int numspaces) override
Definition: mi-out.c:146
mi_ui_out::do_text
virtual void do_text(const char *string) override
Definition: mi-out.c:151
mi_ui_out::rewind
void rewind()
Definition: mi-out.c:250
ui_file
Definition: ui-file.h:26
mi_ui_out::m_mi_version
int m_mi_version
Definition: mi-out.h:88
name
const char *const name
Definition: aarch64-tdep.c:76
mi_ui_out::version
int version()
Definition: mi-out.c:269
mi_ui_out::do_message
virtual void do_message(const char *format, va_list args) override ATTRIBUTE_PRINTF(2
Definition: mi-out.c:156
mi_version
int mi_version(ui_out *uiout)
Definition: mi-out.c:311
mi_ui_out::do_field_skip
virtual void do_field_skip(int fldno, int width, ui_align align, const char *fldname) override
Definition: mi-out.c:104
mi_ui_out::~mi_ui_out
virtual ~mi_ui_out()
Definition: mi-out.c:285
mi_ui_out::do_end
virtual void do_end(ui_out_type type) override
Definition: mi-out.c:84
ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF
Definition: common-defs.h:70
type
Definition: gdbtypes.h:749
mi_out_rewind
void mi_out_rewind(ui_out *uiout)
Definition: mi-out.c:323
value
Definition: value.c:169
mi_ui_out::m_streams
std::vector< ui_file * > m_streams
Definition: mi-out.h:89
mi_ui_out::do_wrap_hint
virtual void virtual void do_wrap_hint(const char *identstring) override
Definition: mi-out.c:161
ui_out
Definition: ui-out.h:77
mi_out_new
mi_ui_out * mi_out_new(int mi_version)
Definition: mi-out.c:292
mi_ui_out::do_redirect
virtual void do_redirect(struct ui_file *outstream) override
Definition: mi-out.c:174
mi_out_put
void mi_out_put(ui_out *uiout, struct ui_file *stream)
Definition: mi-out.c:317
ui_align
ui_align
Definition: ui-out.h:42
mi_ui_out::do_field_string
virtual void do_field_string(int fldno, int width, ui_align align, const char *fldname, const char *string) override
Definition: mi-out.c:113
mi_ui_out::do_field_int
virtual void do_field_int(int fldno, int width, ui_align align, const char *fldname, int value) override
Definition: mi-out.c:92
mi_ui_out::do_is_mi_like_p
virtual bool do_is_mi_like_p() override
Definition: mi-out.h:72
mi_ui_out::do_table_body
virtual void do_table_body() override
Definition: mi-out.c:42
mi_ui_out::do_table_begin
virtual void do_table_begin(int nbrofcols, int nr_rows, const char *tblid) override
Definition: mi-out.c:30
mi_ui_out
Definition: mi-out.h:29
ui_out_type
ui_out_type
Definition: ui-out.h:63
mi_ui_out::do_begin
virtual void do_begin(ui_out_type type, const char *id) override
Definition: mi-out.c:76
mi_ui_out::do_table_header
virtual void do_table_header(int width, ui_align align, const std::string &col_name, const std::string &col_hdr) override
Definition: mi-out.c:61
mi_ui_out::m_suppress_field_separator
bool m_suppress_field_separator
Definition: mi-out.h:86
mi_ui_out::open
void open(const char *name, ui_out_type type)
Definition: mi-out.c:192
string_file
Definition: ui-file.h:106