1 /* Copyright (C) 2016-2019 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* A ui_out class for the TUI. This is just like the CLI's ui_out,
24 except that it overrides output methods to detect when a source
25 line is being printed and show the source in the TUI's source
26 window instead of printing the line in the console window. */
27 class tui_ui_out
: public cli_ui_out
31 explicit tui_ui_out (ui_file
*stream
);
35 void do_field_int (int fldno
, int width
, ui_align align
, const char *fldname
,
37 void do_field_string (int fldno
, int width
, ui_align align
, const char *fldname
,
38 const char *string
, ui_out_style_kind style
) override
;
39 void do_field_fmt (int fldno
, int width
, ui_align align
, const char *fldname
,
40 const char *format
, va_list args
) override
41 ATTRIBUTE_PRINTF (6,0);
42 void do_text (const char *string
) override
;
46 /* These fields are used to make print_source_lines show the source
47 in the TUI's source window instead of in the console.
48 M_START_OF_LINE is incremented whenever something is output to
49 the ui_out. If an integer field named "line" is printed on the
50 ui_out, and nothing else has been printed yet (both
51 M_START_OF_LINE and M_LINE are still 0), we assume
52 print_source_lines is starting to print a source line, and thus
53 record the line number in M_LINE. Afterwards, when we see a
54 string field named "fullname" being output, we take the fullname
55 and the recorded line and show the source line in the TUI's
56 source window. tui_ui_out::do_text() suppresses text output
57 until it sees an endline being printed, at which point these
58 variables are reset back to 0. */
60 int m_start_of_line
= 0;
63 extern tui_ui_out
*tui_out_new (struct ui_file
*stream
);
65 #endif /* TUI_TUI_OUT_H */
This page took 0.033164 seconds and 4 git commands to generate.