From a38da35d7bc89e4c2191d4f042912038c585f36d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 28 Jun 2019 16:44:23 -0600 Subject: Move content_in_use to tui_source_window class From scanning the source now, it's clear that the content_in_use field is only used for the source window. This patch moves the field there, and changes it to be a bool at the same time. (A future patch will clean this up further, removing the field entirely.) gdb/ChangeLog 2019-07-17 Tom Tromey * tui/tui-winsource.c (tui_clear_source_content) (tui_show_source_content, tui_show_exec_info_content) (tui_clear_exec_info_content): Update. * tui/tui-stack.c (tui_show_locator_content): Update. (tui_show_frame_info): Update. * tui/tui-source.h (tui_source_window): Don't declare. * tui/tui-source.c (tui_source_window::showing_source_p): Rename from tui_source_is_displayed. * tui/tui-data.h (struct tui_gen_win_info) : Remove field. (struct tui_source_window_base) : New field. Now bool. (struct tui_source_window) : New method. (TUI_SRC_WIN): Change cast. * tui/tui-data.c (tui_initialize_static_data): Update. --- gdb/tui/tui-stack.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gdb/tui/tui-stack.c') diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index e1b996d..b466b5f 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -266,7 +266,6 @@ tui_show_locator_content (void) locator->refresh_window (); wmove (locator->handle, 0, 0); xfree (string); - locator->content_in_use = TRUE; } } @@ -347,14 +346,19 @@ tui_show_frame_info (struct frame_info *fi) symtab_and_line sal = find_frame_sal (fi); - source_already_displayed = sal.symtab != 0 - && tui_source_is_displayed (symtab_to_fullname (sal.symtab)); + const char *fullname = nullptr; + if (sal.symtab != nullptr) + fullname = symtab_to_fullname (sal.symtab); + + source_already_displayed = (sal.symtab != 0 + && TUI_SRC_WIN != nullptr + && TUI_SRC_WIN->showing_source_p (fullname)); if (get_frame_pc_if_available (fi, &pc)) locator_changed_p = tui_set_locator_info (get_frame_arch (fi), (sal.symtab == 0 - ? "??" : symtab_to_fullname (sal.symtab)), + ? "??" : fullname), tui_get_function_from_frame (fi), sal.line, pc); -- cgit v1.1