From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4YAQIumf22rkkRAAWB0awg (envelope-from ) for ; Fri, 23 Oct 2026 13:56:57 -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=tmcHiC4j; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 73611378002; Fri, 23 Oct 2026 13:56:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, 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 CED971E007 for ; Fri, 23 Oct 2026 13:56:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F16B94BA23F0 for ; Fri, 23 Oct 2026 17:56:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F16B94BA23F0 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=tmcHiC4j Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 821904BA2E3C for ; Fri, 23 Oct 2026 17:56:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 821904BA2E3C 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 821904BA2E3C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792778189; cv=none; b=g3vFu/ObQffysCgChxUPcUHOsT+hG5KTHxjidXZ1Fq/8EmzN+ukNNPmwlDO6iVXXNmgmLp9MxkJ1xpSLNzJDqvV/FyjYKTwmkFln+YjOxMrocTfyyVm/XrrRG/x5XnLxQntcbcLy0I7IXmoUJOwdBzWGT0vg2m+1Ui3Qq29+nfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792778189; c=relaxed/simple; bh=i3rzgRBqoVzQXcH4q1DQMD/ViM0Y3CJOpPp7l3WcVc8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CgvjVGJcEKj3BW9GOp+w4Z61VpdH9EVIPf7pzhl6qvUcdyy3FcMXViz994kEB1l+fjbasygCymDeoypkiYRPeuGOjgufg7iSBX+spIrsPt9b0A96Q1TlgMZzsX/6oZxaPdjFvrg0AgTc78cyx0BiQw28MxbqdDB6/4+0AgojaJs= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=tmcHiC4j reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 821904BA2E3C Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id KFBbxHjpEJFmFKJVExqaCG; Fri, 23 Oct 2026 17:56:28 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id KJVExTZ9hP7wgKJVExxY7s; Fri, 23 Oct 2026 17:56:28 +0000 X-Authority-Analysis: v=2.4 cv=NMzV+16g c=1 sm=1 tr=0 ts=6adb9fcc a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=660iZSQnnn4A:10 a=ItBw4LHWJt0A:10 a=pGLkceISAAAA:8 a=-XXRsnpYKIsHvpYBa-EA:9 a=DCx65vhANUyCzuf5D8fC: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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qle2wphsdr8JUrdU9M0pvi/oLP+FkhNgTK3Iu4bsfAc=; b=tmcHiC4jkicc2bYoZF0Y7Ovcza 1yUIMoYSNW3ZY+nt+s1epmsoFGYcYIP0awo0RRqqIFzEUHBSOgRZKrSwgzxA4WcL5jZMO1wkEdJ7T juQgGxOrQGPM6sUQp09aIXkh9; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:43274 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xKJVD-00000002wQ3-3RtA; Fri, 23 Oct 2026 11:56:27 -0600 From: Tom Tromey To: Jielun Wu Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: Preserve the operand type in DW_OP_plus_uconst In-Reply-To: <20260811093420.3948263-1-firmiana402@gmail.com> (Jielun Wu's message of "Tue, 11 Aug 2026 17:34:20 +0800") References: <20260811093420.3948263-1-firmiana402@gmail.com> X-Attribution: Tom Date: Fri, 23 Oct 2026 11:56:26 -0600 Message-ID: <87tsmcqp11.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.129 X-Source-L: No X-Exim-ID: 1xKJVD-00000002wQ3-3RtA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:43274 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFAxZHWi+mJHOm/xqbZLtApLtLYfoAA/JIk9bTUMQUPoleeQ7+LFvY4j21sQV1NQEtlWcJkiTpqTAZWM2W77MC5HJtXTFxO5HcALLnw7eBmU7IApFd7r f0822LKC0d9Re/OkjMLT8GlE2VcFq+WBZBv0cpFrVOqbgZ0vmaJEVt5Ar6nPmMvzFwNNh6vKrtIkpzZccL3/T2s2/D3PkkJOAO0= 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 >>>>> Jielun Wu writes: > DWARF v5 requires DW_OP_plus_uconst to interpret its unsigned LEB128 > constant as the type of the popped stack entry and push a result of that > same type. GDB instead reconstructs the result using address_type, > discarding an explicit base type. > Construct the result using the popped value's type. Thank you for the patch. > + DW_AT_location { > + variable _constants > + variable _cu_label > + > + _op .byte $_constants(DW_OP_const_type) > + _op .uleb128 "$uint32_label - $_cu_label" \ > + "base type DIE offset" > + _op .byte 4 "constant size" > + _op .4byte 40 "constant data" > + DW_OP_plus_uconst 1 > + _op .byte $_constants(DW_OP_const_type) > + _op .uleb128 "$uint32_label - $_cu_label" \ > + "base type DIE offset" > + _op .byte 4 "constant size" > + _op .4byte 1 "constant data" I think it would be better to implement direct support for DW_OP_const_type in dwarf.exp and move this logic there. The new proc could require a label, which I think is already done in some cases, e.g., DW_OP_GNU_variable_value. thanks, Tom