mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-10 01:25:30 +08:00
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.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
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>
|
2019-07-17 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-winsource.c (tui_erase_source_content): Clear the
|
* tui/tui-winsource.c (tui_erase_source_content): Clear the
|
||||||
|
@ -398,8 +398,6 @@ public:
|
|||||||
LINE_NO in this source window; false otherwise. */
|
LINE_NO in this source window; false otherwise. */
|
||||||
virtual bool location_matches_p (struct bp_location *loc, int line_no) = 0;
|
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? */
|
/* Does the locator belong to this window? */
|
||||||
bool m_has_locator = false;
|
bool m_has_locator = false;
|
||||||
/* Execution information window. */
|
/* Execution information window. */
|
||||||
|
@ -227,7 +227,7 @@ tui_show_symtab_source (tui_source_window_base *win_info,
|
|||||||
bool
|
bool
|
||||||
tui_source_window::showing_source_p (const char *fullname) const
|
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,
|
&& (filename_cmp (tui_locator_win_info_ptr ()->full_name,
|
||||||
fullname) == 0));
|
fullname) == 0));
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,6 @@ tui_clear_source_content (struct tui_source_window_base *win_info)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
win_info->content_in_use = false;
|
|
||||||
tui_erase_source_content (win_info);
|
tui_erase_source_content (win_info);
|
||||||
for (i = 0; i < win_info->content.size (); i++)
|
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);
|
tui_check_and_display_highlight_if_needed (win_info);
|
||||||
win_info->refresh_window ();
|
win_info->refresh_window ();
|
||||||
win_info->content_in_use = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See tui-data.h. */
|
/* See tui-data.h. */
|
||||||
|
Reference in New Issue
Block a user