public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Remove tui_source_window::content_in_use
Date: Wed, 17 Jul 2019 18:39:00 -0000	[thread overview]
Message-ID: <20190717183905.72050.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f6cc34a91c173634b6afcc1a48601a601fbace37

commit f6cc34a91c173634b6afcc1a48601a601fbace37
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Jun 28 22:57:37 2019 -0600

    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.

Diff:
---
 gdb/ChangeLog           | 9 +++++++++
 gdb/tui/tui-data.h      | 2 --
 gdb/tui/tui-source.c    | 2 +-
 gdb/tui/tui-winsource.c | 2 --
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4b5a876..5ae3e35 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 125b4ae..0245031 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 d3cce1c..f0bac24 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 2be2049..39591db 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.  */


                 reply	other threads:[~2019-07-17 18:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190717183905.72050.qmail@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).