From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cghJKyLtOWpNORQAWB0awg (envelope-from ) for ; Mon, 22 Jun 2026 22:19:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782181154; bh=I9CdD4oOMRYxRm/Msn6a4bFH22rnwZiPONu/Ljmf9lI=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nwCP4Mzjv+5jd1uF8a+EajGZ2TmdOqbpKEQlMVUoqlMFKpFBw1cBSHiVtlpJpcUr3 UuY8AJTUA4uDPxdJefawzNkZ+ocEripQnsBDXz1VGwp9YujMOuJ6LeEG38HajPbbcH VExAOXlTpNaA46vK/ahpmTjlVjldjAZstex/jF4I= Received: by simark.ca (Postfix, from userid 112) id 9FD1B1E070; Mon, 22 Jun 2026 22:19:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=k1XEl+lj; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1C83E1E070 for ; Mon, 22 Jun 2026 22:19:13 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A72A64BA23D0 for ; Tue, 23 Jun 2026 02:19:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A72A64BA23D0 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=k1XEl+lj Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id F286D4BA23C8 for ; Tue, 23 Jun 2026 02:18:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F286D4BA23C8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F286D4BA23C8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782181121; cv=none; b=VJnYusNHlpYKlAMsfjESLC7mmIHRLZ+nw8Q5yQGQRl8y5Tk1xSKhlUczo2iioscgwt54bpFR2b9G6udSZrsvJtvNxM/xC4/wyZ43zO79ekThX3yBEkKZRkyyQxMVXdUcljOv3Hgd28HDae3Ql3RE9jwiFRGc5LcF6WPMIsNFFqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782181121; c=relaxed/simple; bh=I9CdD4oOMRYxRm/Msn6a4bFH22rnwZiPONu/Ljmf9lI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=x/yClJrLhIP1AwMiqGStsEBQQHADO0cfTCaOYDvhlSMUi9esBYm1cWuseW8wZfCa6iaw/wLBgLbDyUOn75153T0LPJQspfhOYkR8PGI0UMtn2RaCXDkgloPD0w7Aml89ihaGlkvt+gGYRDT7GeqKe0I+zfYlldLXdYsbJsqtZVk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=k1XEl+lj DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F286D4BA23C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1782181118; bh=I9CdD4oOMRYxRm/Msn6a4bFH22rnwZiPONu/Ljmf9lI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=k1XEl+ljYqTppYhaMHC80pNCb7xL8k+GAHShsHBn25A6Wi98INFnMELwSrOLBb8Np HMoU5wxXpZkK0lKW50b8WE7lsYTNEbrA4N4o8fAgiWDMadKzbJhVOR1HBonCHWsfuM ou7UNooQQ58FzpIfV89591hVJSVJ2eTRkU+gyH64= Received: by simark.ca (Postfix) id 2C5A11E070; Mon, 22 Jun 2026 22:18:38 -0400 (EDT) Message-ID: Date: Mon, 22 Jun 2026 22:18:37 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv2 1/2] gdb: remove sentinel frame check in frame_find_by_id To: Andrew Burgess , gdb-patches@sourceware.org References: Content-Language: fr From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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~public-inbox=simark.ca@sourceware.org On 6/22/26 5:33 PM, Andrew Burgess wrote: > While reviewing another patch Simon pointed out that the code in > frame_find_by_id for looking up the sentinel frame is no longer needed > since commit: > > commit 19f988359a62889b00d67fb59ef8c7d6d759fc98 > Date: Mon Jan 30 15:02:49 2023 -0500 > > gdb: give sentinel for user frames distinct IDs, register sentinel frames to the frame cache > > Prior to this commit the sentinel_frame was not added to the frame > stash, so we needed a manual check to lookup the sentinel frame. > After this commit the sentinel frame is added to the stash so the > manual check, though perfectly valid, is just unnecessary complexity, > and can be removed. A frame stash lookup is just a hash lookup, and > is relatively cheap, so switching to this isn't much extra cost. > > While I was working in frame_find_by_id I made a couple of additional > changes: > > 1. I moved the declarations of frame and prev_frame locals into the > function body, closer to where they are first defined. > > 2. Instead of treating a frame_info_ptr as a bool, I made use of the > frame_info_ptr::is_null method. > > There should be no user visible changes after this commit. > --- > gdb/frame.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/gdb/frame.c b/gdb/frame.c > index f64f5554f8c..c1a7c41dc4a 100644 > --- a/gdb/frame.c > +++ b/gdb/frame.c > @@ -959,17 +959,11 @@ frame_id_inner (struct gdbarch *gdbarch, struct frame_id l, struct frame_id r) > frame_info_ptr > frame_find_by_id (struct frame_id id) > { > - frame_info_ptr frame, prev_frame; > - > /* ZERO denotes the null frame, let the caller decide what to do > about it. Should it instead return get_current_frame()? */ > if (!frame_id_p (id)) > return NULL; > > - /* Check for the sentinel frame. */ > - if (id == frame_id_build_sentinel (0, 0)) > - return frame_info_ptr (sentinel_frame); >From what you know, was this check even working today? This compares the id we're looking for (which presumably has "real" addresses) with "code" and "special" addresses set to 0. In any case, LGTM. Approved-By: Simon Marchi Simon