[4/6] gdb/tui: make tui_win_info::rerender public

Message ID 9cfa1d4ec2bd3f794ffb4f01adbb72b7b623e6a1.1777645161.git.aburgess@redhat.com
State New
Headers
Series gdb/tui: fix debuginfod related crash |

Commit Message

Andrew Burgess May 1, 2026, 2:22 p.m. UTC
  In the next commit I'm going to want to call rerender from outside the
tui_win_info class, so let's make it public.

This is just a refactor, there should be no user-visible changes after
this commit.
---
 gdb/tui/tui-data.h      | 12 +++++++-----
 gdb/tui/tui-regs.h      |  4 ++--
 gdb/tui/tui-winsource.h |  4 ++--
 3 files changed, 11 insertions(+), 9 deletions(-)
  

Patch

diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index ec3cf63a286..155d9dd4e0c 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -44,10 +44,6 @@  struct tui_win_info
   tui_win_info () = default;
   DISABLE_COPY_AND_ASSIGN (tui_win_info);
 
-  /* This is called after the window is resized, and should update the
-     window's contents.  */
-  virtual void rerender ();
-
   /* Create the curses window.  */
   void make_window ();
 
@@ -55,7 +51,13 @@  struct tui_win_info
   tui_win_info (tui_win_info &&) = default;
   virtual ~tui_win_info () = default;
 
-  /* Call to refresh this window.  */
+  /* Call to update the in-memory contents of this window.  Does not
+     cause the contents to be drawn to the screen.  */
+  virtual void rerender ();
+
+  /* Call to refresh this window on the screen.  The in-memory contents of
+     the window are not updated by this call, whatever the current contents
+     are, they are drawn to the screen.  */
   virtual void refresh_window ();
 
   /* Make this window visible or invisible.  */
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index ec056e1a042..2ed4614976f 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -90,6 +90,8 @@  struct tui_data_window : public tui_win_info
     return m_current_group;
   }
 
+  void rerender () override;
+
 protected:
 
   void do_scroll_vertical (int num_to_scroll) override;
@@ -97,8 +99,6 @@  struct tui_data_window : public tui_win_info
   {
   }
 
-  void rerender () override;
-
 private:
 
   /* Display the registers in the content from 'start_element_no'
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index d4b25cbf9cd..5becb2fd715 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -103,8 +103,6 @@  struct tui_source_window_base : public tui_win_info
   /* Erase the content and display STRING.  */
   void do_erase_source_content (const char *string);
 
-  void rerender () override;
-
   virtual bool set_contents (struct gdbarch *gdbarch,
 			     const struct symtab_and_line &sal) = 0;
 
@@ -138,6 +136,8 @@  struct tui_source_window_base : public tui_win_info
 
 public:
 
+  void rerender () override;
+
   /* Refill the source window's source cache and update it.  If this
      is a disassembly window, then just update it.  */
   void refill ();