GDB (xrefs)
Loading...
Searching...
No Matches
tui-regs.h
Go to the documentation of this file.
1/* TUI display registers in window.
2
3 Copyright (C) 1998-2023 Free Software Foundation, Inc.
4
5 Contributed by Hewlett-Packard Company.
6
7 This file is part of GDB.
8
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.
13
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.
18
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/>. */
21
22#ifndef TUI_TUI_REGS_H
23#define TUI_TUI_REGS_H
24
25#include "tui/tui-data.h"
26#include "reggroups.h"
27
28/* A data item window. */
29
31{
33
35
37
38 void rerender (WINDOW *handle, int field_width);
39
40 /* Location. */
41 int x = 0;
42 int y = 0;
43 /* The register number. */
44 int regno = -1;
45 bool highlight = false;
46 bool visible = false;
47 std::string content;
48};
49
50/* The TUI registers window. */
52{
53 tui_data_window () = default;
54
56
57 const char *name () const override
58 {
59 return DATA_NAME;
60 }
61
63
64 void show_registers (const reggroup *group);
65
67 {
68 return m_current_group;
69 }
70
71protected:
72
73 void do_scroll_vertical (int num_to_scroll) override;
74 void do_scroll_horizontal (int num_to_scroll) override
75 {
76 }
77
78 void rerender () override;
79
80private:
81
82 /* Display the registers in the content from 'start_element_no'
83 until the end of the register content or the end of the display
84 height. No checking for displaying past the end of the registers
85 is done here. */
86 void display_registers_from (int start_element_no);
87
88 /* Display the registers starting at line line_no in the data
89 window. Answers the line number that the display actually
90 started from. If nothing is displayed (-1) is returned. */
91 int display_registers_from_line (int line_no);
92
93 /* Return the index of the first element displayed. If none are
94 displayed, then return -1. */
96
97 /* Display the registers in the content from 'start_element_no' on
98 'start_line_no' until the end of the register content or the end
99 of the display height. This function checks that we won't
100 display off the end of the register display. */
101 void display_reg_element_at_line (int start_element_no, int start_line_no);
102
103 void show_register_group (const reggroup *group,
104 frame_info_ptr frame,
105 bool refresh_values_only);
106
107 /* Answer the number of the last line in the regs display. If there
108 are no registers (-1) is returned. */
109 int last_regs_line_no () const;
110
111 /* Answer the line number that the register element at element_no is
112 on. If element_no is greater than the number of register
113 elements there are, -1 is returned. */
114 int line_from_reg_element_no (int element_no) const;
115
116 /* Answer the index of the first element in line_no. If line_no is
117 past the register area (-1) is returned. */
118 int first_reg_element_no_inline (int line_no) const;
119
120 /* Delete all the item windows in the data window. This is usually
121 done when the data window is scrolled. */
123
124 void erase_data_content (const char *prompt);
125
126 /* Windows that are used to display registers. */
127 std::vector<tui_data_item_window> m_regs_content;
129 const reggroup *m_current_group = nullptr;
130
131 /* Width of each register's display area. */
133};
134
135#endif /* TUI_TUI_REGS_H */
tui_data_item_window()=default
void rerender(WINDOW *handle, int field_width)
Definition tui-regs.c:488
std::string content
Definition tui-regs.h:47
tui_data_item_window(tui_data_item_window &&)=default
DISABLE_COPY_AND_ASSIGN(tui_data_item_window)
void show_register_group(const reggroup *group, frame_info_ptr frame, bool refresh_values_only)
Definition tui-regs.c:204
void erase_data_content(const char *prompt)
Definition tui-regs.c:397
int last_regs_line_no() const
Definition tui-regs.c:128
tui_data_window()=default
int line_from_reg_element_no(int element_no) const
Definition tui-regs.c:139
void do_scroll_vertical(int num_to_scroll) override
Definition tui-regs.c:433
void check_register_values(frame_info_ptr frame)
Definition tui-regs.c:459
void show_registers(const reggroup *group)
Definition tui-regs.c:174
int m_regs_column_count
Definition tui-regs.h:128
std::vector< tui_data_item_window > m_regs_content
Definition tui-regs.h:127
void delete_data_content_windows()
Definition tui-regs.c:389
void display_registers_from(int start_element_no)
Definition tui-regs.c:267
const reggroup * get_current_group() const
Definition tui-regs.h:66
void rerender() override
Definition tui-regs.c:418
int display_registers_from_line(int line_no)
Definition tui-regs.c:344
int first_reg_element_no_inline(int line_no) const
Definition tui-regs.c:163
const reggroup * m_current_group
Definition tui-regs.h:129
int first_data_item_displayed()
Definition tui-regs.c:375
const char * name() const override
Definition tui-regs.h:57
void display_reg_element_at_line(int start_element_no, int start_line_no)
Definition tui-regs.c:318
void do_scroll_horizontal(int num_to_scroll) override
Definition tui-regs.h:74
DISABLE_COPY_AND_ASSIGN(tui_data_window)
#define DATA_NAME
Definition tui-data.h:188