From 7ba913dcdf2f94cbd501d763f0fc55a46d10331c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 5 Jul 2019 17:24:07 -0600 Subject: [PATCH] Change tui_update_exec_info to be a method This changes tui_update_exec_info to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-13 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Declare. (tui_update_exec_info): Don't declare. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_source_window_base::refresh_all) (tui_update_all_breakpoint_info): Update. (tui_source_window_base::update_exec_info): Rename from tui_update_exec_info. * tui/tui-stack.c (tui_show_frame_info): Update. --- gdb/ChangeLog | 12 ++++++++++++ gdb/tui/tui-stack.c | 4 ++-- gdb/tui/tui-winsource.c | 12 ++++++------ gdb/tui/tui-winsource.h | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0978aa48dc9..481cef897ea 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2019-08-13 Tom Tromey + + * tui/tui-winsource.h (struct tui_source_window_base) + : Declare. + (tui_update_exec_info): Don't declare. + * tui/tui-winsource.c (tui_update_source_window_as_is) + (tui_source_window_base::refresh_all) + (tui_update_all_breakpoint_info): Update. + (tui_source_window_base::update_exec_info): Rename from + tui_update_exec_info. + * tui/tui-stack.c (tui_show_frame_info): Update. + 2019-08-13 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 6acc2277c04..0a712231fa5 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -428,7 +428,7 @@ tui_show_frame_info (struct frame_info *fi) } } - tui_update_exec_info (win_info); + win_info->update_exec_info (); } return 1; @@ -445,7 +445,7 @@ tui_show_frame_info (struct frame_info *fi) for (struct tui_source_window_base *win_info : tui_source_windows ()) { tui_clear_source_content (win_info); - tui_update_exec_info (win_info); + win_info->update_exec_info (); } return 1; diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index c47da04e2a3..53113bd785c 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -106,7 +106,7 @@ tui_update_source_window_as_is (struct tui_source_window_base *win_info, { tui_update_breakpoint_info (win_info, nullptr, false); win_info->show_source_content (); - tui_update_exec_info (win_info); + win_info->update_exec_info (); if (win_info->type == SRC_WIN) { symtab_and_line sal; @@ -335,7 +335,7 @@ tui_source_window_base::refresh_all () show_source_content (); check_and_display_highlight_if_needed (); tui_erase_exec_info_content (this); - tui_update_exec_info (this); + update_exec_info (); } /* See tui-data.h. */ @@ -517,7 +517,7 @@ tui_update_all_breakpoint_info (struct breakpoint *being_deleted) { if (tui_update_breakpoint_info (win, being_deleted, false)) { - tui_update_exec_info (win); + win->update_exec_info (); } } } @@ -673,10 +673,10 @@ tui_clear_exec_info_content (struct tui_source_window_base *win_info) /* Function to update the execution info window. */ void -tui_update_exec_info (struct tui_source_window_base *win_info) +tui_source_window_base::update_exec_info () { - win_info->set_exec_info_content (); - tui_show_exec_info_content (win_info); + set_exec_info_content (); + tui_show_exec_info_content (this); } void diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 645cd6717d6..bce889d5abe 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -92,6 +92,7 @@ public: void show_source_content (); void set_exec_info_content (); + void update_exec_info (); /* Does the locator belong to this window? */ bool m_has_locator = false; @@ -146,7 +147,6 @@ extern void tui_erase_source_content (struct tui_source_window_base *); extern void tui_show_exec_info_content (struct tui_source_window_base *); extern void tui_erase_exec_info_content (struct tui_source_window_base *); extern void tui_clear_exec_info_content (struct tui_source_window_base *); -extern void tui_update_exec_info (struct tui_source_window_base *); extern void tui_alloc_source_buffer (struct tui_source_window_base *); extern int tui_line_is_displayed (int, -- 2.30.2