diff options
author | Tom Tromey <tom@tromey.com> | 2019-12-21 10:35:59 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-12-27 09:33:36 -0700 |
commit | 1630140dc64fcc6ce2366650eedce690235a8178 (patch) | |
tree | 2433003f4b796ce573c381c2d6330dc2c80d1f67 | |
parent | f2810fe00a6b5f227c6d64168127f184f9862a19 (diff) | |
download | gdb-1630140dc64fcc6ce2366650eedce690235a8178.zip gdb-1630140dc64fcc6ce2366650eedce690235a8178.tar.gz gdb-1630140dc64fcc6ce2366650eedce690235a8178.tar.bz2 |
Remove tui_gen_win_info::viewport_height
tui_gen_win_info::viewport_height is only used in a couple of spots,
and is redundant with "height". This patch removes viewport_height.
gdb/ChangeLog
2019-12-27 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window::maybe_update): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from):
Update.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-data.h (struct tui_gen_win_info) <viewport_height>:
Remove.
* tui/tui-command.c (tui_cmd_window::resize): Update.
Change-Id: I020e026fbe289adda8e2fdfebca91bdbdbc312e8
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/tui/tui-command.c | 8 | ||||
-rw-r--r-- | gdb/tui/tui-data.h | 2 | ||||
-rw-r--r-- | gdb/tui/tui-layout.c | 4 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 3 | ||||
-rw-r--r-- | gdb/tui/tui-source.c | 2 |
6 files changed, 12 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8600e2e..ee11a3f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-12-27 Tom Tromey <tom@tromey.com> + + * tui/tui-source.c (tui_source_window::maybe_update): Update. + * tui/tui-regs.c (tui_data_window::display_registers_from): + Update. + * tui/tui-layout.c (tui_gen_win_info::resize): Update. + * tui/tui-data.h (struct tui_gen_win_info) <viewport_height>: + Remove. + * tui/tui-command.c (tui_cmd_window::resize): Update. + 2019-12-26 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_decode_symbol): Update. diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index e4c3a1b..5f676b2 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -42,14 +42,6 @@ tui_cmd_window::resize (int height_, int width_, int origin_x, int origin_y) { width = width_; height = height_; - if (height > 1) - { - /* Note this differs from the base class implementation, because - this window can't be boxed. */ - viewport_height = height - 1; - } - else - viewport_height = 1; x = origin_x; y = origin_y; diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index a0e296f..2a82248 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -110,8 +110,6 @@ public: /* Origin of window. */ int x = 0; int y = 0; - /* Viewport height. */ - int viewport_height = 0; }; /* Constant definitions. */ diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 9ab89a8..bd2e6ae 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -373,10 +373,6 @@ tui_gen_win_info::resize (int height_, int width_, width = width_; height = height_; - if (height > 1) - viewport_height = height - 2; - else - viewport_height = 1; x = origin_x_; y = origin_y_; diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 1d936f7..85c7a31 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -266,8 +266,7 @@ tui_data_window::display_registers_from (int start_element_no) /* Now create each data "sub" window, and write the display into it. */ cur_y = 1; - while (i < m_regs_content.size () - && cur_y <= viewport_height) + while (i < m_regs_content.size () && cur_y <= height - 2) { for (j = 0; j < m_regs_column_count && i < m_regs_content.size (); diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 0728263..2d8ecee 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -193,7 +193,7 @@ tui_source_window::line_is_displayed (int line) const void tui_source_window::maybe_update (struct frame_info *fi, symtab_and_line sal) { - int start_line = (sal.line - (viewport_height / 2)) + 1; + int start_line = (sal.line - ((height - 2) / 2)) + 1; if (start_line <= 0) start_line = 1; |