From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7SOUGQMKnmh9ZAMAWB0awg (envelope-from ) for ; Thu, 14 Aug 2025 12:08:35 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=EDk9gr5L; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 541C61E04C; Thu, 14 Aug 2025 12:08:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 7E5551E04C for ; Thu, 14 Aug 2025 12:08:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01EED3858D20 for ; Thu, 14 Aug 2025 16:08:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01EED3858D20 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=EDk9gr5L Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 21C1D3858C39 for ; Thu, 14 Aug 2025 16:08:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21C1D3858C39 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 21C1D3858C39 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=1755187684; cv=none; b=qzF3T0Vmfki2Ozas1xGgUxE8sDn5n01z7BT0KyqNDsduIlev7Rz2KJ4vo9Kaq8USweYe37SguUdj93DGzAdwwbS4FDOuGQNDm7+hI7H5vNdlWyJduWR2TsTKGbDPYOGH9LnlNoRK/iggpeDcotR+KCRrYH7HUwPqmpi/jUHU0Ss= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755187684; c=relaxed/simple; bh=qHT5PHg+T+YEbkcCxITT9GbVmL1PTZDkHjH82XLcs5s=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gFoR1HeYlbh5gTvX618P4z9v7Mm+e5nSUC5ZLzYsyUQTb4W6kB/oc9roSeKNLPP4x0F/dyODB8FcDhrXEMfIyXrDG5lZrEMtkdWK7vMI+XlLM4aCBEzFmINThDCrI5/I0dSoBMBnZpw0F/JKXEOMIUpL7X5imaISBGRpLmnW9po= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21C1D3858C39 Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id mTqquKEvaanSsmaUluki62; Thu, 14 Aug 2025 16:08:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id maUjupCukRdF3maUkuEmu4; Thu, 14 Aug 2025 16:08:02 +0000 X-Authority-Analysis: v=2.4 cv=SPdCVPvH c=1 sm=1 tr=0 ts=689e09e2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=2OwXVqhp2XgA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=zstS-IiYAAAA:8 a=m5QSBg6c3f_QzPAQ5-EA:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To: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=z3iMKNR8MLUyzjitX2X28ZF8QSra+kqx/xGdp7qwvrg=; b=EDk9gr5L+p+ntpEVXJoWc3yHm/ j6p1BPSfhN8RYWsirIMAxb6gihrYeg+Y7KekajCBzCJVYhJw6aW6jKyrs33jJqsyOEAMS/H1i19um c+QP821KiA5vBhtfJhG0zKWce; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:57384 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1umaUj-00000001aQB-0vJx; Thu, 14 Aug 2025 10:08:01 -0600 From: Tom Tromey To: Guinevere Larsen Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] gdb: modernize get_frame_pc_if_available In-Reply-To: <20250813202138.2311478-1-guinevere@redhat.com> (Guinevere Larsen's message of "Wed, 13 Aug 2025 17:21:38 -0300") References: <20250813130355.2236103-1-guinevere@redhat.com> <20250813202138.2311478-1-guinevere@redhat.com> X-Attribution: Tom Date: Thu, 14 Aug 2025 10:08:00 -0600 Message-ID: <87o6shnaxr.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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.110.68 X-Source-L: No X-Exim-ID: 1umaUj-00000001aQB-0vJx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net (bapiya) [97.122.110.68]:57384 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNShvVL4MWw3yShW5SCoit/NWtZbSlPtQaVD1nmfkHosf817EFazkYLAqX4DOpBrV6Abfy7D7MhRZH2JQIkuQ0p8dIk6Yu9KpLJSmYTZIh7GhmM7OvS8 kJG5YWLIKnx2wY2D/GRPYvaC5HjMGnrgeYz65YoYvdBHA/hV9rspoy5hw3Yyz4Fl31N7tP4yM0iT3l1g0SbhnDjDv7KrtOaWL8c= 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 >>>>> "Guinevere" == Guinevere Larsen writes: Guinevere> The convenience function get_frame_pc_if_available would take a pointer Guinevere> to a variable that should be set if available, and would return a Guinevere> boolean indicating whether that action was successful or not. Thanks. Guinevere> - if (!get_frame_pc_if_available (frame, &pc)) Guinevere> + if (!(pc = get_frame_pc_if_available (frame))) This is kind of cheating but in most spots in the patch it is cleaner than the alternative. So I'm inclined to let it slide. Guinevere> annotate_frame_begin (print_level ? frame_relative_level (frame) : 0, Guinevere> - gdbarch, pc); Guinevere> + gdbarch, (pc.has_value ()) ? *pc : 0); I think this can be written: pc.value_or (0). Ok with that change. Approved-By: Tom Tromey Tom