diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-26 16:26:39 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:01 -0600 |
commit | 368c1354e578eb280df37059aa6b8c1f178baaf4 (patch) | |
tree | f1ca0fa11460da182e3b215e9ebcf407be2329be | |
parent | e80cd2047079a63ab087df15d179c49ca18de202 (diff) | |
download | gdb-368c1354e578eb280df37059aa6b8c1f178baaf4.zip gdb-368c1354e578eb280df37059aa6b8c1f178baaf4.tar.gz gdb-368c1354e578eb280df37059aa6b8c1f178baaf4.tar.bz2 |
Simplify tui_show_registers
tui_show_registers keeps a local status variable, but it is not
actually needed. This rearranges the function to remove the variable.
gdb/ChangeLog
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_show_registers): Simplify.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 17 |
2 files changed, 10 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 15bdcc7..93bb113 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-regs.c (tui_show_registers): Simplify. + +2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-regs.c (tui_show_registers): Update. (tui_show_register_group): Add win_info parameter. diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 17b3b28..59bfd08 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -121,8 +121,6 @@ tui_data_window::first_reg_element_no_inline (int line_no) const void tui_show_registers (struct reggroup *group) { - enum tui_status ret = TUI_FAILURE; - /* Make sure the curses mode is enabled. */ tui_enable (); @@ -142,15 +140,7 @@ tui_show_registers (struct reggroup *group) { tui_show_register_group (TUI_DATA_WIN, group, get_selected_frame (NULL), group == TUI_DATA_WIN->current_group); - ret = TUI_SUCCESS; - } - if (ret == TUI_FAILURE) - { - TUI_DATA_WIN->current_group = 0; - TUI_DATA_WIN->erase_data_content (NO_REGS_STRING); - } - else - { + /* Clear all notation of changed values. */ for (auto &&data_item_win : TUI_DATA_WIN->regs_content) { @@ -160,6 +150,11 @@ tui_show_registers (struct reggroup *group) TUI_DATA_WIN->current_group = group; TUI_DATA_WIN->display_all_data (); } + else + { + TUI_DATA_WIN->current_group = 0; + TUI_DATA_WIN->erase_data_content (NO_REGS_STRING); + } } |