From b4094625d8a3e2b528032e2ca8d8cdecf222bb7c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 26 Jun 2019 16:04:37 -0600 Subject: [PATCH] Introduce tui_data_window::delete_data_content_windows method This changes tui_delete_data_content_windows to be a method on tui_data_window, removing some uses of the TUI_DATA_WIN global. gdb/ChangeLog 2019-07-17 Tom Tromey * tui/tui-windata.h (tui_delete_data_content_windows): Don't declare. * tui/tui-windata.c (tui_data_window::delete_data_content_windows): Rename from tui_delete_data_content_windows. (tui_data_window::display_all_data) (tui_data_window::do_scroll_vertical): Update. * tui/tui-data.h (struct tui_data_window) : New method. --- gdb/ChangeLog | 12 ++++++++++++ gdb/tui/tui-data.h | 4 ++++ gdb/tui/tui-windata.c | 11 +++++------ gdb/tui/tui-windata.h | 1 - 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b12813c87e3..3e75cbcbf01 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2019-07-17 Tom Tromey + + * tui/tui-windata.h (tui_delete_data_content_windows): Don't + declare. + * tui/tui-windata.c + (tui_data_window::delete_data_content_windows): Rename from + tui_delete_data_content_windows. + (tui_data_window::display_all_data) + (tui_data_window::do_scroll_vertical): Update. + * tui/tui-data.h (struct tui_data_window) + : New method. + 2019-07-17 Tom Tromey * tui/tui-windata.h (tui_refresh_data_win): Don't declare. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index a13662e98b0..60963c9219f 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -507,6 +507,10 @@ struct tui_data_window : public tui_win_info not set the content. */ void display_all_data (); + /* Delete all the item windows in the data window. This is usually + done when the data window is scrolled. */ + void delete_data_content_windows (); + protected: void do_scroll_vertical (int num_to_scroll) override; diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c index 37fdcfcab50..eaef1446c56 100644 --- a/gdb/tui/tui-windata.c +++ b/gdb/tui/tui-windata.c @@ -56,13 +56,12 @@ tui_data_window::first_data_item_displayed () return -1; } +/* See tui-data.h. */ -/* Function to delete all the item windows in the data window. This - is usually done when the data window is scrolled. */ void -tui_delete_data_content_windows (void) +tui_data_window::delete_data_content_windows () { - for (auto &&win : TUI_DATA_WIN->regs_content) + for (auto &&win : regs_content) { tui_delete_win (win->handle); win->handle = NULL; @@ -103,7 +102,7 @@ tui_data_window::display_all_data () else { tui_erase_data_content (NULL); - tui_delete_data_content_windows (); + delete_data_content_windows (); tui_check_and_display_highlight_if_needed (this); tui_display_registers_from (0); } @@ -155,7 +154,7 @@ tui_data_window::do_scroll_vertical (int num_to_scroll) { first_line += num_to_scroll; tui_erase_data_content (NULL); - tui_delete_data_content_windows (); + delete_data_content_windows (); tui_display_registers_from_line (first_line); } } diff --git a/gdb/tui/tui-windata.h b/gdb/tui/tui-windata.h index fce4e6defc9..419b22f3658 100644 --- a/gdb/tui/tui-windata.h +++ b/gdb/tui/tui-windata.h @@ -25,6 +25,5 @@ #include "tui/tui-data.h" extern void tui_erase_data_content (const char *); -extern void tui_delete_data_content_windows (void); #endif /* TUI_TUI_WINDATA_H */ -- 2.30.2