aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-win.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-06 21:19:45 -0600
committerTom Tromey <tom@tromey.com>2019-08-15 12:29:28 -0600
commit3891b65efe614fe2e2f7e75e7f5ec8964f7fd96b (patch)
tree963216261c95876c9e617f0c5f6f91f558cb5e13 /gdb/tui/tui-win.c
parentee556432c44dd5dbcf22c4086774bd29ded5b208 (diff)
downloadgdb-3891b65efe614fe2e2f7e75e7f5ec8964f7fd96b.zip
gdb-3891b65efe614fe2e2f7e75e7f5ec8964f7fd96b.tar.gz
gdb-3891b65efe614fe2e2f7e75e7f5ec8964f7fd96b.tar.bz2
Change TUI source window iteration
Currently the TUI does separate bookkeeping to track which source windows exist. It seems better to me to just refer to the list of windows for this, so this patch removes the special handling and instead adds a new iterator. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_iterator): New. (struct tui_source_windows): New. * tui/tui-winsource.c (tui_display_main): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights) (new_height_ok, parse_scrolling_args): Update. * tui/tui-layout.c (show_layout, show_data): Update. * tui/tui-data.h (tui_source_windows, tui_clear_source_windows) (tui_add_to_source_windows): Don't declare. * tui/tui-data.c (source_windows, tui_source_windows) (tui_clear_source_windows, tui_add_to_source_windows): Remove.
Diffstat (limited to 'gdb/tui/tui-win.c')
-rw-r--r--gdb/tui/tui-win.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 7210f6c..aa07dfc 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -571,7 +571,7 @@ tui_resize_all (void)
{
case SRC_COMMAND:
case DISASSEM_COMMAND:
- src_win = tui_source_windows ()[0];
+ src_win = *(tui_source_windows ().begin ());
first_win = src_win;
first_win->width += width_diff;
locator->width += width_diff;
@@ -610,7 +610,7 @@ tui_resize_all (void)
{
first_win = TUI_DATA_WIN;
first_win->width += width_diff;
- src_win = tui_source_windows ()[0];
+ src_win = *(tui_source_windows ().begin ());
second_win = src_win;
second_win->width += width_diff;
}
@@ -1046,7 +1046,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
primary_win_info->make_invisible_and_set_new_height (new_height);
if (primary_win_info->type == CMD_WIN)
{
- win_info = tui_source_windows ()[0];
+ win_info = *(tui_source_windows ().begin ());
src_win_info = win_info;
}
else
@@ -1084,7 +1084,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
{
src1 = nullptr;
first_win = TUI_DATA_WIN;
- second_win = tui_source_windows ()[0];
+ second_win = *(tui_source_windows ().begin ());
}
if (primary_win_info == TUI_CMD_WIN)
{ /* Split the change in height accross the 1st & 2nd
@@ -1238,7 +1238,7 @@ new_height_ok (struct tui_win_info *primary_win_info,
struct tui_win_info *win_info;
if (primary_win_info == TUI_CMD_WIN)
- win_info = tui_source_windows ()[0];
+ win_info = *(tui_source_windows ().begin ());
else
win_info = TUI_CMD_WIN;
ok = ((new_height +
@@ -1259,7 +1259,7 @@ new_height_ok (struct tui_win_info *primary_win_info,
else
{
first_win = TUI_DATA_WIN;
- second_win = tui_source_windows ()[0];
+ second_win = *(tui_source_windows ().begin ());
}
/* We could simply add all the heights to obtain the same
result but below is more explicit since we subtract 1 for
@@ -1385,7 +1385,7 @@ parse_scrolling_args (const char *arg,
if (!(*win_to_scroll)->is_visible)
error (_("Window is not visible"));
else if (*win_to_scroll == TUI_CMD_WIN)
- *win_to_scroll = tui_source_windows ()[0];
+ *win_to_scroll = *(tui_source_windows ().begin ());
}
}
}