diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-28 16:44:23 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:06 -0600 |
commit | a38da35d7bc89e4c2191d4f042912038c585f36d (patch) | |
tree | 412a0b17840b5e9b325b14ff6a63f9a560fdf75f /gdb/tui/tui-stack.c | |
parent | c2cd8994669f63eb415522352a5d5006d0fbfb48 (diff) | |
download | binutils-a38da35d7bc89e4c2191d4f042912038c585f36d.zip binutils-a38da35d7bc89e4c2191d4f042912038c585f36d.tar.gz binutils-a38da35d7bc89e4c2191d4f042912038c585f36d.tar.bz2 |
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 <tom@tromey.com>
* 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) <content_in_use>:
Remove field.
(struct tui_source_window_base) <content_in_use>: New field. Now
bool.
(struct tui_source_window) <showing_source_p>: New method.
(TUI_SRC_WIN): Change cast.
* tui/tui-data.c (tui_initialize_static_data): Update.
Diffstat (limited to 'gdb/tui/tui-stack.c')
-rw-r--r-- | gdb/tui/tui-stack.c | 12 |
1 files changed, 8 insertions, 4 deletions
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); |