diff options
author | Tom Tromey <tom@tromey.com> | 2020-02-22 11:48:26 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-02-22 11:48:37 -0700 |
commit | fdb01f0ce44653180af9d3d4f264c0ddb2d1261d (patch) | |
tree | 48e764972c1c724ed13bf700db9cd770bb4421a5 /gdb/tui/tui-winsource.c | |
parent | 865a5aec04b504d33c83baf5e05f6cdf95ac9dc3 (diff) | |
download | gdb-fdb01f0ce44653180af9d3d4f264c0ddb2d1261d.zip gdb-fdb01f0ce44653180af9d3d4f264c0ddb2d1261d.tar.gz gdb-fdb01f0ce44653180af9d3d4f264c0ddb2d1261d.tar.bz2 |
TUI windows do not need to store their type
TUI windows no longer need to store their type -- there's only a
single spot that uses this information, and it can be changed to use
dynamic_cast. (It could be cleaned up even more, by using a virtual
method, but I haven't done so.) This patch removes the "type" field
from tui_gen_win_info, and this in turn allows removing a couple of
enumerator constants.
gdb/ChangeLog
2020-02-22 Tom Tromey <tom@tromey.com>
* tui/tui.h (enum tui_win_type) <LOCATOR_WIN, DATA_ITEM_WIN>:
Remove constants.
* tui/tui-winsource.h (struct tui_source_window_base)
<tui_source_window_base>: Remove parameter.
* tui/tui-winsource.c
(tui_source_window_base::tui_source_window_base): Remove
parameter.
(tui_source_window_base::refill): Update.
* tui/tui-stack.h (struct tui_locator_window)
<tui_locator_window>: Update.
* tui/tui-source.h (struct tui_source_window) <tui_source_window>:
Default the constructor.
* tui/tui-regs.h (struct tui_data_item_window)
<tui_data_item_window>: Default the constructor.
(struct tui_data_window) <tui_data_window>: Likewise.
* tui/tui-disasm.h (struct tui_disasm_window) <tui_disasm_window>:
Default the constructor.
* tui/tui-data.h (struct tui_gen_win_info) <tui_gen_win_info>:
Default the constructor.
<type>: Remove.
(struct tui_win_info) <tui_win_info>: Default the constructor.
* tui/tui-data.c (tui_win_info::tui_win_info): Remove.
* tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>:
Default the constructor.
Change-Id: I594cd07d2e0bba71ad594a6fb263904ce2febcd6
Diffstat (limited to 'gdb/tui/tui-winsource.c')
-rw-r--r-- | gdb/tui/tui-winsource.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 3ba2f2b..9ec05ae 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -286,10 +286,8 @@ tui_source_window_base::show_source_content () refresh_window (); } -tui_source_window_base::tui_source_window_base (enum tui_win_type type) - : tui_win_info (type) +tui_source_window_base::tui_source_window_base () { - gdb_assert (type == SRC_WIN || type == DISASSEM_WIN); start_line_or_addr.loa = LOA_ADDRESS; start_line_or_addr.u.addr = 0; @@ -334,7 +332,7 @@ tui_source_window_base::rerender () struct gdbarch *gdbarch = get_frame_arch (frame); struct symtab *s = find_pc_line_symtab (get_frame_pc (frame)); - if (type != SRC_WIN) + if (this != TUI_SRC_WIN) find_line_pc (s, cursal.line, &cursal.pc); update_source_window (gdbarch, cursal); } @@ -349,7 +347,7 @@ tui_source_window_base::refill () { symtab_and_line sal {}; - if (type == SRC_WIN) + if (this == TUI_SRC_WIN) { sal = get_current_source_symtab_and_line (); if (sal.symtab == NULL) |