public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/tui] Handle shared border in fixed-sized layout
Date: Sat, 9 Dec 2023 14:47:45 +0100	[thread overview]
Message-ID: <ed661d6c-586e-4b44-9a34-fd94f2c30679@suse.de> (raw)
In-Reply-To: <87msukhekt.fsf@tromey.com>

On 12/8/23 16:57, Tom Tromey wrote:
> Is there any window with a fixed size other than the status line?

I don't think so, no.

> I wouldn't expect this to be hit currently.

Agreed.

However, I managed to trigger the behaviour using a trigger patch.

Say I have a terminal with 24 lines:
...
$ echo $LINES
24
...
and I show the window sizes of the split layout:
...
$ gdb -q -ex "layout split" -ex "info win"
...
and get:
...
Name       Lines Columns Focus
src            8      80 (has focus)
asm            8      80
status         1      80
cmd            8      80
(gdb)
...

Note that 8 + 8 + 1 + 8 == 25 == 24 + 1, this is due to the shared box 
between src and asm.

Now let's make src and asm fixed-size windows of 8 lines:
...
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 523d0ea832b..61f00b6f6d8 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -91,6 +91,15 @@ struct tui_source_element

  struct tui_source_window_base : public tui_win_info
  {
+  int max_height () const final override
+  {
+    return 8;
+  }
+
+  int min_height () const final override
+  {
+    return 8;
+  }
  protected:
    tui_source_window_base ();
    ~tui_source_window_base ();
...

Instead, we get:
...
Name       Lines Columns Focus
src            8      80 (has focus)
asm            8      80
status         1      80
cmd            7      80
(gdb)
...
and the last line of the terminal is unused.

Then after applying this patch, we're back to the expected:
...
Name       Lines Columns Focus
src            8      80 (has focus)
asm            8      80
status         1      80
cmd            8      80
...

Pushed.

Thanks,
- Tom

      reply	other threads:[~2023-12-09 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 16:54 Tom de Vries
2023-12-08 15:57 ` Tom Tromey
2023-12-09 13:47   ` Tom de Vries [this message]

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=ed661d6c-586e-4b44-9a34-fd94f2c30679@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).