+2019-08-20 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.h (struct tui_data_window): Use
+ DISABLE_COPY_AND_ASSIGN.
+ <regs_content>: Change type, removing unique_ptr.
+ <tui_data_window>: Add move constructor.
+ * tui/tui-regs.c (tui_data_window::show_registers)
+ (tui_data_window::show_register_group)
+ (tui_data_window::display_registers_from)
+ (tui_data_window::display_registers_from)
+ (tui_data_window::first_data_item_displayed)
+ (tui_data_window::delete_data_content_windows)
+ (tui_data_window::rerender, tui_data_window::refresh_window)
+ (tui_data_window::check_register_values): Update.
+
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <show_registers,
/* Clear all notation of changed values. */
for (auto &&data_item_win : regs_content)
- {
- if (data_item_win != nullptr)
- data_item_win->highlight = false;
- }
+ data_item_win.highlight = false;
current_group = group;
display_all_data ();
}
nr_regs++;
}
- if (!refresh_values_only)
- regs_content.clear ();
-
- if (nr_regs < regs_content.size ())
- regs_content.resize (nr_regs);
- else
- {
- for (int i = regs_content.size (); i < nr_regs; ++i)
- regs_content.emplace_back (new tui_data_item_window ());
- }
+ regs_content.resize (nr_regs);
/* Now set the register names and values. */
pos = 0;
if (name == 0 || *name == '\0')
continue;
- data_item_win = regs_content[pos].get ();
+ data_item_win = ®s_content[pos];
if (data_item_win)
{
if (!refresh_values_only)
int len;
len = 0;
- p = data_item_win->content.get ();
+ p = data_item_win.content.get ();
if (p != 0)
len = strlen (p);
struct tui_data_item_window *data_item_win;
/* Create the window if necessary. */
- data_item_win = regs_content[i].get ();
+ data_item_win = ®s_content[i];
if (data_item_win->handle != NULL
&& (data_item_win->height != 1
|| data_item_win->width != item_win_width
{
struct tui_gen_win_info *data_item_win;
- data_item_win = regs_content[i].get ();
+ data_item_win = ®s_content[i];
if (data_item_win->is_visible ())
return i;
}
{
for (auto &&win : regs_content)
{
- tui_delete_win (win->handle);
- win->handle = NULL;
+ tui_delete_win (win.handle);
+ win.handle = NULL;
}
}
/* Delete all data item windows. */
for (auto &&win : regs_content)
{
- tui_delete_win (win->handle);
- win->handle = NULL;
+ tui_delete_win (win.handle);
+ win.handle = NULL;
}
display_all_data ();
}
{
tui_gen_win_info::refresh_window ();
for (auto &&win : regs_content)
- {
- if (win != NULL)
- win->refresh_window ();
- }
+ win.refresh_window ();
}
/* This function check all displayed registers for changes in values,
show_registers (current_group);
else
{
- for (auto &&data_item_win_ptr : regs_content)
+ for (auto &&data_item_win : regs_content)
{
int was_hilighted;
- was_hilighted = data_item_win_ptr->highlight;
+ was_hilighted = data_item_win.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,
+ data_item_win.item_no,
+ &data_item_win.highlight);
- if (data_item_win_ptr->highlight || was_hilighted)
- tui_display_register (data_item_win_ptr.get ());
+ if (data_item_win.highlight || was_hilighted)
+ tui_display_register (&data_item_win);
}
}
}
{
}
+ DISABLE_COPY_AND_ASSIGN (tui_data_item_window);
+
+ tui_data_item_window (tui_data_item_window &&) = default;
+
const char *name = nullptr;
/* The register number, or data display number. */
int item_no = -1;
}
/* Windows that are used to display registers. */
- std::vector<std::unique_ptr<tui_data_item_window>> regs_content;
+ std::vector<tui_data_item_window> regs_content;
int regs_column_count = 0;
/* Should regs be displayed at all? */
bool display_regs = false;