From: Tom Tromey Date: Wed, 26 Jun 2019 22:02:36 +0000 (-0600) Subject: Introduce tui_data_window::display_all_data method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50daf2683bad925470f6f1bd08aef928c2f4d6fe;p=binutils-gdb.git Introduce tui_data_window::display_all_data method This changes tui_display_all_data to be a method on tui_data_window. This helps cluster uses of the TUI_DATA_WIN global. gdb/ChangeLog 2019-07-17 Tom Tromey * tui/tui-windata.h (tui_display_all_data): Don't declare. * tui/tui-windata.c (tui_data_window::display_all_data): Rename from tui_display_all_data. * tui/tui-win.c (tui_data_window::do_make_visible_with_new_height): Update. * tui/tui-regs.c (tui_show_registers): Update. * tui/tui-layout.c (tui_set_layout): Update. * tui/tui-data.h (struct tui_data_window) : New method. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3daafb35d9d..7c1ff32c002 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2019-07-17 Tom Tromey + + * tui/tui-windata.h (tui_display_all_data): Don't declare. + * tui/tui-windata.c (tui_data_window::display_all_data): Rename + from tui_display_all_data. + * tui/tui-win.c + (tui_data_window::do_make_visible_with_new_height): Update. + * tui/tui-regs.c (tui_show_registers): Update. + * tui/tui-layout.c (tui_set_layout): Update. + * tui/tui-data.h (struct tui_data_window) : New + method. + 2019-07-17 Tom Tromey * tui/tui-windata.h (tui_display_data_from): Don't declare. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 676345c528a..a13662e98b0 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -503,6 +503,10 @@ struct tui_data_window : public tui_win_info past the register area (-1) is returned. */ int first_reg_element_no_inline (int line_no) const; + /* Displays the data that is in the data window's content. It does + not set the content. */ + void display_all_data (); + protected: void do_scroll_vertical (int num_to_scroll) override; diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index d9a1f08ac1f..9e683cfa919 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -215,7 +215,7 @@ tui_set_layout (enum tui_layout_type layout_type) if (!regs_populate && (new_layout == SRC_DATA_COMMAND || new_layout == DISASSEM_DATA_COMMAND)) - tui_display_all_data (); + TUI_DATA_WIN->display_all_data (); tui_update_source_windows_with_addr (gdbarch, addr); diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index ae38d343822..59933639f6f 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -157,7 +157,7 @@ tui_show_registers (struct reggroup *group) data_item_win->highlight = false; } TUI_DATA_WIN->current_group = group; - tui_display_all_data (); + TUI_DATA_WIN->display_all_data (); } } diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 557f8b5d2d6..ee03cf38e14 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -1366,7 +1366,7 @@ tui_source_window_base::do_make_visible_with_new_height () void tui_data_window::do_make_visible_with_new_height () { - tui_display_all_data (); + display_all_data (); } /* See tui-data.h. */ diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c index 722d0a5e26e..37fdcfcab50 100644 --- a/gdb/tui/tui-windata.c +++ b/gdb/tui/tui-windata.c @@ -93,19 +93,18 @@ tui_erase_data_content (const char *prompt) wrefresh (TUI_DATA_WIN->handle); } +/* See tui-data.h. */ -/* This function displays the data that is in the data window's - content. It does not set the content. */ void -tui_display_all_data (void) +tui_data_window::display_all_data () { - if (TUI_DATA_WIN->regs_content.empty ()) + if (regs_content.empty ()) tui_erase_data_content (NO_DATA_STRING); else { tui_erase_data_content (NULL); tui_delete_data_content_windows (); - tui_check_and_display_highlight_if_needed (TUI_DATA_WIN); + tui_check_and_display_highlight_if_needed (this); tui_display_registers_from (0); } } diff --git a/gdb/tui/tui-windata.h b/gdb/tui/tui-windata.h index 9970cfae547..adffcafacb4 100644 --- a/gdb/tui/tui-windata.h +++ b/gdb/tui/tui-windata.h @@ -25,7 +25,6 @@ #include "tui/tui-data.h" extern void tui_erase_data_content (const char *); -extern void tui_display_all_data (void); extern void tui_delete_data_content_windows (void); extern void tui_refresh_data_win (void);