From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NMOrIzW1iWDSMAAAWB0awg (envelope-from ) for ; Wed, 28 Apr 2021 15:19:17 -0400 Received: by simark.ca (Postfix, from userid 112) id 82F761F11C; Wed, 28 Apr 2021 15:19:17 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E5B681E54D for ; Wed, 28 Apr 2021 15:19:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E16D393D025; Wed, 28 Apr 2021 19:19:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E16D393D025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619637556; bh=DbPcqie35cKgjOjQBRsDLYEcWzcjvB+Obl80z03pBFU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NXrDU+mNZqK1PYUJSJu8Qa1f4oXOQkwjSvYHHHvhH/eKO5pX0J2iUmF1IK4b8lMeI 1+GkKUIoZUHvBYinkz7gQdRkfO6KN4gA3/bbPjEby9l5Te3Zk88NDIwln9XSUyEhAT Z+lKd5iSr4PGb7QKyjEPrSEqo6WGy09d1BOrH4W0= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 0C52A3857C48 for ; Wed, 28 Apr 2021 19:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0C52A3857C48 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 13SJJ7WT024196 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Apr 2021 15:19:12 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 13SJJ7WT024196 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 827A61E54D; Wed, 28 Apr 2021 15:19:07 -0400 (EDT) Subject: Re: [PATCH 16/43] Simplify dwarf_expr_context class interface To: Zoran Zaric , gdb-patches@sourceware.org References: <20210301144620.103016-1-Zoran.Zaric@amd.com> <20210301144620.103016-17-Zoran.Zaric@amd.com> <94a19b5a-1e38-53af-8b96-956f138f8303@polymtl.ca> Message-ID: Date: Wed, 28 Apr 2021 15:19:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 28 Apr 2021 19:19:07 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-28 11:39 a.m., Zoran Zaric wrote:> >>> >>> This was more me venting about that particular design choice >> >> Haha, it indeed did feel this way. >> >>> because the reality is that an address size has to be consistent with what is defined in the original object file but there is no interface to always get it in a clean way in gdb. >> >> In this case, it looks like it's because an expression can come from a >> DIE attribute, directly linked to a CU. So the address size comes from >> that CU's header. And at other times, the expression comes from a frame >> description entry (FDE) / common information entry (CIE), so the address >> size comes from that CIE's header. So I don't see any other easy way than >> making the caller provide it. >> >>> It makes sense for me to remove that comment altogether in the next iteration and thing about a future change that would clean it up. >> >> Ok. Or, just make a simple comment. You could say that ADDRESS_SIZE is >> the address size coming from the CU's header or the CIE's header, >> depending on the context. > > Right, but all these sources come from a single object file and by the standard they all need to be consistent, otherwise things couldn't really work. > >> >> Anyway, this is all perhaps subject to change if I understand correctly. >> In the end do you still expose a class, or just one function, to >> evaluate a DWARF expression? >> >> Simon >> > > Right, and ideally, because the per_objfile always has to be present, it would make sense that it also contains the address size information that should get it from any header that is present in that objfile and if there are more then one, they should all be consistent. > > Does this makes sense? Yeah, I suppose. In DWARF5, it says that about the address_size field of the CIE header: If a compilation unit exists for this frame, its address size must match the address size here. In any case, It's not a big problem for now I think to pass in the address size. Simon