aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-03-31 12:49:50 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-04-07 16:01:17 +0100
commit711898e128ab036b752d1bc8df1d61ae62ade5cd (patch)
tree10110983b315477ed262e3b0d8c8ee1d52d45dd4 /gdb/tui
parentdbf5d61bdad9131d31c3410f123db3e296d91dfc (diff)
downloadgdb-711898e128ab036b752d1bc8df1d61ae62ade5cd.zip
gdb-711898e128ab036b752d1bc8df1d61ae62ade5cd.tar.gz
gdb-711898e128ab036b752d1bc8df1d61ae62ade5cd.tar.bz2
gdb: switch to using 'const reggroup *' in tui-regs.{c,h}
Make uses of 'reggroup *' const throughout tui-regs.{c,h}. There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-regs.c22
-rw-r--r--gdb/tui/tui-regs.h9
2 files changed, 16 insertions, 15 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 1909853..5c6189a 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -177,7 +177,7 @@ tui_data_window::first_reg_element_no_inline (int line_no) const
/* Show the registers of the given group in the data window
and refresh the window. */
void
-tui_data_window::show_registers (struct reggroup *group)
+tui_data_window::show_registers (const reggroup *group)
{
if (group == 0)
group = general_reggroup;
@@ -207,7 +207,7 @@ tui_data_window::show_registers (struct reggroup *group)
refresh_values_only is true. */
void
-tui_data_window::show_register_group (struct reggroup *group,
+tui_data_window::show_register_group (const reggroup *group,
struct frame_info *frame,
bool refresh_values_only)
{
@@ -518,10 +518,10 @@ tui_data_item_window::rerender (WINDOW *handle, int field_width)
around behaviour. Returns the next register group, or NULL if the
register window is not currently being displayed. */
-static struct reggroup *
-tui_reg_next (struct reggroup *current_group, struct gdbarch *gdbarch)
+static const reggroup *
+tui_reg_next (const reggroup *current_group, struct gdbarch *gdbarch)
{
- struct reggroup *group = NULL;
+ const reggroup *group = NULL;
if (current_group != NULL)
{
@@ -536,10 +536,10 @@ tui_reg_next (struct reggroup *current_group, struct gdbarch *gdbarch)
around behaviour. Returns the previous register group, or NULL if the
register window is not currently being displayed. */
-static struct reggroup *
-tui_reg_prev (struct reggroup *current_group, struct gdbarch *gdbarch)
+static const reggroup *
+tui_reg_prev (const reggroup *current_group, struct gdbarch *gdbarch)
{
- struct reggroup *group = NULL;
+ const reggroup *group = NULL;
if (current_group != NULL)
{
@@ -561,7 +561,7 @@ tui_reg_command (const char *args, int from_tty)
if (args != NULL)
{
- struct reggroup *group, *match = NULL;
+ const reggroup *group, *match = NULL;
size_t len = strlen (args);
/* Make sure the curses mode is enabled. */
@@ -575,7 +575,7 @@ tui_reg_command (const char *args, int from_tty)
if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible ())
tui_regs_layout ();
- struct reggroup *current_group = TUI_DATA_WIN->get_current_group ();
+ const reggroup *current_group = TUI_DATA_WIN->get_current_group ();
if (strncmp (args, "next", len) == 0)
match = tui_reg_next (current_group, gdbarch);
else if (strncmp (args, "prev", len) == 0)
@@ -603,7 +603,7 @@ tui_reg_command (const char *args, int from_tty)
}
else
{
- struct reggroup *group;
+ const reggroup *group;
int first;
gdb_printf (_("\"tui reg\" must be followed by the name of "
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 9192a73..5289d3a 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -23,6 +23,7 @@
#define TUI_TUI_REGS_H
#include "tui/tui-data.h"
+#include "reggroups.h"
/* A data item window. */
@@ -60,9 +61,9 @@ struct tui_data_window : public tui_win_info
void check_register_values (struct frame_info *frame);
- void show_registers (struct reggroup *group);
+ void show_registers (const reggroup *group);
- struct reggroup *get_current_group () const
+ const reggroup *get_current_group () const
{
return m_current_group;
}
@@ -99,7 +100,7 @@ private:
display off the end of the register display. */
void display_reg_element_at_line (int start_element_no, int start_line_no);
- void show_register_group (struct reggroup *group,
+ void show_register_group (const reggroup *group,
struct frame_info *frame,
bool refresh_values_only);
@@ -125,7 +126,7 @@ private:
/* Windows that are used to display registers. */
std::vector<tui_data_item_window> m_regs_content;
int m_regs_column_count = 0;
- struct reggroup *m_current_group = nullptr;
+ const reggroup *m_current_group = nullptr;
/* Width of each register's display area. */
int m_item_width = 0;