From patchwork Sat Feb 22 18:46:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 38276 Received: (qmail 59511 invoked by alias); 22 Feb 2020 18:46:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 59499 invoked by uid 89); 22 Feb 2020 18:46:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=heights, win, H*f:sk:87y2su5, H*MI:sk:87y2su5 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 22 Feb 2020 18:46:48 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j5Zna-0006kV-5x; Sat, 22 Feb 2020 13:46:46 -0500 Received: from [176.228.60.248] (port=3943 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j5ZnZ-0001td-4O; Sat, 22 Feb 2020 13:46:45 -0500 Date: Sat, 22 Feb 2020 20:46:37 +0200 Message-Id: <83eeumiho2.fsf@gnu.org> From: Eli Zaretskii To: tom@tromey.com CC: midenok@gmail.com, gdb-patches@sourceware.org In-reply-to: <83ftf2iiqm.fsf@gnu.org> (message from Eli Zaretskii on Sat, 22 Feb 2020 20:23:29 +0200) Subject: Re: GDB 9 TUI mode broken References: <835zg5m7ib.fsf@gnu.org> <83mu9aj1pj.fsf@gnu.org> <87y2su5whg.fsf@tromey.com> <83ftf2iiqm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes > Date: Sat, 22 Feb 2020 20:23:29 +0200 > From: Eli Zaretskii > CC: midenok@gmail.com, gdb-patches@sourceware.org > > > Your patch looks reasonable to me. > > Thanks, I will finish it off as suggested, and submit a full patch for > review. The below seems to DTRT. OK to commit? 2020-02-22 Eli Zaretskii * tui/tui-win.c (new_height_ok, tui_adjust_win_heights): Rename 'locator' to 'status_line', to better match terminology in the manual. (tui_adjust_win_heights): Resize the status_line window to match the new dimensions of the command and source/disassembly windows. Reported by Aleksey Midenkov . --- gdb/tui/tui-win.c~0 2020-02-08 14:50:14.000000000 +0200 +++ gdb/tui/tui-win.c 2020-02-22 20:39:24.847375000 +0200 @@ -1067,7 +1067,7 @@ tui_adjust_win_heights (struct tui_win_i { int diff; struct tui_win_info *win_info; - struct tui_locator_window *locator = tui_locator_win_info_ptr (); + struct tui_locator_window *status_line = tui_locator_win_info_ptr (); enum tui_layout_type cur_layout = tui_current_layout (); int width = tui_term_width (); @@ -1077,21 +1077,30 @@ tui_adjust_win_heights (struct tui_win_i { struct tui_win_info *src_win_info; - primary_win_info->resize (new_height, width, - 0, primary_win_info->origin.y); if (primary_win_info->type == CMD_WIN) { win_info = *(tui_source_windows ().begin ()); src_win_info = win_info; + primary_win_info->resize (new_height, width, + 0, + primary_win_info->origin.y + diff); + win_info->resize (win_info->height + diff, width, + 0, win_info->origin.y); + status_line->resize (1, width, 0, + win_info->origin.y + win_info->height); } else { win_info = tui_win_list[CMD_WIN]; src_win_info = primary_win_info; - } + primary_win_info->resize (new_height, width, + 0, primary_win_info->origin.y); win_info->resize (win_info->height + diff, width, - 0, win_info->origin.y); - TUI_CMD_WIN->origin.y = locator->origin.y + 1; + 0, win_info->origin.y - diff); + status_line->resize (1, width, 0, + primary_win_info->origin.y + + primary_win_info->height); + } if ((src_win_info->type == SRC_WIN || src_win_info->type == DISASSEM_WIN)) { @@ -1122,7 +1131,7 @@ tui_adjust_win_heights (struct tui_win_i if (primary_win_info == TUI_CMD_WIN) { /* Split the change in height across the 1st & 2nd windows, adjusting them as well. */ - /* Subtract the locator. */ + /* Subtract the status_line. */ int first_split_diff = diff / 2; int second_split_diff = first_split_diff; @@ -1160,12 +1169,12 @@ tui_adjust_win_heights (struct tui_win_i second_win->resize (second_win->height + second_split_diff, width, 0, first_win->height - 1); - locator->resize (1, width, + status_line->resize (1, width, 0, (second_win->origin.y + second_win->height + 1)); TUI_CMD_WIN->resize (new_height, width, - 0, locator->origin.y + 1); + 0, status_line->origin.y + 1); } else { @@ -1196,15 +1205,16 @@ tui_adjust_win_heights (struct tui_win_i else second_win->resize (second_win->height, width, 0, first_win->height - 1); - locator->resize (1, width, + status_line->resize (1, width, 0, (second_win->origin.y + second_win->height + 1)); - TUI_CMD_WIN->origin.y = locator->origin.y + 1; + TUI_CMD_WIN->origin.y = status_line->origin.y + 1; if ((TUI_CMD_WIN->height + diff) < 1) - TUI_CMD_WIN->resize (1, width, 0, locator->origin.y + 1); + TUI_CMD_WIN->resize (1, width, 0, + status_line->origin.y + 1); else TUI_CMD_WIN->resize (TUI_CMD_WIN->height + diff, width, - 0, locator->origin.y + 1); + 0, status_line->origin.y + 1); } if (src1 != nullptr && src1->content.empty ()) src1->erase_source_content (); @@ -1272,13 +1282,14 @@ new_height_ok (struct tui_win_info *prim /* We could simply add all the heights to obtain the same result but below is more explicit since we subtract 1 for the line that the first and second windows share, and add - one for the locator. */ + one for the status_line. */ total_height = cur_total_height = (first_win->height + second_win->height - 1) - + TUI_CMD_WIN->height + 1; /* Locator. */ + + TUI_CMD_WIN->height + 1; /* Status_line. */ if (primary_win_info == TUI_CMD_WIN) { - /* Locator included since first & second win share a line. */ + /* Status_line included since first and second window + share a line. */ ok = ((first_win->height + second_win->height + diff) >= (MIN_WIN_HEIGHT * 2)