From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 15/20] Rename private data members of tui_data_window
Date: Tue, 10 Sep 2019 19:09:00 -0000 [thread overview]
Message-ID: <20190910190857.6562-16-tom@tromey.com> (raw)
In-Reply-To: <20190910190857.6562-1-tom@tromey.com>
As Pedro suggested, this patch renames the private data members of
tui_data_window to use the "m_" prefix.
gdb/ChangeLog
2019-09-10 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <get_current_group>:
Update.
<m_regs_content, m_regs_column_count, m_current_group>: Add "m_"
prefix.
* tui/tui-regs.c (tui_data_window::last_regs_line_no)
(tui_data_window::line_from_reg_element_no)
(tui_data_window::first_reg_element_no_inline)
(tui_data_window::show_registers)
(tui_data_window::show_register_group)
(tui_data_window::display_registers_from)
(tui_data_window::display_registers_from_line)
(tui_data_window::first_data_item_displayed)
(tui_data_window::delete_data_content_windows)
(tui_data_window::erase_data_content)
(tui_data_window::do_scroll_vertical)
(tui_data_window::refresh_window)
(tui_data_window::check_register_values): Update.
---
gdb/ChangeLog | 20 +++++++++++++++
gdb/tui/tui-regs.c | 64 +++++++++++++++++++++++-----------------------
gdb/tui/tui-regs.h | 8 +++---
3 files changed, 56 insertions(+), 36 deletions(-)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 0485d04d25a..c4769cbcb43 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -96,8 +96,8 @@ tui_get_register (struct frame_info *frame,
int
tui_data_window::last_regs_line_no () const
{
- int num_lines = regs_content.size () / regs_column_count;
- if (regs_content.size () % regs_column_count)
+ int num_lines = m_regs_content.size () / m_regs_column_count;
+ if (m_regs_content.size () % m_regs_column_count)
num_lines++;
return num_lines;
}
@@ -107,14 +107,14 @@ tui_data_window::last_regs_line_no () const
int
tui_data_window::line_from_reg_element_no (int element_no) const
{
- if (element_no < regs_content.size ())
+ if (element_no < m_regs_content.size ())
{
int i, line = (-1);
i = 1;
while (line == (-1))
{
- if (element_no < regs_column_count * i)
+ if (element_no < m_regs_column_count * i)
line = i - 1;
else
i++;
@@ -131,8 +131,8 @@ tui_data_window::line_from_reg_element_no (int element_no) const
int
tui_data_window::first_reg_element_no_inline (int line_no) const
{
- if (line_no * regs_column_count <= regs_content.size ())
- return ((line_no + 1) * regs_column_count) - regs_column_count;
+ if (line_no * m_regs_column_count <= m_regs_content.size ())
+ return ((line_no + 1) * m_regs_column_count) - m_regs_column_count;
else
return (-1);
}
@@ -148,17 +148,17 @@ tui_data_window::show_registers (struct reggroup *group)
if (target_has_registers && target_has_stack && target_has_memory)
{
show_register_group (group, get_selected_frame (NULL),
- group == current_group);
+ group == m_current_group);
/* Clear all notation of changed values. */
- for (auto &&data_item_win : regs_content)
+ for (auto &&data_item_win : m_regs_content)
data_item_win.highlight = false;
- current_group = group;
+ m_current_group = group;
rerender ();
}
else
{
- current_group = 0;
+ m_current_group = 0;
erase_data_content (_("[ Register Values Unavailable ]"));
}
}
@@ -199,7 +199,7 @@ tui_data_window::show_register_group (struct reggroup *group,
nr_regs++;
}
- regs_content.resize (nr_regs);
+ m_regs_content.resize (nr_regs);
/* Now set the register names and values. */
pos = 0;
@@ -218,7 +218,7 @@ tui_data_window::show_register_group (struct reggroup *group,
if (name == 0 || *name == '\0')
continue;
- data_item_win = ®s_content[pos];
+ data_item_win = &m_regs_content[pos];
if (data_item_win)
{
if (!refresh_values_only)
@@ -241,7 +241,7 @@ tui_data_window::display_registers_from (int start_element_no)
int j, item_win_width, cur_y;
int max_len = 0;
- for (auto &&data_item_win : regs_content)
+ for (auto &&data_item_win : m_regs_content)
{
const char *p;
int len;
@@ -257,24 +257,24 @@ tui_data_window::display_registers_from (int start_element_no)
item_win_width = max_len + 1;
int i = start_element_no;
- regs_column_count = (width - 2) / item_win_width;
- if (regs_column_count == 0)
- regs_column_count = 1;
- item_win_width = (width - 2) / regs_column_count;
+ m_regs_column_count = (width - 2) / item_win_width;
+ if (m_regs_column_count == 0)
+ m_regs_column_count = 1;
+ item_win_width = (width - 2) / m_regs_column_count;
/* Now create each data "sub" window, and write the display into
it. */
cur_y = 1;
- while (i < regs_content.size ()
+ while (i < m_regs_content.size ()
&& cur_y <= viewport_height)
{
for (j = 0;
- j < regs_column_count && i < regs_content.size ();
+ j < m_regs_column_count && i < m_regs_content.size ();
j++)
{
/* Create the window if necessary. */
- regs_content[i].resize (1, item_win_width,
- (item_win_width * j) + 1, cur_y);
+ m_regs_content[i].resize (1, item_win_width,
+ (item_win_width * j) + 1, cur_y);
i++; /* Next register. */
}
cur_y++; /* Next row. */
@@ -322,14 +322,14 @@ tui_data_window::display_registers_from_line (int line_no)
registers. */
if (line_no >= last_regs_line_no ())
{
- line_no = line_from_reg_element_no (regs_content.size () - 1);
+ line_no = line_from_reg_element_no (m_regs_content.size () - 1);
if (line_no < 0)
line_no = 0;
}
}
element_no = first_reg_element_no_inline (line_no);
- if (element_no < regs_content.size ())
+ if (element_no < m_regs_content.size ())
display_reg_element_at_line (element_no, line_no);
else
line_no = (-1);
@@ -343,11 +343,11 @@ tui_data_window::display_registers_from_line (int line_no)
int
tui_data_window::first_data_item_displayed ()
{
- for (int i = 0; i < regs_content.size (); i++)
+ for (int i = 0; i < m_regs_content.size (); i++)
{
struct tui_gen_win_info *data_item_win;
- data_item_win = ®s_content[i];
+ data_item_win = &m_regs_content[i];
if (data_item_win->is_visible ())
return i;
}
@@ -360,7 +360,7 @@ tui_data_window::first_data_item_displayed ()
void
tui_data_window::delete_data_content_windows ()
{
- for (auto &&win : regs_content)
+ for (auto &&win : m_regs_content)
{
tui_delete_win (win.handle);
win.handle = NULL;
@@ -392,7 +392,7 @@ tui_data_window::erase_data_content (const char *prompt)
void
tui_data_window::rerender ()
{
- if (regs_content.empty ())
+ if (m_regs_content.empty ())
erase_data_content (_("[ Register Values Unavailable ]"));
else
{
@@ -411,7 +411,7 @@ tui_data_window::do_scroll_vertical (int num_to_scroll)
int first_line = (-1);
first_element_no = first_data_item_displayed ();
- if (first_element_no < regs_content.size ())
+ if (first_element_no < m_regs_content.size ())
first_line = line_from_reg_element_no (first_element_no);
else
{ /* Calculate the first line from the element number which is in
@@ -433,7 +433,7 @@ void
tui_data_window::refresh_window ()
{
tui_gen_win_info::refresh_window ();
- for (auto &&win : regs_content)
+ for (auto &&win : m_regs_content)
win.refresh_window ();
}
@@ -443,11 +443,11 @@ tui_data_window::refresh_window ()
void
tui_data_window::check_register_values (struct frame_info *frame)
{
- if (regs_content.empty ())
- show_registers (current_group);
+ if (m_regs_content.empty ())
+ show_registers (m_current_group);
else
{
- for (auto &&data_item_win : regs_content)
+ for (auto &&data_item_win : m_regs_content)
{
int was_hilighted;
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 73572efdf95..e45a68f8f49 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -71,7 +71,7 @@ struct tui_data_window : public tui_win_info
struct reggroup *get_current_group () const
{
- return current_group;
+ return m_current_group;
}
protected:
@@ -130,9 +130,9 @@ private:
void erase_data_content (const char *prompt);
/* Windows that are used to display registers. */
- std::vector<tui_data_item_window> regs_content;
- int regs_column_count = 0;
- struct reggroup *current_group = nullptr;
+ std::vector<tui_data_item_window> m_regs_content;
+ int m_regs_column_count = 0;
+ struct reggroup *m_current_group = nullptr;
};
#endif /* TUI_TUI_REGS_H */
--
2.17.2
next prev parent reply other threads:[~2019-09-10 19:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 19:09 [PATCH 00/20] Final round of TUI refactorings Tom Tromey
2019-09-10 19:09 ` [PATCH 01/20] Remove tui_clear_source_windows_detail Tom Tromey
2019-09-10 19:09 ` [PATCH 12/20] Don't call refresh in tui_resize_all Tom Tromey
2019-09-10 19:09 ` [PATCH 16/20] Rename a private data member in tui_source_window Tom Tromey
2019-09-10 19:09 ` [PATCH 05/20] Change tui_make_status_line to be a method Tom Tromey
2019-09-10 19:09 ` [PATCH 20/20] Change TUI window commands to be case-sensitive Tom Tromey
2019-09-11 2:34 ` Eli Zaretskii
2019-09-11 21:57 ` Tom Tromey
2019-09-12 3:29 ` Eli Zaretskii
2019-09-10 19:09 ` [PATCH 03/20] Move "fullname" to tui_source_window Tom Tromey
2019-09-10 19:09 ` [PATCH 07/20] Simplify tui_source_window_base::show_source_content Tom Tromey
2019-09-10 19:09 ` [PATCH 11/20] Set TUI locator height to 1 Tom Tromey
2019-09-10 19:09 ` [PATCH 06/20] Remove some explicit re-rendering from the TUI Tom Tromey
2019-09-10 19:09 ` [PATCH 08/20] Simplify TUI disassembly Tom Tromey
2019-09-10 19:09 ` [PATCH 18/20] Remove separator comments from TUI Tom Tromey
2019-09-10 19:09 ` [PATCH 13/20] Remove a call to tui_locator_win_info_ptr Tom Tromey
2019-09-10 19:09 ` [PATCH 17/20] Remove strcat_to_buf Tom Tromey
2019-09-10 19:09 ` [PATCH 10/20] Change "win_resized" to bool Tom Tromey
2019-09-10 19:09 ` Tom Tromey [this message]
2019-09-10 19:09 ` [PATCH 02/20] Change tui_source_element::line to be a unique_xmalloc_ptr Tom Tromey
2019-09-10 19:09 ` [PATCH 19/20] Use make_unique_xstrdup in TUI Tom Tromey
2019-09-10 19:09 ` [PATCH 04/20] Change tui_make_status_line to return std::string Tom Tromey
2019-09-10 19:09 ` [PATCH 09/20] Use "bool" in tui_data_window::show_register_group Tom Tromey
2019-09-10 19:09 ` [PATCH 14/20] Change members of tui_locator_window to std::string Tom Tromey
2019-09-20 19:29 ` [PATCH 00/20] Final round of TUI refactorings Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190910190857.6562-16-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).