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.129.124]) by sourceware.org (Postfix) with ESMTPS id 00C5C3856DD3 for ; Tue, 25 Oct 2022 15:13:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 00C5C3856DD3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666710780; 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; bh=y7JW38EgiXHvvUwVNTbSW0lPyKNU+nBCPf3l3y1n4C8=; b=PiyV2/RQrU/IvuBL9TK+IisOOgGyzZCq0dB9PVGaA5kayKaQueBX58hYeSztwXJElbeYF5 OFSGrfwo4X7NeGBlAUC9rUEb5YnCzfbvwZiPFcA4d1g2LO4b+9Kh0BzWaSSHnIaqYa6RzP owgT7xkZB03HBjJVZ0eOrUHiiGAxFek= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-587-UlqBsJ3tO1iSdC_0-otC2A-1; Tue, 25 Oct 2022 11:12:58 -0400 X-MC-Unique: UlqBsJ3tO1iSdC_0-otC2A-1 Received: by mail-qv1-f70.google.com with SMTP id l6-20020ad44446000000b004bb60364075so4087834qvt.13 for ; Tue, 25 Oct 2022 08:12:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y7JW38EgiXHvvUwVNTbSW0lPyKNU+nBCPf3l3y1n4C8=; b=kZHUcbJpvBR4kRi8W71QvHMWBl1e9FcCteCh3qmoklRbTMSRC5tixFWX21s9gBNZps p0qi7fnPQxznSi2Vi5OZpjwfFI+FIRC+1Up3gOJGM0TmSayZUtPl38qFfwe4ka2VzW6P xpRUlRjt7ZFOlQRWUwEd1KnbRg/LsndGUrwPPim6udoXqmCYeJ9Ux+V6gAP7AuPgthkf N5ciJKEl+fOQsaiqw+azn+wansm2M9w4Yec30Bn2bUyK3ligBlZEDDlgKUBMKutx2iu4 95WTk5z3k0GOWRt747NstpqOBvYjOQIB9zYmHf4lPfbj3jXcvyEODIlOqpwC2JWRs4+l Z+lw== X-Gm-Message-State: ACrzQf2Azq9WFptJ6ye6k3YpqUCzPJnYTyYgy6c9+AA/9HHMzaQ6oGPQ Z8nUljZmimzZHVBMM0sTN0Cg2B0ck1L1meOYPPho2vM7BAnM4sNzGnBk3qraf97XpsZJLEwa41u ZyanAtmbm7tsfiHhsU3mO X-Received: by 2002:a05:6214:2487:b0:4af:a6f9:ace3 with SMTP id gi7-20020a056214248700b004afa6f9ace3mr32084559qvb.78.1666710777573; Tue, 25 Oct 2022 08:12:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4gOToB8MR6fpJj03UdVbPlqi78DBwm7zXGmRLQyzuhe5d0cYT7EodK7T+fKq79xGAzY6KXQA== X-Received: by 2002:a05:6214:2487:b0:4af:a6f9:ace3 with SMTP id gi7-20020a056214248700b004afa6f9ace3mr32084540qvb.78.1666710777336; Tue, 25 Oct 2022 08:12:57 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id k1-20020a05620a142100b006ee949b8051sm2135920qkj.51.2022.10.25.08.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 08:12:56 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id A40D2581C59; Tue, 25 Oct 2022 17:12:53 +0200 (CEST) From: Dodji Seketeli To: "Guillermo E. Martinez" , "Jose E. Marchesi" Cc: libabigail@sourceware.org Subject: [PATCH 0/1] Make front-ends be first class in the libabigail framework Organization: Red Hat / France X-Operating-System: Fedora 38 X-URL: http://www.redhat.com Date: Tue, 25 Oct 2022 17:12:53 +0200 Message-ID: <87lep4os22.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.9 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_H2,SPF_HELO_NONE,SPF_NONE,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: Hello, I have been exploring the idea of making front-ends in libabigail be first class citizens. The goal of this change is twofold: First, it's to improve the integration and maintenance of the new CTF front-end in the libabigail framework. Today, the code of the CTF front-end is guarded by #ifdef WITH_CTF pre-processor macro invocations. Ideally, the amount code guarded by that macro should be minimal (and ideally be zero in the future), especially in the libabigail tools (abidw, abidiff, abipkgdiff, etc) that use the library. Second, it's to allow and ease the inclusion new front-ends in the future, for instance, to support other ELF-based debug info formats. The idea is to provide new abstractions in the libabigail framework to represent a front-end and to share code between similar front-ends. For instance, front-ends that are ELF-based (DWARF/CTF) would share the code to access generic ELF properties. Tools would thus be better equipped to analyze a binary and depending on its kind, instantiate the appropriate front-end for its ABI analysis and use it accordingly. This thread contains the change proposal to implement this "feature". Note that the change is implemented in a single patch as all the changes are quite intermingled, to be honest. In any case, the change can be access from the Git repository in the "front-end" branch, which can be browsed from https://sourceware.org/git/?p=libabigail.git;a=shortlog;h=refs/heads/users/dodji/front-end Please, find the summary log of the change below. Dodji Seketeli (1): Make Front Ends first class citizens include/Makefile.am | 4 +- include/abg-corpus.h | 18 +- include/abg-ctf-reader.h | 33 +- include/abg-dwarf-reader.h | 124 +- include/abg-elf-based-reader.h | 63 + include/abg-elf-reader-common.h | 70 - include/abg-elf-reader.h | 155 + include/abg-fe-iface.h | 166 + include/abg-fwd.h | 2 +- include/abg-ir.h | 156 +- include/abg-reader.h | 62 +- include/abg-suppression.h | 67 + include/abg-tools-utils.h | 13 +- include/abg-writer.h | 2 +- src/Makefile.am | 4 +- src/abg-comparison.cc | 67 +- src/abg-corpus-priv.h | 18 +- src/abg-corpus.cc | 73 +- src/abg-ctf-reader.cc | 1545 ++++---- src/abg-dwarf-reader.cc | 3849 +++++++------------- src/abg-elf-based-reader.cc | 102 + src/abg-elf-helpers.cc | 183 +- src/abg-elf-helpers.h | 38 + src/abg-elf-reader-common.cc | 90 - src/abg-elf-reader.cc | 890 +++++ src/abg-fe-iface.cc | 411 +++ src/abg-ir-priv.h | 57 +- src/abg-ir.cc | 817 ++--- src/abg-reader.cc | 1974 +++++----- src/abg-suppression-priv.h | 179 - src/abg-suppression.cc | 479 ++- src/abg-symtab-reader.cc | 5 +- src/abg-symtab-reader.h | 6 +- src/abg-tools-utils.cc | 163 +- src/abg-writer.cc | 39 +- tests/data/test-read-ctf/test0.abi | 3 + tests/data/test-read-ctf/test0.hash.abi | 3 + tests/data/test-read-ctf/test1.so.abi | 3 + tests/data/test-read-ctf/test1.so.hash.abi | 3 + tests/data/test-read-ctf/test2.so.abi | 3 + tests/data/test-read-ctf/test2.so.hash.abi | 3 + tests/data/test-read-ctf/test3.so.abi | 5 +- tests/data/test-read-ctf/test3.so.hash.abi | 5 +- tests/data/test-read-ctf/test4.so.abi | 3 + tests/data/test-read-ctf/test4.so.hash.abi | 3 + tests/print-diff-tree.cc | 12 +- tests/test-abidiff.cc | 24 +- tests/test-diff-dwarf.cc | 20 +- tests/test-ir-walker.cc | 7 +- tests/test-read-ctf.cc | 20 +- tests/test-read-dwarf.cc | 3 - tests/test-read-write.cc | 3 - tests/test-symtab.cc | 42 +- tools/Makefile.am | 13 +- tools/abicompat.cc | 63 +- tools/abidiff.cc | 222 +- tools/abidw.cc | 178 +- tools/abilint.cc | 128 +- tools/abipkgdiff.cc | 222 +- tools/abisym.cc | 5 +- tools/kmidiff.cc | 14 +- 61 files changed, 6365 insertions(+), 6569 deletions(-) create mode 100644 include/abg-elf-based-reader.h delete mode 100644 include/abg-elf-reader-common.h create mode 100644 include/abg-elf-reader.h create mode 100644 include/abg-fe-iface.h create mode 100644 src/abg-elf-based-reader.cc delete mode 100644 src/abg-elf-reader-common.cc create mode 100644 src/abg-elf-reader.cc create mode 100644 src/abg-fe-iface.cc -- 2.38.0 -- Dodji