aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-05 17:14:46 -0600
committerTom Tromey <tom@tromey.com>2019-08-13 14:52:09 -0600
commitb4ef5aeb3a1880490f9441655d9de74727c9063a (patch)
tree991ca037ba947b6b55c5ae26f2b654df62e839b6 /gdb/tui
parentfede52738f3ed3e375d84197380ae1a6cd35c6fe (diff)
downloadgdb-b4ef5aeb3a1880490f9441655d9de74727c9063a.zip
gdb-b4ef5aeb3a1880490f9441655d9de74727c9063a.tar.gz
gdb-b4ef5aeb3a1880490f9441655d9de74727c9063a.tar.bz2
Change tui_check_and_display_highlight_if_needed to be a method
This changes tui_check_and_display_highlight_if_needed to be a method on tui_win_info. This makes it clear that the NULL check in that function is not needed, so it is removed here. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_erase_source_content) (tui_show_source_content, tui_source_window_base::refresh_all): Update. * tui/tui-wingeneral.h (tui_check_and_display_highlight_if_needed): Don't declare. * tui/tui-wingeneral.c (tui_win_info::check_and_display_highlight_if_needed): Rename from check_and_display_highlight_if_needed. * tui/tui-win.c (tui_rehighlight_all) (tui_win_info::make_visible_with_new_height): Update. * tui/tui-regs.c (tui_data_window::display_registers_from_line) (tui_data_window::erase_data_content) (tui_data_window::display_all_data): Update. * tui/tui-data.h (struct tui_win_info) <check_and_display_highlight_if_needed>: Declare.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-data.h2
-rw-r--r--gdb/tui/tui-regs.c6
-rw-r--r--gdb/tui/tui-win.c4
-rw-r--r--gdb/tui/tui-wingeneral.c11
-rw-r--r--gdb/tui/tui-wingeneral.h1
-rw-r--r--gdb/tui/tui-winsource.c6
6 files changed, 15 insertions, 15 deletions
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index d3fa036..6683848 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -291,6 +291,8 @@ public:
return true;
}
+ void check_and_display_highlight_if_needed ();
+
/* Can this window ever be highlighted? */
bool can_highlight = true;
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 2765462..aaba94d 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -369,7 +369,7 @@ tui_data_window::display_reg_element_at_line (int start_element_no,
int
tui_data_window::display_registers_from_line (int line_no)
{
- tui_check_and_display_highlight_if_needed (this);
+ check_and_display_highlight_if_needed ();
if (!regs_content.empty ())
{
int element_no;
@@ -436,7 +436,7 @@ void
tui_data_window::erase_data_content (const char *prompt)
{
werase (handle);
- tui_check_and_display_highlight_if_needed (this);
+ check_and_display_highlight_if_needed ();
if (prompt != NULL)
{
int half_width = (width - 2) / 2;
@@ -462,7 +462,7 @@ tui_data_window::display_all_data ()
{
erase_data_content (NULL);
delete_data_content_windows ();
- tui_check_and_display_highlight_if_needed (this);
+ check_and_display_highlight_if_needed ();
display_registers_from (0);
}
}
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index be01c15..ff4f2ee 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -515,7 +515,7 @@ void
tui_rehighlight_all (void)
{
for (tui_win_info *win_info : all_tui_windows ())
- tui_check_and_display_highlight_if_needed (win_info);
+ win_info->check_and_display_highlight_if_needed ();
}
/* Resize all the windows based on the terminal size. This function
@@ -1205,7 +1205,7 @@ void
tui_win_info::make_visible_with_new_height ()
{
make_visible (true);
- tui_check_and_display_highlight_if_needed (this);
+ check_and_display_highlight_if_needed ();
do_make_visible_with_new_height ();
}
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 79f93ce..8ff5aa5 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -112,15 +112,14 @@ tui_highlight_win (struct tui_win_info *win_info)
}
void
-tui_check_and_display_highlight_if_needed (struct tui_win_info *win_info)
+tui_win_info::check_and_display_highlight_if_needed ()
{
- if (win_info != NULL && win_info->can_highlight)
+ if (can_highlight)
{
- if (win_info->is_highlighted)
- tui_highlight_win (win_info);
+ if (is_highlighted)
+ tui_highlight_win (this);
else
- tui_unhighlight_win (win_info);
-
+ tui_unhighlight_win (this);
}
}
diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h
index 051be6d..54d6eb6 100644
--- a/gdb/tui/tui-wingeneral.h
+++ b/gdb/tui/tui-wingeneral.h
@@ -33,7 +33,6 @@ extern void tui_make_all_invisible (void);
extern void tui_unhighlight_win (struct tui_win_info *);
extern void tui_make_window (struct tui_gen_win_info *, enum tui_box);
extern void tui_highlight_win (struct tui_win_info *);
-extern void tui_check_and_display_highlight_if_needed (struct tui_win_info *);
extern void tui_refresh_all ();
extern void tui_delete_win (WINDOW *window);
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 3de2692..6a72c6f 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -225,7 +225,7 @@ tui_erase_source_content (struct tui_source_window_base *win_info)
if (win_info->handle != NULL)
{
werase (win_info->handle);
- tui_check_and_display_highlight_if_needed (win_info);
+ win_info->check_and_display_highlight_if_needed ();
const char *no_src_str;
@@ -287,7 +287,7 @@ tui_show_source_content (struct tui_source_window_base *win_info)
else
tui_erase_source_content (win_info);
- tui_check_and_display_highlight_if_needed (win_info);
+ win_info->check_and_display_highlight_if_needed ();
win_info->refresh_window ();
}
@@ -333,7 +333,7 @@ void
tui_source_window_base::refresh_all ()
{
tui_show_source_content (this);
- tui_check_and_display_highlight_if_needed (this);
+ check_and_display_highlight_if_needed ();
tui_erase_exec_info_content (this);
tui_update_exec_info (this);
}