public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Make tui_register_info::highlight private
@ 2024-06-16 2:56 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-06-16 2:56 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a6687ef35cda4c85683682a55f75e5fed896f45a
commit a6687ef35cda4c85683682a55f75e5fed896f45a
Author: Tom Tromey <tom@tromey.com>
Date: Fri May 31 14:25:09 2024 -0600
Make tui_register_info::highlight private
This changes tui_register_info::highlight to be private, renaming it
to m_highlight.
Diff:
---
gdb/tui/tui-regs.c | 18 ++++++++----------
gdb/tui/tui-regs.h | 8 ++++++--
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 43b519ac127..2be81876010 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -95,13 +95,13 @@ tui_register_format (const frame_info_ptr &frame, int regnum)
}
/* Compute the register value from the given frame and format it for
- the display. update 'content' and set 'highlight' if the contents
- changed. */
+ the display. Update 'content' and set 'm_highlight' if the
+ contents changed. */
void
tui_register_info::update (const frame_info_ptr &frame)
{
std::string new_content = tui_register_format (frame, m_regno);
- highlight = content != new_content;
+ m_highlight = content != new_content;
content = std::move (new_content);
}
@@ -404,12 +404,11 @@ tui_data_window::check_register_values (const frame_info_ptr &frame)
{
for (tui_register_info &data_item_win : m_regs_content)
{
- bool was_hilighted = data_item_win.highlight;
+ bool was_hilighted = data_item_win.highlighted ();
data_item_win.update (frame);
- /* Register windows whose y == 0 are outside the visible area. */
- if ((data_item_win.highlight || was_hilighted)
+ if ((data_item_win.highlighted () || was_hilighted)
&& data_item_win.visible ())
data_item_win.rerender (handle.get (), m_item_width);
}
@@ -418,12 +417,11 @@ tui_data_window::check_register_values (const frame_info_ptr &frame)
}
}
-/* Display a register in a window. If hilite is TRUE, then the value
- will be displayed in reverse video. */
+/* Display a register in a window. */
void
tui_register_info::rerender (WINDOW *handle, int field_width)
{
- if (highlight)
+ if (m_highlight)
/* We ignore the return value, casting it to void in order to avoid
a compiler warning. The warning itself was introduced by a patch
to ncurses 5.7 dated 2009-08-29, changing this macro to expand
@@ -435,7 +433,7 @@ tui_register_info::rerender (WINDOW *handle, int field_width)
if (content.size () < field_width)
waddstr (handle, n_spaces (field_width - content.size ()));
- if (highlight)
+ if (m_highlight)
/* We ignore the return value, casting it to void in order to avoid
a compiler warning. The warning itself was introduced by a patch
to ncurses 5.7 dated 2009-08-29, changing this macro to expand
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 69ba10724e7..61bfdd20d6f 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -34,7 +34,6 @@ struct tui_register_info
: m_regno (regno)
{
update (frame);
- highlight = false;
}
DISABLE_COPY_AND_ASSIGN (tui_register_info);
@@ -48,14 +47,19 @@ struct tui_register_info
bool visible () const
{ return y > 0; }
+ bool highlighted () const
+ { return m_highlight; }
+
/* Location. */
int x = 0;
int y = 0;
- bool highlight = false;
std::string content;
private:
+ /* True if currently highlighted. */
+ bool m_highlight = false;
+
/* The register number. */
const int m_regno;
};
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-16 2:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-16 2:56 [binutils-gdb] Make tui_register_info::highlight private Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).