From: Eli Zaretskii <eliz@gnu.org>
To: tom@tromey.com
Cc: midenok@gmail.com, gdb-patches@sourceware.org
Subject: Re: GDB 9 TUI mode broken
Date: Sat, 22 Feb 2020 18:46:00 -0000 [thread overview]
Message-ID: <83eeumiho2.fsf@gnu.org> (raw)
In-Reply-To: <83ftf2iiqm.fsf@gnu.org> (message from Eli Zaretskii on Sat, 22 Feb 2020 20:23:29 +0200)
> Date: Sat, 22 Feb 2020 20:23:29 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 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 <eliz@gnu.org>
* 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 <midenok@gmail.com>.
--- 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)
next prev parent reply other threads:[~2020-02-22 18:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAF8BazBni=TZWTc5fbpdHU5bv1eM=24xpML46GCC2u4pFTkSAw@mail.gmail.com>
[not found] ` <835zg5m7ib.fsf@gnu.org>
2020-02-22 11:33 ` Eli Zaretskii
2020-02-22 15:55 ` Simon Marchi
2020-02-22 16:04 ` Eli Zaretskii
2020-02-22 16:37 ` Eli Zaretskii
2020-02-22 18:06 ` Tom Tromey
2020-02-22 18:05 ` Tom Tromey
2020-02-22 18:23 ` Eli Zaretskii
2020-02-22 18:46 ` Eli Zaretskii [this message]
2020-02-22 19:10 ` Tom Tromey
2020-02-22 20:19 ` Eli Zaretskii
2020-02-22 19:02 ` Tom Tromey
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=83eeumiho2.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=midenok@gmail.com \
--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