Remove tui_win_info::refresh_all
authorTom Tromey <tom@tromey.com>
Thu, 18 Jul 2019 20:38:39 +0000 (14:38 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 30 Aug 2019 18:57:10 +0000 (12:57 -0600)
The TUI has two duplicate "re-render this window" methods, "rerender"
and "refresh_all".  They differ only slightly in semantics, so I
wanted to see if they could be unified.

After looking into this, I decided that refresh_all was not needed.
There are 4 calls to tui_refresh_all_win (the only caller of this
method):

1. tui_enable.  This sets the layout, which renders the windows.

2. tui_cont_sig.  Here, I think it's sufficient to simply redraw the
   current window contents from the curses backing store, because gdb
   state didn't change while it was suspended

3. tui_dispatch_ctrl_char.  This is the C-l handler, and here it's
   explicitly enough to just refresh the screen (as above).

4. tui_refresh_all_command.  This is the command equivalent of C-l.

So, this patch removes this method entirely and simplifies
tui_refresh_all_win.

gdb/ChangeLog
2019-08-30  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.h (struct tui_source_window_base)
<refresh_all>: Don't declare.
* tui/tui-winsource.c (tui_source_window_base::refresh_all):
Remove.
* tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or
tui_show_locator_content.
* tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't
declare.
* tui/tui-regs.c (tui_data_window::refresh_all): Remove.
* tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't
declare.

gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-regs.c
gdb/tui/tui-regs.h
gdb/tui/tui-win.c
gdb/tui/tui-winsource.c
gdb/tui/tui-winsource.h

index 6f35232897aa9ac6ada5814297724874dd2598fe..2cc7b5809e23b7a2f17027d0f74e45dbcdaf8602 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-30  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-winsource.h (struct tui_source_window_base)
+       <refresh_all>: Don't declare.
+       * tui/tui-winsource.c (tui_source_window_base::refresh_all):
+       Remove.
+       * tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or
+       tui_show_locator_content.
+       * tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't
+       declare.
+       * tui/tui-regs.c (tui_data_window::refresh_all): Remove.
+       * tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't
+       declare.
+
 2019-08-30  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-io.c (tui_cont_sig): Don't call wrefresh.
index 1810fa3e729c026c5a9dcc731d315fd760eaa11b..23f769f6ba578e64c82a506784b3d9b6b0aad046 100644 (file)
@@ -162,12 +162,6 @@ public:
   {
   }
 
-  /* Called after all the TUI windows are refreshed, to let this
-     window have a chance to update itself further.  */
-  virtual void refresh_all ()
-  {
-  }
-
   /* Compute the maximum height of this window.  */
   virtual int max_height () const;
 
index f62ba065ebe0f544f6cb0b12910a7d04fd406fa3..48e78fc9dbc14755ee85e551fd299e7d64b0d56f 100644 (file)
@@ -403,29 +403,6 @@ tui_data_window::rerender ()
 }
 
 
-/* Function to redisplay the contents of the data window.  */
-void
-tui_data_window::refresh_all ()
-{
-  erase_data_content (NULL);
-  if (!regs_content.empty ())
-    {
-      int first_element = first_data_item_displayed ();
-
-      if (first_element >= 0)  /* Re-use existing windows.  */
-       {
-         int first_line = (-1);
-
-         if (first_element < regs_content.size ())
-           first_line = line_from_reg_element_no (first_element);
-
-         if (first_line >= 0)
-           display_registers_from_line (first_line);
-       }
-    }
-}
-
-
 /* Scroll the data window vertically forward or backward.  */
 void
 tui_data_window::do_scroll_vertical (int num_to_scroll)
index 1f9fa73f1cc5be0f3be2da1a416e7d08cd7120e2..abf44c88b68ce67f6bc7673b6ce2bb26600f52eb 100644 (file)
@@ -58,8 +58,6 @@ struct tui_data_window : public tui_win_info
 
   DISABLE_COPY_AND_ASSIGN (tui_data_window);
 
-  void refresh_all () override;
-
   void refresh_window () override;
 
   const char *name () const override
index 64e38880a2cf8f879119b199a1fa164be9c416fa..8d41372cf901c20c82fe0c5aeb49fcd8b9474ec1 100644 (file)
@@ -504,12 +504,6 @@ tui_refresh_all_win (void)
 {
   clearok (curscr, TRUE);
   tui_refresh_all ();
-  for (tui_win_info *win_info : all_tui_windows ())
-    {
-      if (win_info->is_visible ())
-       win_info->refresh_all ();
-    }
-  tui_show_locator_content ();
 }
 
 void
index 0a3eb78bb5a47492539576991af6f2d73c556d58..7a4821dc52c7495f94b0d54bd150dba65f00a998 100644 (file)
@@ -280,16 +280,6 @@ tui_source_window_base::~tui_source_window_base ()
 
 /* See tui-data.h.  */
 
-void
-tui_source_window_base::refresh_all ()
-{
-  show_source_content ();
-  check_and_display_highlight_if_needed ();
-  update_exec_info ();
-}
-
-/* See tui-data.h.  */
-
 void
 tui_source_window_base::update_tab_width ()
 {
index 1804ca7224a81303250ab6009181c7db40302c20..4c98ca3ceb29cf0d6136e59c3fbdf4e335683cad 100644 (file)
@@ -103,8 +103,6 @@ public:
 
   void clear_detail ();
 
-  void refresh_all () override;
-
   /* Refill the source window's source cache and update it.  If this
      is a disassembly window, then just update it.  */
   void refill ();
This page took 0.03393 seconds and 4 git commands to generate.