diff options
author | Tom Tromey <tom@tromey.com> | 2023-12-16 19:42:37 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-02-08 12:15:39 -0700 |
commit | 6b32381343157132e2089ba13d50524b59da106e (patch) | |
tree | 9764340ef5404f7063548d3f4e32261da54ed363 /gdb/tui | |
parent | b1adacb66386222a8da7e64126b80ae334b16089 (diff) | |
download | fsf-binutils-gdb-6b32381343157132e2089ba13d50524b59da106e.zip fsf-binutils-gdb-6b32381343157132e2089ba13d50524b59da106e.tar.gz fsf-binutils-gdb-6b32381343157132e2089ba13d50524b59da106e.tar.bz2 |
Rename tui_data_item_window -> tui_register_info
tui_data_item_window used to hold a curses window, but we removed that
ages ago. Now it just holds information about a single register.
This patch renames the class to make it more clearly reflect its
meaning.
Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-regs.c | 13 | ||||
-rw-r--r-- | gdb/tui/tui-regs.h | 14 |
2 files changed, 12 insertions, 15 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index f7911b5..bacb23a 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -105,15 +105,12 @@ tui_register_format (frame_info_ptr frame, int regnum) 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); } } @@ -229,7 +226,7 @@ tui_data_window::update_register_data (const reggroup *group, { /* 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); } } @@ -443,7 +440,7 @@ tui_data_window::check_register_values (frame_info_ptr 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; @@ -462,7 +459,7 @@ tui_data_window::check_register_values (frame_info_ptr frame) /* 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. */ diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index c1f89a5..e7125e4 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -25,20 +25,20 @@ #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); @@ -136,8 +136,8 @@ private: 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; |