From patchwork Sat Jan 20 18:23:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 84493 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 166303858292 for ; Sat, 20 Jan 2024 18:25:02 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 2DB4C3858C33 for ; Sat, 20 Jan 2024 18:23:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DB4C3858C33 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 2DB4C3858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705775003; cv=none; b=Gkye9g1BoCf1LXmQM5hDR2jHRd/nynRYYtFXBq43Hwb0x6Kygkq2VUVerYwGPQaJGOxPvMDzL4Vjgdf7kzP4XNjKbrB9ETa3/2/1rb7Hsp7uOkHBgXwv2gHmMhDTzEWATWXP2VDBLcKYBcsoK7Ytsa95RSCn58WSkTzBQz8HQCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705775003; c=relaxed/simple; bh=7cx4s08ZKqQdTnefkJ3uaKBPDfdqRg4uQuuoXtroiGg=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=wEbcrxAQQCQZ8VBOA07j99yGU3ChV/LaXGnTdl1wC0CJtvCitrxGHBe3JXkj8Iv8lmRJBdXAmzgXBSfdtRcxY/OYLxn1R1+emcoq194G24ThXwK5D6RXJ4+HfMuiGIu0zDjQHXjy/0ffrEv0IzA+8wn7U0FJWorciJX1zEYrM/E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id R8ZOrMcUwCF6GRG00r7ztL; Sat, 20 Jan 2024 18:23:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id RFzzrMT05fPByRFzzrFcfF; Sat, 20 Jan 2024 18:23:20 +0000 X-Authority-Analysis: v=2.4 cv=T+af8tGQ c=1 sm=1 tr=0 ts=65ac0f98 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=ktQ07uKBEBBQVHN25NMA:9 a=QEXdDO2ut3YA:10 a=ttL6gvAV6gYB7ajogvnJ:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=fjfbuWaObSw7kb/HgH9eq1oz9tmQkZYeGCaOJWt62F0=; b=g3M0OOOv99qj25yq7XDCnjfBg2 /7gn1knfJT5Zz/m4+SLkc9IFvvemJeMvabBhtyNKHqxV+2BPy8cH8IGj5KZEGeQ0kSWnf+eZVaUc7 02LWNhvO2trIUeUo33xciJQiv; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:47898 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 1rRFzz-0049D4-0h; Sat, 20 Jan 2024 11:23:19 -0700 From: Tom Tromey Date: Sat, 20 Jan 2024 11:23:15 -0700 Subject: [PATCH v2 04/14] Rename tui_data_item_window -> tui_register_info MIME-Version: 1.0 Message-Id: <20240120-tui-regs-cleanup-v2-4-a3cccc6a3573@tromey.com> References: <20240120-tui-regs-cleanup-v2-0-a3cccc6a3573@tromey.com> In-Reply-To: <20240120-tui-regs-cleanup-v2-0-a3cccc6a3573@tromey.com> To: gdb-patches@sourceware.org Cc: Tom de Vries , Andrew Burgess 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: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rRFzz-0049D4-0h X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:47898 X-Source-Auth: tom+tromey.com X-Email-Count: 16 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfL2I8JFYQm4WrvHYwPptL+IBbfi6Q1MDdzDq200ywHCEXMSr7xAtJsZ2B+178o7jnLgeh2YuewQdtU9T1zP8W73LWIMfvuAEobVwumwrMWS1Ib5RhEvE mDR5VLLouWU2byV1ca8dR4sMHUTBoPGdFqe3ZaXL5s3BGYBZBSPOJiW4/CskP3ClYfhpwzxnzfmcKs1wt1GTSPwJWfgYbBdwKFk= X-Spam-Status: No, score=-3022.8 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. Tested-By: Tom de Vries Reviewed-By: Andrew Burgess --- 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 f7911b53bfb..bacb23ab298 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 c1f89a5c1a6..e7125e457f5 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 @@ 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;