From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 1E8C13858407 for ; Wed, 10 Nov 2021 13:40:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E8C13858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 72566302FBAB; Wed, 10 Nov 2021 14:40:48 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 3CCCC413CC9A; Wed, 10 Nov 2021 14:40:47 +0100 (CET) Message-ID: <7fa8905bc363fbb5536ce8f61278cddc23107ccb.camel@klomp.org> Subject: Re: dwarf_aggregate_size doesn't work with arrays in partial CUs From: Mark Wielaard To: KJ Tsanaktsidis Cc: elfutils-devel@sourceware.org Date: Wed, 10 Nov 2021 14:40:47 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 13:40:54 -0000 Hi KJ, On Sun, 2021-10-03 at 16:05 +1100, KJ Tsanaktsidis via Elfutils-devel wrote: > I guess we don't want to hide some really expensive traversal > operation inside a simple call to dwarf_aggregate_size, no... >=20 > What if we instead provide a way for the user to specify what > language > a CU is? Like "dwarf_cu_report_language(Dwarf_Die *cu, int lang)". > That would get saved with the (partial) CU, and dwarf_srclang could > retrieve this information (if DW_AT_language isn't set). Then, the > user could recursively traverse all CUs and call > dwarf_cu_report_language on each partial CU. And as a bonus, we could > even wrap that up in dwarf_cu_traverse_partial_cu_set_language or > something (OK, the name needs a bit of workshopping). >=20 > That way, the expensive thing is in a separate call that's marked as > being very expensive (and cached, so it only needs to be done once). > Sound like a reasonable approach? Sorry for forgetting about this discussion. I do think the above makes sense. I opened a bug to track this: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28578 Cheers, Mark