the display. update 'content' and set 'highlight' if the contents
changed. */
void
-tui_data_item_window::update (const frame_info_ptr &frame)
+tui_register_info::update (const frame_info_ptr &frame)
{
if (target_has_registers ())
{
std::string new_content = tui_register_format (frame, m_regno);
-
- if (content != new_content)
- highlight = true;
-
+ highlight = content != new_content;
content = std::move (new_content);
}
}
{
/* The group did not change, so we can simply update each
item. */
- for (tui_data_item_window ® : m_regs_content)
+ for (tui_register_info ® : m_regs_content)
reg.update (frame);
}
}
show_registers (m_current_group);
else
{
- for (tui_data_item_window &data_item_win : m_regs_content)
+ for (tui_register_info &data_item_win : m_regs_content)
{
bool was_hilighted = data_item_win.highlight;
/* Display a register in a window. If hilite is TRUE, then the value
will be displayed in reverse video. */
void
-tui_data_item_window::rerender (WINDOW *handle, int field_width)
+tui_register_info::rerender (WINDOW *handle, int field_width)
{
/* In case the regs window is not boxed, we'll write the last char in the
last line here, causing a scroll, so prevent that. */
#include "tui/tui-data.h"
#include "reggroups.h"
-/* A data item window. */
+/* Information about the display of a single register. */
-struct tui_data_item_window
+struct tui_register_info
{
- tui_data_item_window (int regno, const frame_info_ptr &frame)
+ tui_register_info (int regno, const frame_info_ptr &frame)
: m_regno (regno)
{
update (frame);
highlight = false;
}
- DISABLE_COPY_AND_ASSIGN (tui_data_item_window);
+ DISABLE_COPY_AND_ASSIGN (tui_register_info);
- tui_data_item_window (tui_data_item_window &&) = default;
+ tui_register_info (tui_register_info &&) = default;
void update (const frame_info_ptr &frame);
void erase_data_content (const char *prompt);
- /* Windows that are used to display registers. */
- std::vector<tui_data_item_window> m_regs_content;
+ /* Information about each register in the current register group. */
+ std::vector<tui_register_info> m_regs_content;
int m_regs_column_count = 0;
const reggroup *m_current_group = nullptr;