Remove some TUI static allocations
authorTom Tromey <tom@tromey.com>
Mon, 17 Jun 2019 21:45:14 +0000 (15:45 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:42 +0000 (07:48 -0600)
commitf936bca26dd7593a3b792e76eba37c5de2374961
tree2f76d11fd8f646ff531eb926ea69cc3b2e4c16df
parentd6ba6a11642cdbec4ce91fefe455920b5c073f60
Remove some TUI static allocations

The TUI statically allocates the "execution_info" for the source and
disassembly windows.  However, there's no deep reason to do this, and
this approach makes it harder to allow multiple such windows.

This patch removes the static data and changes the code to simply
allocate these windows as needed.  This required pushing some code
into the tui_gen_win_info destructor, but that seems like a good idea
anyhow.

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

* tui/tui-layout.c (make_source_or_disasm_window): Always use
init_and_make_win for EXEC_INFO_WIN.
* tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>: No
longer inline.
(struct tui_win_info) <~tui_win_info>: Inline.
(tui_source_exec_info_win_ptr, tui_disassem_exec_info_win_ptr):
Don't declare.
* tui/tui-data.c (source_win, disasm_win): Remove globals.
(tui_source_exec_info_win_ptr, tui_disassem_exec_info_win_ptr):
Remove.
(tui_initialize_static_data): Update.
(~tui_gen_win_info): Handle more cleanup here.
(~tui_source_window_base): Delete "execution_info".
(~tui_win_info): Move code to ~tui_gen_win_info; remove.
gdb/ChangeLog
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-layout.c
This page took 0.168379 seconds and 4 git commands to generate.