From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by sourceware.org (Postfix) with ESMTPS id 6A6C0389838B for ; Thu, 6 Oct 2022 14:12:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A6C0389838B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodj@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id A85DAE0005; Thu, 6 Oct 2022 14:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seketeli.org; s=gm1; t=1665065571; 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=W4/1F2Z6JTdAmr9hk5tdsBuNyAGEP2A7fc/6jrCH2FM=; b=Xq3ZPP6HaqqemrZGHoiJ/QBB6BxhSPrnkVgBKKASO5AuFjc+k/9IA+CSFA/IxP99IqT0tN 7sjdLEdLTnheup6HtpAXfVrshXrDiOs/BXFRSM0enrR2VZ73UFNrH6nAePptT9h7kX15Pn Y4ftGoH9yiiiyGbELK+pO9HPwQXtBRKfajX4rAxSFzbg25IMaLP+vFKInNmdzKvH4/gPCN tzAiugOebygwutmCayDVKG/cXhXsf5HRjhkqRvfSQ7eT+VbkQf3O2nLBe8LqAvAAv5u/p4 i4bwK1aoI0rOct/TKc+bzGKgfoI5XWtA2KwxBsnHqagXFD/4Z/JyH2Q6+2mUdw== Received: by localhost (Postfix, from userid 1001) id A05ED1A0546; Thu, 6 Oct 2022 16:12:49 +0200 (CEST) From: Dodji Seketeli To: "Guillermo E. Martinez" Cc: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH] CTF as a fallback when no DWARF debug info is present Organization: Me, myself and I References: <20221001001544.210234-1-guillermo.e.martinez@oracle.com> <877d1g2c52.fsf@seketeli.org> <568fe730-3bb9-0267-00bc-2873e94e502f@oracle.com> <86mta9bdpm.fsf@seketeli.org> X-Operating-System: Red Hat Enterprise Linux Server 7.9 X-URL: http://www.seketeli.net/~dodji Date: Thu, 06 Oct 2022 16:12:49 +0200 In-Reply-To: <86mta9bdpm.fsf@seketeli.org> (Dodji Seketeli's message of "Thu, 06 Oct 2022 09:42:13 +0200") Message-ID: <86h70havmm.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP 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: Hey again Guillermo, So, even before you sent the patch, I was "playing" with the idea of re-organizing the code of the readers to make front-ends/readers be first class citizens in libabigail. The idea is to have all the front-ends share/implement an abstract interface: the Front End Interface, named abigail::fe_iface. So there would be abigail::elf_reader::reader, abigail::dwarf_reader::reader and abigail::ctf_reader::reader and abigtail::abixml_reader::reader front-ends, all implementing the abigail::fe_iface. They would all have to grok their intended input, build the IR as a result and pass it to the middle-end. Most of the craft of analyzing the ELF part would be of course in located in the abigail::elf_reader::reader type. The abigail::{dwarf,ctf}_reader::reader types would just have to use the elf_reader::reader type to handle ELF stuff. An example of what that would look like is in the "users/dodji/front-end" branch at https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/users/dodji/front-end. The interface of the new elf-reader type is at https://sourceware.org/git/?p=libabigail.git;a=blob;f=include/abg-elf-reader.h;hb=refs/heads/users/dodji/front-end. The abigail::fe_iface interface it implements is at https://sourceware.org/git/?p=libabigail.git;a=blob;f=include/abg-fe-iface.h;hb=refs/heads/users/dodji/front-end. It's not yet documented, but after the discussion we had on your patch, I tried to implement a helper function abigail::tools_utils::file_has_dwarf_debug_info() using the new abigail::elf_reader::reader type. You can see it at https://sourceware.org/git/?p=libabigail.git;a=blob;f=src/abg-tools-utils.cc;hb=refs/heads/users/dodji/front-end#l423 So, that function file_has_dwarf_debug_info() can be used to determine if an ELF file has debug info (even taking into account split debug information). Based on that information, the tool could chose the right front-end to use. This is still work-in-progress, but the branch passes "make distcheck", for what it's worth. If you are interested, maybe you could base the subsequent versions of your patch on this branch? What do you think? In any case, I'll keep exploring this topic on that branch and I'll send a message to the list a bit later to present it a little bit further. Cheers, -- Dodji