diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-16 13:46:18 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-06-25 07:48:30 -0600 |
commit | e6e4150110bcee66adfadb9f126eb3bb1fd7c054 (patch) | |
tree | 53ef1cbb7494fb2317a04d2da24cf5f185f0778c /gdb/tui/tui-win.c | |
parent | 44f0e208eb32a7ac469cef2b6760f72534abac09 (diff) | |
download | gdb-e6e4150110bcee66adfadb9f126eb3bb1fd7c054.zip gdb-e6e4150110bcee66adfadb9f126eb3bb1fd7c054.tar.gz gdb-e6e4150110bcee66adfadb9f126eb3bb1fd7c054.tar.bz2 |
Remove struct tui_source_info
The tui_source_info struct is used as a member of the "detail" union
in tui_win_info, and this member of the union is only used by source
and disassembly windows. This patch removes tui_source_info and moves
its members directly to tui_source_window_base. This simplifies the
code by removing a layer of references from many places. In a few
spots, a new cast was needed, but most of these will be removed by the
end of the series.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window)
(tui_refill_source_window)
(tui_source_window_base::do_scroll_horizontal)
(tui_update_breakpoint_info, tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content): Update.
* tui/tui-wingeneral.c (make_all_visible, tui_refresh_all):
Update.
* tui/tui-win.c (make_invisible_and_set_new_height)
(make_visible_with_new_height): Update.
* tui/tui-source.c (tui_set_source_content)
(tui_show_symtab_source): Update.
* tui/tui-layout.c (extract_display_start_addr)
(show_source_disasm_command, show_data)
(make_source_or_disasm_window)
(show_source_or_disasm_and_command): Update.
* tui/tui-disasm.c (tui_set_disassem_content): Simplify.
(tui_disasm_window::do_scroll_vertical): Remove shadowing
"gdbarch".
* tui/tui-data.h (struct tui_source_info): Remove. Move contents
to tui_source_window_base.
(struct tui_win_info) <detail>: Remove source_info member.
(struct tui_source_window_base) <has_locator>: Inline.
Move contents from tui_source_info; rename has_locator member to
m_has_locator.
(TUI_SRC_WIN, TUI_DISASM_WIN): Add casts.
* tui/tui-data.c (tui_source_window_base::has_locator): Move to
header file.
(tui_source_window_base::clear_detail, ~tui_source_window_base):
Simplify.
(tui_free_all_source_wins_content): Cast to
tui_source_window_base.
Diffstat (limited to 'gdb/tui/tui-win.c')
-rw-r--r-- | gdb/tui/tui-win.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 5c807ad..9c4f9ad 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -1268,11 +1268,13 @@ make_invisible_and_set_new_height (struct tui_win_info *win_info, win_info->generic.viewport_height--; /* Now deal with the auxillary windows associated with win_info. */ + tui_source_window_base *base; switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - gen_win_info = win_info->detail.source_info.execution_info; + base = (tui_source_window_base *) win_info; + gen_win_info = base->execution_info; tui_make_invisible (gen_win_info); gen_win_info->height = height; gen_win_info->origin.y = win_info->generic.origin.y; @@ -1316,20 +1318,22 @@ make_visible_with_new_height (struct tui_win_info *win_info) tui_make_visible (&win_info->generic); tui_check_and_display_highlight_if_needed (win_info); + tui_source_window_base *base; switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - tui_free_win_content (win_info->detail.source_info.execution_info); - tui_make_visible (win_info->detail.source_info.execution_info); + base = (tui_source_window_base *) win_info; + tui_free_win_content (base->execution_info); + tui_make_visible (base->execution_info); if (win_info->generic.content != NULL) { - struct gdbarch *gdbarch = win_info->detail.source_info.gdbarch; + struct gdbarch *gdbarch = base->gdbarch; struct tui_line_or_address line_or_addr; struct symtab_and_line cursal = get_current_source_symtab_and_line (); - line_or_addr = win_info->detail.source_info.start_line_or_addr; + line_or_addr = base->start_line_or_addr; tui_free_win_content (&win_info->generic); tui_update_source_window (win_info, gdbarch, cursal.symtab, line_or_addr, TRUE); |