From 1cdf9e33eadd3bf091fe64ed30daa0263f736ea2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 1 Jul 2020 21:21:12 -0600 Subject: [PATCH] Make tui_win_info::name pure virtual 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. gdb/ChangeLog 2020-07-01 Tom Tromey * tui/tui-data.h (struct tui_win_info) : Now pure virtual. * tui/tui-stack.h (struct tui_locator_window) : New method. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-data.h | 5 +---- gdb/tui/tui-stack.h | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ec87edf13fc..662e6b9ad1d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-07-01 Tom Tromey + + * tui/tui-data.h (struct tui_win_info) : Now pure virtual. + * tui/tui-stack.h (struct tui_locator_window) : New method. + 2020-07-01 Tom Tromey * tui/tui-wingeneral.c (tui_win_info::refresh_window): Move from 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 @@ public: 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; -- 2.30.2