diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-28 22:57:37 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:09 -0600 |
commit | f6cc34a91c173634b6afcc1a48601a601fbace37 (patch) | |
tree | d51716dd73d98e559ee25e28d09da77908cf0b0d /gdb | |
parent | f31ec9af48578adb0baf8db3e10da871d6ee3eca (diff) | |
download | binutils-gdb-f6cc34a91c173634b6afcc1a48601a601fbace37.tar.gz |
Remove tui_source_window::content_in_use
Now that source window clearing has been simplified, we don't need a
special flag to say whether the source window is in use -- we can
simply check whether the contents are set. This patch implements this
idea, removing the content_in_use field.
gdb/ChangeLog
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_clear_source_content)
(tui_show_source_content): Update.
* tui/tui-source.c (tui_source_window::showing_source_p): Check
whether content is empty.
* tui/tui-data.h (struct tui_source_window_base) <content_in_use>:
Remove.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/tui/tui-data.h | 2 | ||||
-rw-r--r-- | gdb/tui/tui-source.c | 2 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4b5a8760da9..5ae3e3502f0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-winsource.c (tui_clear_source_content) + (tui_show_source_content): Update. + * tui/tui-source.c (tui_source_window::showing_source_p): Check + whether content is empty. + * tui/tui-data.h (struct tui_source_window_base) <content_in_use>: + Remove. + +2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-winsource.c (tui_erase_source_content): Clear the window's contents. * tui/tui-source.h (tui_set_source_content_nil): Don't declare. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 125b4ae4c5d..0245031c6cd 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -398,8 +398,6 @@ public: LINE_NO in this source window; false otherwise. */ virtual bool location_matches_p (struct bp_location *loc, int line_no) = 0; - /* Can it be used, or is it already used? */ - bool content_in_use = false; /* Does the locator belong to this window? */ bool m_has_locator = false; /* Execution information window. */ diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index d3cce1c3003..f0bac24bfea 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -227,7 +227,7 @@ tui_show_symtab_source (tui_source_window_base *win_info, bool tui_source_window::showing_source_p (const char *fullname) const { - return (content_in_use + return (!content.empty () && (filename_cmp (tui_locator_win_info_ptr ()->full_name, fullname) == 0)); } diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 2be20492f47..39591db2cc9 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -211,7 +211,6 @@ tui_clear_source_content (struct tui_source_window_base *win_info) { int i; - win_info->content_in_use = false; tui_erase_source_content (win_info); for (i = 0; i < win_info->content.size (); i++) { @@ -297,7 +296,6 @@ tui_show_source_content (struct tui_source_window_base *win_info) tui_check_and_display_highlight_if_needed (win_info); win_info->refresh_window (); - win_info->content_in_use = true; } /* See tui-data.h. */ |