aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 14:22:21 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:32 -0600
commitcda37efbffb63e2634ea0600fdad2de6a8f9f3ad (patch)
tree8edadf6bec084e722503d27cc686e3cfd591e53d /gdb
parent6a0ee02c22b78b6d49fda99b6f2f9154d0cb0a47 (diff)
downloadgdb-cda37efbffb63e2634ea0600fdad2de6a8f9f3ad.zip
gdb-cda37efbffb63e2634ea0600fdad2de6a8f9f3ad.tar.gz
gdb-cda37efbffb63e2634ea0600fdad2de6a8f9f3ad.tar.bz2
Introduce make_visible method
This introduceds the make_visible to tui_win_info and overrides it in subclasses as appropriate. This allows the removal of the tui_win_is_source_type, as it is no longer used. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_win_info::make_visible) (tui_source_window_base::make_visible): New methods. (make_all_visible): Make method call. * tui/tui-data.h (struct tui_win_info) <make_visible>: New method. (struct tui_source_window_base, struct tui_cmd_window): Override make_visible. (tui_win_is_source_type): Don't declare. * tui/tui-data.c (tui_win_is_source_type): Remove.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/tui/tui-data.c6
-rw-r--r--gdb/tui/tui-data.h10
-rw-r--r--gdb/tui/tui-wingeneral.c29
4 files changed, 38 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0e2c74e..c4e464b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,16 @@
2019-06-25 Tom Tromey <tom@tromey.com>
+ * tui/tui-wingeneral.c (tui_win_info::make_visible)
+ (tui_source_window_base::make_visible): New methods.
+ (make_all_visible): Make method call.
+ * tui/tui-data.h (struct tui_win_info) <make_visible>: New method.
+ (struct tui_source_window_base, struct tui_cmd_window): Override
+ make_visible.
+ (tui_win_is_source_type): Don't declare.
+ * tui/tui-data.c (tui_win_is_source_type): Remove.
+
+2019-06-25 Tom Tromey <tom@tromey.com>
+
* tui/tui-layout.c (show_source_or_disasm_and_command): Remove
NULL check.
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 4ec3df4..6e1df01 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -64,12 +64,6 @@ static void free_content_elements (tui_win_content,
**********************************/
int
-tui_win_is_source_type (enum tui_win_type win_type)
-{
- return (win_type == SRC_WIN || win_type == DISASSEM_WIN);
-}
-
-int
tui_win_is_auxillary (enum tui_win_type win_type)
{
return (win_type > MAX_MAJOR_WINDOWS);
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index fad302b..4362af0 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -255,6 +255,9 @@ public:
return false;
}
+ /* Make this window visible or invisible. */
+ virtual void make_visible (int visible);
+
/* Methods to scroll the contents of this window. Note that they
are named with "_scroll" coming at the end because the more
obvious "scroll_forward" is defined as a macro in term.h. */
@@ -295,6 +298,8 @@ public:
return m_has_locator;
}
+ void make_visible (int visible) override;
+
/* Does the locator belong to this window? */
bool m_has_locator = false;
/* Execution information window. */
@@ -388,6 +393,10 @@ struct tui_cmd_window : public tui_win_info
void clear_detail () override;
+ void make_visible (int visible) override
+ {
+ }
+
int start_line = 0;
protected:
@@ -403,7 +412,6 @@ protected:
}
};
-extern int tui_win_is_source_type (enum tui_win_type win_type);
extern int tui_win_is_auxillary (enum tui_win_type win_type);
extern void tui_set_win_highlight (struct tui_win_info *win_info,
int highlight);
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 5428817..1308437 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -211,6 +211,22 @@ tui_make_invisible (struct tui_gen_win_info *win_info)
make_visible (win_info, 0);
}
+/* See tui-data.h. */
+
+void
+tui_win_info::make_visible (int visible)
+{
+ ::make_visible (&generic, visible);
+}
+
+/* See tui-data.h. */
+
+void
+tui_source_window_base::make_visible (int visible)
+{
+ ::make_visible (execution_info, visible);
+ tui_win_info::make_visible (visible);
+}
/* Makes all windows invisible (except the command and locator
windows). */
@@ -221,17 +237,8 @@ make_all_visible (int visible)
for (i = 0; i < MAX_MAJOR_WINDOWS; i++)
{
- if (tui_win_list[i] != NULL
- && ((tui_win_list[i])->generic.type) != CMD_WIN)
- {
- if (tui_win_is_source_type ((tui_win_list[i])->generic.type))
- {
- tui_source_window_base *base
- = (tui_source_window_base *) tui_win_list[i];
- make_visible (base->execution_info, visible);
- }
- make_visible (&tui_win_list[i]->generic, visible);
- }
+ if (tui_win_list[i] != NULL)
+ tui_win_list[i]->make_visible (visible);
}
return;