public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] gdb/tui: add a vsplit layout
@ 2023-11-04 12:47 Arsen Arsenović
  2023-11-04 13:05 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Arsen Arsenović @ 2023-11-04 12:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Arsen Arsenović

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.
---
Afternoon!

v1:
https://inbox.sourceware.org/20231104014343.3199584-1-arsen@aarsen.me/

Changes since v1:
- Updated the completion.exp test for layout completions.

With that changed, the diff between the testsuite run before and after
this patch appears to have nothing relevant to the patch (though, I'm
still not fully clear on how to interpret the GDB results).

This is also the only test the Linaro buildbot reported, so I suspect
that this revision should be fine.

Thanks in advance, apologies for the inconvenience, and have a lovely
day!  :-)

 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 +++++++++++
 4 files changed, 20 insertions(+), 2 deletions(-)

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<tui_layout_split> (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);
-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb/tui: add a vsplit layout
  2023-11-04 12:47 [PATCH v2] gdb/tui: add a vsplit layout Arsen Arsenović
@ 2023-11-04 13:05 ` Eli Zaretskii
  2023-11-04 14:14   ` Arsen Arsenović
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-11-04 13:05 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gdb-patches

> From: Arsen Arsenović <arsen@aarsen.me>
> Cc: Arsen Arsenović <arsen@aarsen.me>
> Date: Sat,  4 Nov 2023 13:47:44 +0100
> 
> 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.

Thanks.

>  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 +++++++++++
>  4 files changed, 20 insertions(+), 2 deletions(-)

The gdb.texinfo part is OK, but I think we also need a NEWS entry for
this new feature.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb/tui: add a vsplit layout
  2023-11-04 13:05 ` Eli Zaretskii
@ 2023-11-04 14:14   ` Arsen Arsenović
  2023-11-04 14:25     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Arsen Arsenović @ 2023-11-04 14:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

Hi Eli,

Eli Zaretskii <eliz@gnu.org> writes:

> The gdb.texinfo part is OK, but I think we also need a NEWS entry for
> this new feature.

Ah!  Right, that sounds reasonable.  What do you think of:

  * 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".

I can send an updated patch if you'd like and the above sounds OK.

> Reviewed-By: Eli Zaretskii <eliz@gnu.org>

Thanks, have a lovely day.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb/tui: add a vsplit layout
  2023-11-04 14:14   ` Arsen Arsenović
@ 2023-11-04 14:25     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-11-04 14:25 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gdb-patches

> From: Arsen Arsenović <arsen@aarsen.me>
> Cc: gdb-patches@sourceware.org
> Date: Sat, 04 Nov 2023 15:14:30 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > The gdb.texinfo part is OK, but I think we also need a NEWS entry for
> > this new feature.
> 
> Ah!  Right, that sounds reasonable.  What do you think of:
> 
>   * 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".

SGTM, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-04 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 12:47 [PATCH v2] gdb/tui: add a vsplit layout Arsen Arsenović
2023-11-04 13:05 ` Eli Zaretskii
2023-11-04 14:14   ` Arsen Arsenović
2023-11-04 14:25     ` Eli Zaretskii

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).