aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-28 23:35:31 -0600
committerTom Tromey <tom@tromey.com>2019-07-17 12:19:12 -0600
commit801109578cd2a6ebd690dd23f0d4a1f4a67aee09 (patch)
treeb3b6f4e487c4e6d40aa4011bf35e91a02f269579
parentcf82af058d2f1488d8f8a096d7e3b76d1d5a4f46 (diff)
downloadgdb-801109578cd2a6ebd690dd23f0d4a1f4a67aee09.zip
gdb-801109578cd2a6ebd690dd23f0d4a1f4a67aee09.tar.gz
gdb-801109578cd2a6ebd690dd23f0d4a1f4a67aee09.tar.bz2
Remove some dead code from tui_set_layout
tui_set_layout sets regs_populate using: regs_populate = (new_layout == SRC_DATA_COMMAND || new_layout == DISASSEM_DATA_COMMAND); Then later it checks this variable: if (!regs_populate && (new_layout == SRC_DATA_COMMAND || new_layout == DISASSEM_DATA_COMMAND)) However, this is equivalent to "!regs_populate && regs_populate", which can never be true. So, remove the dead code and the variable. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (tui_set_layout): Remove regs_populate variable.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tui/tui-layout.c17
2 files changed, 9 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97d5e85..338c39a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-07-17 Tom Tromey <tom@tromey.com>
+ * tui/tui-layout.c (tui_set_layout): Remove regs_populate
+ variable.
+
+2019-07-17 Tom Tromey <tom@tromey.com>
+
* tui/tui.c (tui_rl_other_window): Update.
* tui/tui-wingeneral.c (tui_data_window::refresh_window): Call
superclass method first. Always iterate over regs_content.
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index a02c157..ac0d01c 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -127,9 +127,7 @@ tui_set_layout (enum tui_layout_type layout_type)
if (layout_type != UNDEFINED_LAYOUT)
{
- enum tui_layout_type cur_layout = tui_current_layout (),
- new_layout = UNDEFINED_LAYOUT;
- int regs_populate = FALSE;
+ enum tui_layout_type cur_layout = tui_current_layout ();
struct gdbarch *gdbarch;
CORE_ADDR addr;
struct tui_win_info *win_with_focus = tui_win_with_focus ();
@@ -137,10 +135,8 @@ tui_set_layout (enum tui_layout_type layout_type)
extract_display_start_addr (&gdbarch, &addr);
- new_layout = layout_type;
+ enum tui_layout_type new_layout = layout_type;
- regs_populate = (new_layout == SRC_DATA_COMMAND
- || new_layout == DISASSEM_DATA_COMMAND);
if (new_layout != cur_layout)
{
show_layout (new_layout);
@@ -212,14 +208,9 @@ tui_set_layout (enum tui_layout_type layout_type)
/*
* Now update the window content.
*/
- if (!regs_populate
- && (new_layout == SRC_DATA_COMMAND
- || new_layout == DISASSEM_DATA_COMMAND))
- TUI_DATA_WIN->display_all_data ();
-
tui_update_source_windows_with_addr (gdbarch, addr);
-
- if (regs_populate)
+ if (new_layout == SRC_DATA_COMMAND
+ || new_layout == DISASSEM_DATA_COMMAND)
tui_show_registers (TUI_DATA_WIN->current_group);
}
}