From patchwork Sat Nov 4 15:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 79064 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 544EE3858C41 for ; Sat, 4 Nov 2023 15:43:21 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050:0:465::101]) by sourceware.org (Postfix) with ESMTPS id C98043858D3C for ; Sat, 4 Nov 2023 15:43:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C98043858D3C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C98043858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2050:0:465::101 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699112588; cv=none; b=E4bzDAjoZ0tyn5L+depYXlXLTRkNGPBco1y5/6/HqTh9o/vBDR6S/7Yx6OfXeJ9LehNrqx7tGTHlHbTMSmSYZFl/c0N/cOPH+5D9SJiebTEgnaES78gseJeVhV1S7xHfTkXWmEWO3yH631Tic6+uAZct40c4Iq4xoKqfVhLHsM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699112588; c=relaxed/simple; bh=q4BgLeQg7jo3uHuxtovwhmaX61SGAKHdP8fcME1o8rk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GQqpUAm7HcDFwhl9mT8av4SjwbIHj4gDBNBZCLYPUx/TuvavyMtbKBOtz+756Oyon+ORQuZLAyJetES5XTNHPg+VaT3TRLbByuZZ+n/uIViJvUxYBZVyMw+X8iPFVlRwtfDvhL7WISyTzhkqWNI1WmKcljSIm63ECR/ow4DRCGo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4SN21y06pxz9snx; Sat, 4 Nov 2023 16:43:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1699112582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0cl1BeUGg90wo8gvvmQuBEIRectArw6tYMrmwCbNpM4=; b=QelW+Pqcp5Gh1JDRjMSQnfeQUnqU2R+si4Re2p3q7BAjLET4di7+nPfATub2uyU02jtNaT nFBuXUKJ7Kpf+qEowxoJfP7uCRKdNTPldEKEvNjv/yKGbx0anIYSkU0lGsHCV4HKz1uR6k udlTaZxGC1lhITEgXVJ8rlXLPayOuCxGt0PYvZ7HwxEtEEwU/yMOiocqVTBDOHRuqpENmk 2sCU4dNoCUcC00lME1t8M/HOc5lukwVtf8yoIfxQTiqzpTyHWByZ19IWz1hsGQBBuRQCt+ D+A6xIuABoS3oh9+3bczkSRQp8ycbvyhT+g9d+sLhAMR1i+KCvg1MRX4e9BcxA== From: =?utf-8?q?Arsen_Arsenovi=C4=87?= To: gdb-patches@sourceware.org Cc: =?utf-8?q?Arsen_Arsenovi=C4=87?= , Eli Zaretskii Subject: [PATCH v3] gdb/tui: add a vsplit layout Date: Sat, 4 Nov 2023 16:29:50 +0100 Message-ID: <20231104153925.3734509-1-arsen@aarsen.me> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org The usual 'split' layout features a vertical stack that inadequately makes use of widely-used widescreen displays. This layout displays the same information but in a horizontal stack in a way that's quite handy for debugging on wide screens. Reviewed-By: Eli Zaretskii Reviewed-By: Eli Zaretskii --- Afternoon, v2: https://inbox.sourceware.org/20231104130153.3649198-1-arsen@aarsen.me/ Changes since v2: - Added a NEWS item. TIA, have a lovely day. gdb/NEWS | 6 ++++++ gdb/doc/gdb.texinfo | 4 ++++ gdb/testsuite/gdb.tui/completion.exp | 2 +- gdb/testsuite/gdb.tui/tui-layout.exp | 5 ++++- gdb/tui/tui-layout.c | 11 +++++++++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 95663433f1c..af1480aaf1a 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -17,6 +17,12 @@ ** New read/write attribute gdb.Value.bytes that contains a bytes object holding the contents of this value. +* GDB now includes a TUI layout called "vsplit", which places a source box, and + to the right of it a disassembly box, and below both the status line and + command box. This layout is similar to the existing "split" layout, except + with the split made vertically, so that it accommodates wide-screen displays + better. It can be enabled by running "tui layout vsplit". + *** Changes in GDB 14 * GDB now supports the AArch64 Scalable Matrix Extension 2 (SME2), which diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index db1a82ec838..209af3a4b0e 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -30604,6 +30604,10 @@ Display the assembly and command windows. @item split Display the source, assembly, and command windows. +@item vsplit +Display the source and assembly side by side, and the command window +below them. + @item regs When in @code{src} layout display the register, source, and command windows. When in @code{asm} or @code{split} layout display the diff --git a/gdb/testsuite/gdb.tui/completion.exp b/gdb/testsuite/gdb.tui/completion.exp index 9cf8dc2ee25..4110045d117 100644 --- a/gdb/testsuite/gdb.tui/completion.exp +++ b/gdb/testsuite/gdb.tui/completion.exp @@ -50,7 +50,7 @@ proc test_tab_completion {input_line expected_re} { if { [readline_is_used] } { with_test_prefix "completion of layout names" { - test_tab_completion "layout" "asm *next *prev *regs *split *src *" + test_tab_completion "layout" "asm *next *prev *regs *split *src *vsplit *" } diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp index 90f27c5eac1..ea99d8f6ef9 100644 --- a/gdb/testsuite/gdb.tui/tui-layout.exp +++ b/gdb/testsuite/gdb.tui/tui-layout.exp @@ -83,13 +83,16 @@ proc test_layout_or_focus {layout_name terminal execution} { } elseif {$layout_name == "split"} { Term::check_box "src box" 0 0 80 8 Term::check_box "asm box" 0 7 80 8 + } elseif {$layout_name == "vsplit"} { + Term::check_box "src box" 0 0 40 15 + Term::check_box "asm box" 39 0 41 15 } } } foreach_with_prefix terminal {ansi dumb} { foreach_with_prefix execution {false true} { - foreach_with_prefix layout {"asm" "reg" "src" "split"} { + foreach_with_prefix layout {"asm" "reg" "src" "split" "vsplit"} { test_layout_or_focus $layout $terminal $execution } } diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 159445dc520..824ed282622 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -1184,6 +1184,17 @@ initialize_layouts () layout->add_window (CMD_NAME, 1); add_layout_command ("split", layout); + layout = new tui_layout_split (); + { + auto vsplit_top_half = std::make_unique (false); + vsplit_top_half->add_window (SRC_NAME, 1); + vsplit_top_half->add_window (DISASSEM_NAME, 1); + layout->add_split (std::move (vsplit_top_half), 1); + layout->add_window (STATUS_NAME, 0); + layout->add_window (CMD_NAME, 1); + add_layout_command ("vsplit", layout); + } + layout = new tui_layout_split (); layout->add_window (DATA_NAME, 1); layout->add_window (SRC_NAME, 1);