From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EW5YCF2VmWoOviUAWB0awg (envelope-from ) for ; Thu, 03 Sep 2026 11:42:21 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S3tHR+Ki; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B64041E166; Thu, 03 Sep 2026 11:42:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 53C9F1E033 for ; Thu, 03 Sep 2026 11:42:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 214F84B99F6A for ; Thu, 3 Sep 2026 15:42:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 214F84B99F6A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S3tHR+Ki Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4C3D34BA79B3 for ; Thu, 3 Sep 2026 15:41:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C3D34BA79B3 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4C3D34BA79B3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788450112; cv=none; b=N06AYg/eZlbgfSgLAx2wO/iGoD1jsiz7Mv7e/By/UNI/YLMmWeZg60vajkTGFW+IzqCNGI3Rtd2qnIbyNJcofDYhSc7hBm7tJXyMz21cyetNGjSRK/y5EL9Kr3KrU0MBY0ErvRZfcOYxuXoPvxgLmYFq7+ZG35X5kaH/NIVswEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788450112; c=relaxed/simple; bh=YVrv0XmumJCzCPanygEj4D0r/ON87wY2D/ocfmPu6qk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YcR/lmoCHFZBy9QWNSeQjuHu74d+biE2E8qztBz1MC2CxnFvD4mt9oHFna20gtIvOJn4b1xMpYkIGbFp1I/BzWCpFZYc5eToSdPiy3M4n03t6sQHSz3gKzPpNpNS/A6VplVWvsDp5OCHwbGomKC60Yt2jTHK7BFnp0J/YsmGKTg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S3tHR+Ki DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C3D34BA79B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788450111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gh1727JNxjAqEuopsG9avYDstlMdhMW3XOzUpMO6hg4=; b=S3tHR+KiyB1SQgyKLG7mNN/gIddF6qAUxHqEzDtjPXjDeacYyBYv2XVX5ySYzWYH3drZFN F+Q0U5ExWXYrtIqkpS8KqREsZPnTon6/xBYmWKeluXjnvitogptlV9aQNvEY7VYnQSlXUO Uwu5bEPc8ebOwZR+n8Pr1SuIESx0gj4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-354-tpHqeo7mNPK-Mmnug7ahiA-1; Thu, 03 Sep 2026 11:41:50 -0400 X-MC-Unique: tpHqeo7mNPK-Mmnug7ahiA-1 X-Mimecast-MFC-AGG-ID: tpHqeo7mNPK-Mmnug7ahiA_1788450109 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-495689bfcc8so92865e9.1 for ; Thu, 03 Sep 2026 08:41:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788450109; x=1789054909; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=gh1727JNxjAqEuopsG9avYDstlMdhMW3XOzUpMO6hg4=; b=kYQNOHOKqcqysGV1MViByjMqsdtcbnYZJSRSSQILkadiLNnDpMiUUG202NUtryATO6 lZ/Sh16m7qcCD1xBMPrSebkMchNbD8+l6ATjQDwbXvmWREcIN1B1FS2Ql3QupQRBs4i3 nmj/8WiPP6hH32IqOsKSOqARbrRq4ve/3lyON5x1Tfw0pLv3Ug5O3jo55cLeCpkSEcfT 0+bad78uLOIb6sfraUAZWidOgrTW5fSWxJO5ek/rEGNmfABmplyxLwZ65DQr8vEUjFW9 TtLXOdlW/Fu6t4UBXucnp4wSF0pniyxzHBuUAvMJ6eSPjpZbBaVqIoFZl9/hUeZ+p7dZ Mhig== X-Gm-Message-State: AFuF++mvHXNZgu5GxtDlZn/7rbyTNY3Y7Qjor5XBJRLK1u70U9XY0oFw 8TuA9rpZYydTWcPhoYXU5KslspZtMzd61LPkNiybyzBxuea0MJBUzbfRS7BGjylagHk1/kDhSYm gbybf/PRXZ7b9j69nV8HFjhdbHzLCaxgbqhJFIrnnmjZ084RtGmNP0O3VLIkQhlk= X-Gm-Gg: AYBFou2zuUn0xCSGVrsqXWyqhZ2wTJ0swIC2SFLzCijTPlaEnj3JDWmS1I7UOBE0HBc SaI6i6aDmnZgdEQcd7DhhQeR875iJVV8XPvXS6pRXBgI3PJ6uCX0oHrWk5r1WTn9K4hs64T3gkM mq0lqnbCtCEsytKmJWzrpngB3P4BHPTAk4mwFRWApkFDih5VqV59LVjAuuQMCkXvPrzp4qXZ/cQ tL2RqmUI0m3ImYcoH91qCgQ6OSLu0o/dvZUIJW8izkKJjPXS52GMicC2qegXz4mi777sdNLvltM xtUJaBUmx2YoS2Kh3KTEUtZePbl3+KBPZ9WgOZZAYelNw898tEk5FBjF9WNLKG/rOPVGBJKdien +8GkF8in7zuHXrAl8ltR3qylPX9Q= X-Received: by 2002:a05:600c:470d:b0:499:9240:9a1c with SMTP id 5b1f17b1804b1-49ce58363f8mr201174825e9.15.1788450108998; Thu, 03 Sep 2026 08:41:48 -0700 (PDT) X-Received: by 2002:a05:600c:470d:b0:499:9240:9a1c with SMTP id 5b1f17b1804b1-49ce58363f8mr201172965e9.15.1788450108070; Thu, 03 Sep 2026 08:41:48 -0700 (PDT) Received: from localhost (128.223.159.143.dyn.plus.net. [143.159.223.128]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49ce5927b68sm137324575e9.1.2026.09.03.08.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2026 08:41:46 -0700 (PDT) From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org, Tom de Vries Subject: Re: [PATCH] gdb: fixes for DW_OP_entry_value when inferior is at entry point In-Reply-To: <87y0dj4ga3.fsf@tromey.com> References: <87y0dj4ga3.fsf@tromey.com> Date: Thu, 03 Sep 2026 16:41:45 +0100 Message-ID: <87jyp2s5om.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wwTlBMuCF1yzbvP1nHVIRx_Dhph84naU_2QJKS347XQ_1788450109 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Tom Tromey writes: >>>>>> "Andrew" == Andrew Burgess writes: > > Andrew> This fixes some issues with DW_OP_entry_value which are discussed in > Andrew> PR gdb/34571. > > Thanks for doing this. > > Andrew> To understand the fix for this bug we need to first revisit the > Andrew> earlier commit that introduced the bug: > > Andrew> commit 1bafda2c4595f0f936a5845caf9667b70b198091 > Andrew> Date: Wed Apr 9 12:02:18 2025 +0200 > > Andrew> [gdb/symtab] Handle DW_OP_entry_value at function entry > > I appreciate the research and commentary as well. > > Looking at this code, I don't really follow why there's even such a > large special case for trivial_entry_value. It seems like the code > could be much simpler: when seeing a DW_OP_entry_value, evaluate the > entry value expression in the target frame -- either the parent frame, > or for the trivial_entry_value case, the current frame. > > That is, these special checks and calls to dwarf_block_to_dwarf_reg and > dwarf_block_to_dwarf_reg_deref (which to be clear predate the > trivial_entry_value patch) also seem totally unnecessary, as does this > restriction: > > error (_("DWARF-2 expression error: DW_OP_entry_value is " > "supported only for single DW_OP_reg* " > "or for DW_OP_breg*(0)+DW_OP_deref*")); > > That said, I don't think there's anything wrong with an improvement that > doesn't rewrite it all. And anyway maybe there's some subtlety I don't > understand. > > Approved-By: Tom Tromey Thanks Tom. I pushed this patch to master and gdb-18-branch. I also have a follow on patch which is in testing now, that refactors this code inline with your suggestion above. I decided to push the first patch as the change here is smaller, and especially for the gdb-18-branch, it seemed lower risk. The refactor, once I post it, would only be for master. Thanks, Andrew