1 /* TUI display registers in window.
3 Copyright (C) 1998-2019 Free Software Foundation, Inc.
5 Contributed by Hewlett-Packard Company.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #ifndef TUI_TUI_REGS_H
23 #define TUI_TUI_REGS_H
25 #include "tui/tui-data.h"
27 /* A data item window. */
29 struct tui_data_item_window
: public tui_gen_win_info
31 tui_data_item_window ()
32 : tui_gen_win_info (DATA_ITEM_WIN
)
36 ~tui_data_item_window () override
;
38 const char *name
= nullptr;
39 /* The register number, or data display number. */
41 void *value
= nullptr;
42 bool highlight
= false;
43 char *content
= nullptr;
46 /* The TUI registers window. */
47 struct tui_data_window
: public tui_win_info
50 : tui_win_info (DATA_WIN
)
54 DISABLE_COPY_AND_ASSIGN (tui_data_window
);
56 void clear_detail () override
;
57 void refresh_all () override
;
59 void set_new_height (int height
) override
;
61 void refresh_window () override
;
63 const char *name () const override
68 /* Windows that are used to display registers. */
69 std::vector
<std::unique_ptr
<tui_data_item_window
>> regs_content
;
70 int regs_column_count
= 0;
71 /* Should regs be displayed at all? */
72 bool display_regs
= false;
73 struct reggroup
*current_group
= nullptr;
75 /* Answer the number of the last line in the regs display. If there
76 are no registers (-1) is returned. */
77 int last_regs_line_no () const;
79 /* Answer the line number that the register element at element_no is
80 on. If element_no is greater than the number of register
81 elements there are, -1 is returned. */
82 int line_from_reg_element_no (int element_no
) const;
84 /* Answer the index of the first element in line_no. If line_no is
85 past the register area (-1) is returned. */
86 int first_reg_element_no_inline (int line_no
) const;
88 /* Displays the data that is in the data window's content. It does
89 not set the content. */
90 void display_all_data ();
92 /* Delete all the item windows in the data window. This is usually
93 done when the data window is scrolled. */
94 void delete_data_content_windows ();
96 void erase_data_content (const char *prompt
);
98 /* Display the registers in the content from 'start_element_no'
99 until the end of the register content or the end of the display
100 height. No checking for displaying past the end of the registers
102 void display_registers_from (int start_element_no
);
104 /* Display the registers starting at line line_no in the data
105 window. Answers the line number that the display actually
106 started from. If nothing is displayed (-1) is returned. */
107 int display_registers_from_line (int line_no
);
111 void do_scroll_vertical (int num_to_scroll
) override
;
112 void do_scroll_horizontal (int num_to_scroll
) override
115 void do_make_visible_with_new_height () override
;
117 /* Return the index of the first element displayed. If none are
118 displayed, then return -1. */
119 int first_data_item_displayed ();
121 /* Display the registers in the content from 'start_element_no' on
122 'start_line_no' until the end of the register content or the end
123 of the display height. This function checks that we won't
124 display off the end of the register display. */
125 void display_reg_element_at_line (int start_element_no
, int start_line_no
);
128 extern void tui_check_register_values (struct frame_info
*);
129 extern void tui_show_registers (struct reggroup
*group
);
131 #endif /* TUI_TUI_REGS_H */
This page took 0.032552 seconds and 5 git commands to generate.