aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-06-16 17:55:57 -0600
committerTom Tromey <tom@tromey.com>2020-06-16 18:02:20 -0600
commit39ec04904ff172dd67fd43ed3720f26d854732bf (patch)
treef0c00c8c4b85c4e340393aa70bd04b7264b4aa52 /gdb/tui
parent1ce22eebea40573551c2db2e7c83951154d14c81 (diff)
downloadbinutils-39ec04904ff172dd67fd43ed3720f26d854732bf.zip
binutils-39ec04904ff172dd67fd43ed3720f26d854732bf.tar.gz
binutils-39ec04904ff172dd67fd43ed3720f26d854732bf.tar.bz2
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.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-layout.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 491ce27..b87d21e 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;
}