From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26656 invoked by alias); 10 Sep 2019 19:09:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26054 invoked by uid 89); 10 Sep 2019 19:09:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2019 19:09:07 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 3A8C11C2F82 for ; Tue, 10 Sep 2019 14:09:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 7lVii5wbIdnCe7lViiR9CU; Tue, 10 Sep 2019 14:09:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9imawGzJ+NWIjoB4rcojJiwL8JIfsbAXNb+eoVyivlU=; b=shVDHLhexqwccyCFzO4mmIng8R bXqJiGJGKjscsABP0vvIlMJZNj7gLUfz80Rhp2bgMYrYUk3XOHMyVFTvgy92kklyYOgtGb1aWpiB/ pMvlxb61VqFDfSgKJ988Ep+9L; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:51788 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1i7lVh-000EcZ-Nz; Tue, 10 Sep 2019 14:09:05 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 15/20] Rename private data members of tui_data_window Date: Tue, 10 Sep 2019 19:09:00 -0000 Message-Id: <20190910190857.6562-16-tom@tromey.com> In-Reply-To: <20190910190857.6562-1-tom@tromey.com> References: <20190910190857.6562-1-tom@tromey.com> X-SW-Source: 2019-09/txt/msg00177.txt.bz2 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 * tui/tui-regs.h (struct tui_data_window) : Update. : 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 regs_content; - int regs_column_count = 0; - struct reggroup *current_group = nullptr; + std::vector m_regs_content; + int m_regs_column_count = 0; + struct reggroup *m_current_group = nullptr; }; #endif /* TUI_TUI_REGS_H */ -- 2.17.2