aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-data.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 11:08:43 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:27 -0600
commit5cf82909a7047cee471ee40cfe623250c258d76e (patch)
tree79f9a90053ccbe55a63b41cc93ccdd1f19aca95e /gdb/tui/tui-data.h
parentee1d42d6c1a05725868a8ea4855eaa81cbbda635 (diff)
downloadgdb-5cf82909a7047cee471ee40cfe623250c258d76e.zip
gdb-5cf82909a7047cee471ee40cfe623250c258d76e.tar.gz
gdb-5cf82909a7047cee471ee40cfe623250c258d76e.tar.bz2
Create tui_disasm_window
This introduces the new tui_disasm_window class, which represents a disassembly window. It shares a lot of behavior with the source window, so a new tui_source_window_base class is also created. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-data.h (struct tui_source_window_base): New struct. (struct tui_source_window): Derive from tui_source_window_base. (struct tui_disasm_window): New struct. * tui/tui-data.c (tui_source_window_base::clear_detail): Rename from tui_source_window::clear_detail. (tui_source_window_base): Rename from tui_source_window. (~tui_source_window_base): Rename from ~tui_source_window. (tui_alloc_win_info): Create a tui_disasm_window.
Diffstat (limited to 'gdb/tui/tui-data.h')
-rw-r--r--gdb/tui/tui-data.h38
1 files changed, 34 insertions, 4 deletions
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 7adeb56..e09aad6 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -291,15 +291,45 @@ public:
int is_highlighted = 0;
};
-struct tui_source_window : public tui_win_info
+/* The base class for all source-like windows, namely the source and
+ disassembly windows. */
+
+struct tui_source_window_base : public tui_win_info
{
- explicit tui_source_window (enum tui_win_type type);
- ~tui_source_window () override;
- DISABLE_COPY_AND_ASSIGN (tui_source_window);
+protected:
+ explicit tui_source_window_base (enum tui_win_type type);
+ ~tui_source_window_base () override;
+ DISABLE_COPY_AND_ASSIGN (tui_source_window_base);
+
+public:
void clear_detail () override;
};
+/* A TUI source window. */
+
+struct tui_source_window : public tui_source_window_base
+{
+ tui_source_window ()
+ : tui_source_window_base (SRC_WIN)
+ {
+ }
+
+ DISABLE_COPY_AND_ASSIGN (tui_source_window);
+};
+
+/* A TUI disassembly window. */
+
+struct tui_disasm_window : public tui_source_window_base
+{
+ tui_disasm_window ()
+ : tui_source_window_base (DISASSEM_WIN)
+ {
+ }
+
+ DISABLE_COPY_AND_ASSIGN (tui_disasm_window);
+};
+
struct tui_data_window : public tui_win_info
{
tui_data_window ();