public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@gdb-buildbot.osci.io
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Fix C-x 1 from gdb prompt
Date: Wed, 15 Jul 2020 01:05:17 -0400 (EDT)	[thread overview]
Message-ID: <39ec04904ff172dd67fd43ed3720f26d854732bf@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 39ec04904ff172dd67fd43ed3720f26d854732bf ***

commit 39ec04904ff172dd67fd43ed3720f26d854732bf
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Tue Jun 16 17:55:57 2020 -0600
Commit:     Tom Tromey <tom@tromey.com>
CommitDate: Tue Jun 16 18:02:20 2020 -0600

    Fix C-x 1 from gdb prompt
    
    Pedro pointed out on irc that C-x 1 from the gdb prompt will cause a
    crash.  This happened because of a bug in remove_windows -- it would
    always remove all the windows from the layout.  This patch fixes this
    bug, and also arranges to have C-x 1 preserve the status window.
    
    gdb/ChangeLog
    2020-06-16  Tom Tromey  <tom@tromey.com>
    
            * tui/tui-layout.c (tui_layout_split::remove_windows): Fix logic.
            Also preserve the status window.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cb3761c1ba..316b3fad28 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-16  Tom Tromey  <tom@tromey.com>
+
+	* tui/tui-layout.c (tui_layout_split::remove_windows): Fix logic.
+	Also preserve the status window.
+
 2020-06-16  Tom Tromey  <tom@tromey.com>
 
 	* python/py-tui.c (tui_py_window::~tui_py_window): Handle case
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 491ce275ac..b87d21eb6d 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -790,13 +790,14 @@ tui_layout_split::remove_windows (const char *name)
       const char *this_name = m_splits[i].layout->get_name ();
       if (this_name == nullptr)
 	m_splits[i].layout->remove_windows (name);
+      else if (strcmp (this_name, name) == 0
+	       || strcmp (this_name, "cmd") == 0
+	       || strcmp (this_name, "status") == 0)
+	{
+	  /* Keep.  */
+	}
       else
 	{
-	  if (strcmp (this_name, name) == 0
-	      || strcmp (this_name, "cmd") == 0)
-	    {
-	      /* Keep.  */
-	    }
 	  m_splits.erase (m_splits.begin () + i);
 	  --i;
 	}


             reply	other threads:[~2020-07-15  5:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  5:05 gdb-buildbot [this message]
2020-07-15  5:05 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-07-15  5:23 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-07-15  5:39 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-07-15  5:58 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-07-15  6:26 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-07-15  6:42 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-07-15  7:01 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-07-15  7:23 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=39ec04904ff172dd67fd43ed3720f26d854732bf@gdb-build \
    --to=gdb-buildbot@gdb-buildbot.osci.io \
    --cc=gdb-testers@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).