[11/11] Make tui_win_info::name pure virtual

Message ID 20200618021523.10681-12-tom@tromey.com
State New
Headers show
Series
  • TUI cleanups
Related show

Commit Message

Tom Tromey June 18, 2020, 2:15 a.m.
It seemed cleaner to me for tui_win_info::name to be pure virtual.
This meant adding a name method to the locator window; but this too
seems like an improvement.

2020-06-17  Tom Tromey  <tom@tromey.com>

	* tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
	* tui/tui-stack.h (struct tui_locator_window) <name>: New method.
---
 gdb/ChangeLog       | 5 +++++
 gdb/tui/tui-data.h  | 5 +----
 gdb/tui/tui-stack.h | 5 +++++
 3 files changed, 11 insertions(+), 4 deletions(-)

-- 
2.17.2

Patch

diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 3c14b2654ee..5e7a12293c9 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -62,10 +62,7 @@  struct tui_win_info
   virtual void make_visible (bool visible);
 
   /* Return the name of this type of window.  */
-  virtual const char *name () const
-  {
-    return "";
-  }
+  virtual const char *name () const = 0;
 
   /* Compute the maximum height of this window.  */
   virtual int max_height () const;
diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h
index 564ac22495c..9ff57b1ba73 100644
--- a/gdb/tui/tui-stack.h
+++ b/gdb/tui/tui-stack.h
@@ -32,6 +32,11 @@  struct tui_locator_window : public tui_win_info
 {
   tui_locator_window () = default;
 
+  const char *name () const override
+  {
+    return STATUS_NAME;
+  }
+
   int max_height () const override
   {
     return 1;