From patchwork Sun Dec 17 19:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 82344 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B33938582BE for ; Sun, 17 Dec 2023 19:50:51 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 76D833858C50 for ; Sun, 17 Dec 2023 19:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76D833858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 76D833858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702842632; cv=none; b=MvxJNekvFj1HRwecpwK39IyOLEXE2CsJEdjEPsadzgychpZqxyTGkLKlHu2U/e6gv9WO75yCzor3J96oUgkTAtVn5GprfLIz54vE6UeJ27r9iw0EGDWKczyb+0YmEhQQfQ/Shdr+fD18mXB9KsmwHDhBElcwukKcitSUYNmtnbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702842632; c=relaxed/simple; bh=89bEqlpVGw8Mk3TOATan8gccMHFrLxnFTXcbV6eNoYY=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=hvGoXslJR3ucEjqUX9TBK5eMkV4TZEmeplxpNrWXulVHLwupRScApdSiNT4EByeHXF+5IJ4vX+d0xQ3oO/7xqiXwjqZIFSC9jRp71fkubEkH3az8rXWLu3tsEsuq6xQDgBJZOsUW8xTCX+zeWdHmlCZs2CzcI2kdhCLdWFV5SUk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id EuoJrcTMy8HteEx9hr8G0p; Sun, 17 Dec 2023 19:50:29 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Ex9gr5w5oRGmSEx9hrM1eQ; Sun, 17 Dec 2023 19:50:29 +0000 X-Authority-Analysis: v=2.4 cv=efcuwpIH c=1 sm=1 tr=0 ts=657f5105 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=YbGixuDaje6vAT3NmwgA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=XsvnadItiiPBRmMBHTonwC5mzm6jwRG8t3PEsnqBcgU=; b=FTe9p0eYNYTr9leykyPGS1KwWO iYcR5azyihy0THPcMn14/Gh7PBEnU0oPWoDr1J+xcFZi2g9MOU8EW9N24xnK0O0fzVDor04ThNfQ2 0Xyxh7M/pb0i954UuYIPAkUF0; Received: from 71-211-161-25.hlrn.qwest.net ([71.211.161.25]:40716 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rEx9g-004MyY-2W for gdb-patches@sourceware.org; Sun, 17 Dec 2023 12:50:28 -0700 From: Tom Tromey Date: Sun, 17 Dec 2023 12:50:29 -0700 Subject: [PATCH 04/14] Rename tui_data_item_window -> tui_register_info MIME-Version: 1.0 Message-Id: <20231217-tui-regs-cleanup-v1-4-67bd0ea1e8be@tromey.com> References: <20231217-tui-regs-cleanup-v1-0-67bd0ea1e8be@tromey.com> In-Reply-To: <20231217-tui-regs-cleanup-v1-0-67bd0ea1e8be@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.161.25 X-Source-L: No X-Exim-ID: 1rEx9g-004MyY-2W X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-161-25.hlrn.qwest.net ([192.168.0.21]) [71.211.161.25]:40716 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNO1VPYslHoT7oVwv+PwMZuVh+DreDnYgiWabYZ5qu+pfXq7TVDmDU8Sg7QcGvMgia9Wj9bLUlxP28lnXK+3YtcZj0umigle1lhCJsAmRlZQ9AetAopA z78RCKAKRSJ7lMZCztYaRXre2d40n8hPLo+kPHT59gICBMZrOJk4bbaMwS+Gb9vDEVRkR//N9VY0DmxRGLpW9eHFXNq3kMry7J0= X-Spam-Status: No, score=-3022.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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. --- gdb/tui/tui-regs.c | 13 +++++-------- 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 7b8bf323f50..f87d1ff8721 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) display. When changedp is set, check if the new register value has changed with respect to the previous call. */ 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, regno); - - if (content != new_content) - highlight = true; - + highlight = content != new_content; content = std::move (new_content); } } @@ -230,7 +227,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); } } @@ -444,7 +441,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; @@ -463,7 +460,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 9c451ba5996..1a9f30fa270 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) : 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); @@ -133,8 +133,8 @@ struct tui_data_window : public tui_win_info void erase_data_content (const char *prompt); - /* Windows that are used to display registers. */ - std::vector m_regs_content; + /* Information about each register in the current register group. */ + std::vector m_regs_content; int m_regs_column_count = 0; const reggroup *m_current_group = nullptr;