Message ID | 20231217-tui-regs-cleanup-v1-11-67bd0ea1e8be@tromey.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 A2DFB3858024 for <patchwork@sourceware.org>; Sun, 17 Dec 2023 19:51:54 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 664D5385843A for <gdb-patches@sourceware.org>; Sun, 17 Dec 2023 19:50:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 664D5385843A 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 664D5385843A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702842635; cv=none; b=msLFzovdyh1PZXUGCjtm1qeYPKvcZr0NR9iWTZVCHIg/X6DsGnAFhCEaqPwXBtL2++A+YtUO45plIhUBE5yPD/wkzD9yCmXaBMUF7L48NmGAHF2K+i3ZdeUINouXzfrKCYHVyWcmSqTFXGYRqxTTRpXf9ws6JyJCJJkOJhOBt5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702842635; c=relaxed/simple; bh=u7UNgHLHoD5e9j4G5VQauGBYNUH1Rh8gmtj5Bv49dS0=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=Q07EJGngT1f5UIKK3PKAkLN2hHuRr5L7yXQyCIuwTPAKYH0FtpONJ1OCdrrlvrd2w3vKjCQEt6cKV8qJv570ZZgIu9z5qam19Wwb0YtQeujUbQuCSdeOhtwaGnPdEuwjUWbQigi3tML+RV9t9WueiCXWiTXWQ0wM1iprKKULwOo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6001a.ext.cloudfilter.net ([10.0.30.140]) by cmsmtp with ESMTPS id Et1rriUR9L9AgEx9irX1Xg; Sun, 17 Dec 2023 19:50:30 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Ex9hr6MCHb8QnEx9irALUf; Sun, 17 Dec 2023 19:50:30 +0000 X-Authority-Analysis: v=2.4 cv=IuQNzZzg c=1 sm=1 tr=0 ts=657f5106 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=OmRwvL_3p8ROV2Qvn1cA: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=U41bXq9yp+8MAxRHTQR+w2v4UIt3YTTILDJb7bqHFH0=; b=LIIN5aKOUn/ZxvrkWzBAK6iNTD kH8T5gJ/cNdusrfvSwTbmn99b6z21AcoW+i1d+JJbdyNtJJ5MLuCojI2elYs8SDNkrZI3dzp6mZYr 5HVMgES3nGzfS0/BCCCDVIgQq; 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 <tom@tromey.com>) id 1rEx9h-004MyY-2N for gdb-patches@sourceware.org; Sun, 17 Dec 2023 12:50:29 -0700 From: Tom Tromey <tom@tromey.com> Date: Sun, 17 Dec 2023 12:50:36 -0700 Subject: [PATCH 11/14] Remove redundant check from tui_refresh_frame_and_register_information MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231217-tui-regs-cleanup-v1-11-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: 1rEx9h-004MyY-2N 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: 12 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHkTc+SvTQ4LzuUBwsSH504jpvs8sCaZrnq589EOa7cbNHk/J1HT8i1g5yh/QX80H1eWHZAFmjlyhDpJ2h8D+9tktK0y9H1GSBryDhuFY5jr/TqO+bs7 jEBqktehPVPrOrFDPnGyBU4YqQ7LQfenook+cpk6CEv89LPEqDBXK6Z0SMpQJdYdCYEIKoHxCawcRa+xQnhBcQ9yFbcR/bWPruw= 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
Cleanups for the TUi register window
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Testing passed |
Commit Message
Tom Tromey
Dec. 17, 2023, 7:50 p.m. UTC
tui_refresh_frame_and_register_information checks 'from_stack' in a block that's already guarded by a 'from_stack' check. This patch removes the redundant check. --- gdb/tui/tui-hooks.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
Am Sonntag, 17. Dezember 2023, 20:51:57 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: > tui_refresh_frame_and_register_information checks 'from_stack' in a > block that's already guarded by a 'from_stack' check. This patch > removes the redundant check. > --- > gdb/tui/tui-hooks.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c > index e47607fefa9..f1e4978a40a 100644 > --- a/gdb/tui/tui-hooks.c > +++ b/gdb/tui/tui-hooks.c > @@ -132,11 +132,10 @@ tui_refresh_frame_and_register_information () > > /* Display the frame position (even if there is no symbols or > the PC is not known). */ > - bool frame_info_changed_p = tui_show_frame_info (fi); > + tui_show_frame_info (fi); > > /* Refresh the register window if it's visible. */ > - if (tui_is_window_visible (DATA_WIN) > - && (frame_info_changed_p || from_stack)) > + if (tui_is_window_visible (DATA_WIN)) > TUI_DATA_WIN->check_register_values (fi); > } > else if (!from_stack) > > -- > 2.43.0 Was the return value of tui_show_frame_info(fi) also useless? Regards Hannes
>>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes: >> - if (tui_is_window_visible (DATA_WIN) >> - && (frame_info_changed_p || from_stack)) Hannes> Was the return value of tui_show_frame_info(fi) also useless? Yes, in the above, 'from_stack' is always true, so the value of 'frame_info_changed_p' is immaterial. Tom
Tom Tromey <tom@tromey.com> writes: >>>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes: > >>> - if (tui_is_window_visible (DATA_WIN) >>> - && (frame_info_changed_p || from_stack)) > > Hannes> Was the return value of tui_show_frame_info(fi) also useless? > > Yes, in the above, 'from_stack' is always true, so the value of > 'frame_info_changed_p' is immaterial. Except I think that's a bug in the original code. As your previous patch points out we already hook the register changed observer, so the only time that a register change will need this function to refresh the register display is if the frame was changed. If we're going to stop checking frame_info_changed_p then we might as well stop hooking gdb::observers::register_changed and just rely on the before prompt hook to update everything, right? Thanks, Andrew
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes: >> Yes, in the above, 'from_stack' is always true, so the value of >> 'frame_info_changed_p' is immaterial. Andrew> Except I think that's a bug in the original code. Andrew> As your previous patch points out we already hook the register changed Andrew> observer, so the only time that a register change will need this Andrew> function to refresh the register display is if the frame was changed. Andrew> If we're going to stop checking frame_info_changed_p then we might as Andrew> well stop hooking gdb::observers::register_changed and just rely on the Andrew> before prompt hook to update everything, right? I don't think that will work correctly, because the TUI register window shows changed registers in a special way. If we rely solely on the before-prompt hook, then any command at all will cause a redisplay that will erase the "changed" highlighting. This is why two phases are needed: the register window hooks into the various things that can cause a register change, and then this is checked before redisplay. The patch in question here just removes some code that checks if the frame changed. However, if the frame did change, from_stack is already set due to the context-changed observer. Tom
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index e47607fefa9..f1e4978a40a 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -132,11 +132,10 @@ tui_refresh_frame_and_register_information () /* Display the frame position (even if there is no symbols or the PC is not known). */ - bool frame_info_changed_p = tui_show_frame_info (fi); + tui_show_frame_info (fi); /* Refresh the register window if it's visible. */ - if (tui_is_window_visible (DATA_WIN) - && (frame_info_changed_p || from_stack)) + if (tui_is_window_visible (DATA_WIN)) TUI_DATA_WIN->check_register_values (fi); } else if (!from_stack)