+2019-08-20 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.h (struct tui_data_window) <check_register_values>:
+ Declare.
+ (tui_check_register_values): Don't declare.
+ * tui/tui-regs.c (tui_data_window::check_register_values): Rename
+ from tui_check_register_values.
+ * tui/tui-hooks.c (tui_register_changed): Update.
+
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reg_layout): Move later.
{
struct frame_info *fi;
+ if (!tui_is_window_visible (DATA_WIN))
+ return;
+
/* The frame of the register that was changed may differ from the selected
frame, but we only want to show the register values of the selected frame.
And even if the frames differ a register change made in one can still show
if (tui_refreshing_registers == 0)
{
tui_refreshing_registers = 1;
- tui_check_register_values (fi);
+ TUI_DATA_WIN->check_register_values (fi);
tui_refreshing_registers = 0;
}
}
&& (frame_info_changed_p || registers_too_p))
{
tui_refreshing_registers = 1;
- tui_check_register_values (fi);
+ TUI_DATA_WIN->check_register_values (fi);
tui_refreshing_registers = 0;
}
}
given a particular frame. If the values have changed, they are
updated with the new value and highlighted. */
void
-tui_check_register_values (struct frame_info *frame)
+tui_data_window::check_register_values (struct frame_info *frame)
{
- if (TUI_DATA_WIN != NULL
- && TUI_DATA_WIN->is_visible ())
+ if (regs_content.empty () && display_regs)
+ tui_show_registers (current_group);
+ else
{
- if (TUI_DATA_WIN->regs_content.empty ()
- && TUI_DATA_WIN->display_regs)
- tui_show_registers (TUI_DATA_WIN->current_group);
- else
+ for (auto &&data_item_win_ptr : regs_content)
{
- for (auto &&data_item_win_ptr : TUI_DATA_WIN->regs_content)
- {
- int was_hilighted;
+ int was_hilighted;
- was_hilighted = data_item_win_ptr->highlight;
+ was_hilighted = data_item_win_ptr->highlight;
- tui_get_register (frame, data_item_win_ptr.get (),
- data_item_win_ptr->item_no,
- &data_item_win_ptr->highlight);
+ tui_get_register (frame, data_item_win_ptr.get (),
+ data_item_win_ptr->item_no,
+ &data_item_win_ptr->highlight);
- if (data_item_win_ptr->highlight || was_hilighted)
- tui_display_register (data_item_win_ptr.get ());
- }
+ if (data_item_win_ptr->highlight || was_hilighted)
+ tui_display_register (data_item_win_ptr.get ());
}
}
}
started from. If nothing is displayed (-1) is returned. */
int display_registers_from_line (int line_no);
+ void check_register_values (struct frame_info *frame);
+
protected:
void do_scroll_vertical (int num_to_scroll) override;
void rerender () override;
};
-extern void tui_check_register_values (struct frame_info *);
extern void tui_show_registers (struct reggroup *group);
#endif /* TUI_TUI_REGS_H */