diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-02-01 14:09:26 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-04-03 15:31:47 +0100 |
commit | b45b7407cdd07900ecc28a36710603edc96ade71 (patch) | |
tree | 51b0492155ad6ce5274736e1c3395292e02e0985 /gdb/tui | |
parent | b1ac644a05245de73b84c23fa6a24eb039a727d7 (diff) | |
download | gdb-b45b7407cdd07900ecc28a36710603edc96ade71.zip gdb-b45b7407cdd07900ecc28a36710603edc96ade71.tar.gz gdb-b45b7407cdd07900ecc28a36710603edc96ade71.tar.bz2 |
gdb/tui: relax restrictions on window max height and width
This commit removes some arbitrary adjustments made in
tui_cmd_window::max_height, tui_win_info::max_height, and
tui_win_info::max_width.
These member functions all subtract some constant from the theoretical
maximum height or width. I've looked back through the history a
little and can see no real reason why these adjustments should be
needed, with these adjustments removed all the existing tui tests
still pass.
However, retaining these restrictions causes some bugs, consider:
(gdb) tui new-layout hsrc {-horizontal src 1 cmd 1} 1
When this layout is selected with current master, gdb will leave a 4
line gap at the bottom of the terminal.
The problem is that the maximum height is restricted, for the cmd
window, to 4 less than the terminal height.
By removing this restriction gdb is able to size the windows to the
complete terminal height, and the layout is done correctly.
This 4 line restriction is also what prevents this layout from working
correctly:
(gdb) tui new-layout conly cmd 1
Previously, this layout would present a cmd window only, but there
would be a 4 line gap at the bottom of the terminal. This issue was
mentioned in an earlier commit in this series (when a different bug
was fixed), but with this commit, the above layout now correctly fills
the terminal. The associated test is updated.
After removing the adjustment in tui_cmd_window::max_height, the
implementation is now the same as the implementation in the parent
class tui_win_info, so I've completely removed the max_height call
from tui_cmd_window.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-command.c | 6 | ||||
-rw-r--r-- | gdb/tui/tui-command.h | 2 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 4 |
3 files changed, 2 insertions, 10 deletions
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index fa8af970..0f6c395 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -31,12 +31,6 @@ /* See tui-command.h. */ -int -tui_cmd_window::max_height () const -{ - return tui_term_height () - 4; -} - void tui_cmd_window::resize (int height_, int width_, int origin_x, int origin_y) { diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h index 06cc24f..6c35436 100644 --- a/gdb/tui/tui-command.h +++ b/gdb/tui/tui-command.h @@ -31,8 +31,6 @@ struct tui_cmd_window : public tui_win_info DISABLE_COPY_AND_ASSIGN (tui_cmd_window); - int max_height () const override; - void refresh_window () override { } diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 2ec6180..31b6606 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -955,7 +955,7 @@ tui_set_win_width_command (const char *arg, int from_tty) int tui_win_info::max_height () const { - return tui_term_height () - 2; + return tui_term_height (); } /* See tui-data.h. */ @@ -963,7 +963,7 @@ tui_win_info::max_height () const int tui_win_info::max_width () const { - return tui_term_width () - 2; + return tui_term_width (); } static void |