Introduce tui_gen_win_info::reset method
authorTom Tromey <tom@tromey.com>
Mon, 17 Jun 2019 20:08:44 +0000 (14:08 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:41 +0000 (07:48 -0600)
commitd6ba6a11642cdbec4ce91fefe455920b5c073f60
tree6df54168a60e0d5daa81bd40a65832abfdf39cad
parent48a3bd16c2189174f601600dc6cceedd68e908b6
Introduce tui_gen_win_info::reset method

This introduces the tui_gen_win_info::reset method and changes various
places to use it.  This led to the realization that the can_highlight
member only needs to be set during construction, so this patch makes
that change as well.  Finally, init_and_make_win is drastically
simplified.

gdb/ChangeLog
2019-06-25  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (make_command_window): Don't set
can_highlight.
(show_source_disasm_command): Call the reset method.
(show_data): Don't set can_highlight.  Call the reset method.
(tui_gen_win_info::reset): Rename from init_gen_win_info
(init_and_make_win): Simplify.  Return tui_gen_win_info.
(show_source_or_disasm_and_command): Call the reset method.
* tui/tui-data.h (struct tui_gen_win_info) <reset>: New method.
(struct tui_cmd_window): Set can_highlight.
gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-layout.c