From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A7F703858D37 for ; Thu, 22 Feb 2024 17:27:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7F703858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 A7F703858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708622848; cv=none; b=Sb0liqXmsy0uu2YjEpx8gF99wURrzXvqfvXA/p8FHWA1vL9iVNe8n1GT9sxNDSlWhYHXrG3NOgg/nOTgrn9JOK70fBqXblHwZ+/v7wbJJQIEqWe4HkSien1NMPg5Gwrhz9NGpi3zH5x9gPxtNBUuwAUHUVMRVQMKzbJfOtZuExc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708622848; c=relaxed/simple; bh=prfHSKiAcmz4YyUJ2HqJfiWwyoOYuXeY86JfUQIW0nE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=npFF1oANIi34IqgNqiVFhWDWLL8fF3fTfl7jZHZh4b5dqmumLg+EWB6UWGRvFe4ymYpbzwFcmRcHC4E+4/bLiFwokhKiCxPhGlD5lX0V3ZVDaKXepaJxofhgZdVDISBPWKLyVBGVQKaSxsHxhXO+MmOm3FG9WoEXlQoLzvgG9TE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708622846; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OEXdM+XvRfaSHU81MK/PEv4T0aCh3jK48sXkm6YOhhk=; b=UDfP7eo1TBCbo6kQ/ArVlDghgeY4CbA/e0I5dF2EwtRBPsgYsEk7SoAjiYNv9IrIylQf3p NxPVREw1zKTJ1v3Pe0DLYFCs3BROV/h9SavywW7MMQv/HdkMz24cMr5ddwx70cA557ZfLw yB9Y8U3vDQCelBYboMqmQ9K1YabueqM= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-EwfxHORAN8GBMd906nVBBw-1; Thu, 22 Feb 2024 12:27:25 -0500 X-MC-Unique: EwfxHORAN8GBMd906nVBBw-1 Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-299220f4cb7so31167a91.0 for ; Thu, 22 Feb 2024 09:27:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708622844; x=1709227644; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OEXdM+XvRfaSHU81MK/PEv4T0aCh3jK48sXkm6YOhhk=; b=hMbvWYAE+Gb/YaJ9gOeXz2LxZIPh8Od5w9ev+X1Cx3RVA4J9MuLYDkYi7FtFD6hgal 7Ah9eDJzcX6BFMCyrQJjajR8lf+1C+AYGpzNmoJo7Yp8MvcFwxPkjpHAyV/np3pjeK90 X6TDAS1rmSJM8fHE8dPosGGNWDWaTp8ukmDzo3O1XgPbg1yGzJBQUv3cVBjB+rTE3CVa fP477dPpnnHriegfMrGa3LYXMR/SFquhCl4q1KyqNSEslpUSeGwNthDmjEp+L0LMMhww pCu/lUlPB6Woy+n80t1iplyTAwdBbs1PZpzTmjgy2MPuDQ0RRgaQPlPxsnkn0jFi7jWB nyjg== X-Forwarded-Encrypted: i=1; AJvYcCVkcVT++nvd2gQk8oKEMV/EJtiKJd4hffZXMWdDlhZ1VH6MQS5yJ3HOmyC5M5nZFHlnVC64YIA3cqp8eO6UrTiTvxaIJRSnSqhEJVXHYA== X-Gm-Message-State: AOJu0YzaxAf8AuTmsSMur1+h0YnZhxsBFk7Q2tTClpcI6lDjXQmu+7sE W5U8ZQn4h58O4qVB9/7r8A4NxpFb92uj+bI6jspY6XtgmpTKcFE/+ZoFqyV0LyETW4oDfHbnowv 2EvA2Ducfe0ndaoMJHH54HYiDAUYNijf/uc1H4GQ/+XDzC96zEWFQxS7FadMNxa4NgaeV53lniL rqrZF8TfeV2jiIZGp1PFqUq3KCvZNK8qA8dWiVWkMQopv+Gbk= X-Received: by 2002:a17:90a:c389:b0:29a:59e5:abfd with SMTP id h9-20020a17090ac38900b0029a59e5abfdmr1370952pjt.12.1708622844036; Thu, 22 Feb 2024 09:27:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiim8fnRhedoV4il3yvLMRzFAO4SEiffoNLj4oGd+Gqzwu9lIq/JmjfSdcfn3iduOK0/GyRmo9YK4RkHfd9TI= X-Received: by 2002:a17:90a:c389:b0:29a:59e5:abfd with SMTP id h9-20020a17090ac38900b0029a59e5abfdmr1370941pjt.12.1708622843726; Thu, 22 Feb 2024 09:27:23 -0800 (PST) MIME-Version: 1.0 References: <20231207013504.40300-3-amerey@redhat.com> <20231211231853.116254-1-amerey@redhat.com> <20240220222332.GB1666@gnu.wildebeest.org> <20240222153529.GG21278@redhat.com> In-Reply-To: <20240222153529.GG21278@redhat.com> From: Aaron Merey Date: Thu, 22 Feb 2024 12:27:12 -0500 Message-ID: Subject: Re: [PATCH v2] dwarf_getaranges: Build aranges list from CUs instead of .debug_aranges To: "Frank Ch. Eigler" Cc: Mark Wielaard , elfutils-devel@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Frank, On Thu, Feb 22, 2024 at 10:35=E2=80=AFAM Frank Ch. Eigler = wrote: > > > > We could then also introduce a new public function, dwarf_getdierange= s > > > (?) that does the new thing. But it doesn't have to be public on the > > > first try as long as dwarf_addrdie and dwfl_module_addrdie work. (We > > > might want to change the interface of dwarf_getdieranges so it can be > > > "lazy" for example.) > > > > Ok this approach seems like the most flexible. Users can have both > > .debug_aranges and CU-based aranges plus we don't have to change the > > semantics of dwarf_getaranges. [...] > > Another option is to generate the .debug_aranges automatically, but > only if it is absent from the input dwarf file. (An eu-readelf user > can tell if it was synthetic or not, if it matters.) I'd like to be able to do this but .debug_aranges might be incomplete even if the section is present in the input file. This would require us to parse CUs anyways in order to verify the section's completeness. I'll defer to David Blaikie [1] again: "consumers shouldn't rely on the presence of .debug_aranges, or them being complete (DWARF doesn't require/guarantee this - and Clang doesn't emit aranges by default, for instance). Each contribution to .debug_aranges says which CU it covers and any CUs not covered should be parsed/assumed to contain things covering other addresses." Aaron [1] https://sourceware.org/bugzilla/show_bug.cgi?id=3D22288#c5