From: Tom Tromey Date: Fri, 5 Jul 2019 23:35:13 +0000 (-0600) Subject: Turn tui_show_exec_info_content into a method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8270ac6229ac323fe7dfc1915b3f52d77df6bb9a;p=binutils-gdb.git Turn tui_show_exec_info_content into a method This changes tui_show_exec_info_content to be a method on tui_source_window_base. As it is only called by other methods on this class, it can be private. gdb/ChangeLog 2019-08-13 Tom Tromey * tui/tui-winsource.h (struct tui_source_window_base) : Declare. (tui_show_exec_info_content): Don't declare. * tui/tui-winsource.c (tui_source_window_base::show_exec_info_content): Rename from tui_show_exec_info_content. (tui_source_window_base::update_exec_info): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 750ce868433..a739724e468 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-08-13 Tom Tromey + + * tui/tui-winsource.h (struct tui_source_window_base) + : Declare. + (tui_show_exec_info_content): Don't declare. + * tui/tui-winsource.c + (tui_source_window_base::show_exec_info_content): Rename from + tui_show_exec_info_content. + (tui_source_window_base::update_exec_info): Update. + 2019-08-13 Tom Tromey * tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element) diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 53113bd785c..c99e207b011 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -641,17 +641,17 @@ tui_source_window_base::set_exec_info_content () void -tui_show_exec_info_content (struct tui_source_window_base *win_info) +tui_source_window_base::show_exec_info_content () { - struct tui_exec_info_window *exec_info = win_info->execution_info; - const tui_exec_info_content *content = exec_info->get_content (); + struct tui_exec_info_window *exec_info = execution_info; + const tui_exec_info_content *exec_content = exec_info->get_content (); werase (exec_info->handle); - for (int cur_line = 1; cur_line <= win_info->content.size (); cur_line++) + for (int cur_line = 1; cur_line <= content.size (); cur_line++) mvwaddstr (exec_info->handle, cur_line, 0, - content[cur_line - 1]); + exec_content[cur_line - 1]); exec_info->refresh_window (); } @@ -676,7 +676,7 @@ void tui_source_window_base::update_exec_info () { set_exec_info_content (); - tui_show_exec_info_content (this); + show_exec_info_content (); } void diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index 71201e51d89..c902ee0f17e 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -150,6 +150,9 @@ public: struct gdbarch *gdbarch = nullptr; std::vector content; + +private: + void show_exec_info_content (); }; /* Update the execution windows to show the active breakpoints. This @@ -185,7 +188,6 @@ extern void tui_update_source_windows_with_line (struct symtab *, int); extern void tui_clear_source_content (struct tui_source_window_base *); 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 *);