From patchwork Mon Aug 17 09:38:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40271 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 957CC3858D37; Mon, 17 Aug 2020 09:38:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 957CC3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1597657110; bh=XhzrLY3Db8dkgu5jcCUn3kwIh/gTYVB8LyzxSA61CoY=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=wuqahHT+cArXKceYdL0p7U7xgo/Yd66euU/+UICVXH3N/wk1IFXHuuyRGuqyFy5sv TKTxkJIqyTtojtA3oCNPPRySL746XJpObeJZ95IWU8i4QAmcFrECuxr1HzAGb9dKxl VenQAfvjcAi8jCGK58yW4SNaDgqtOB7pECQQFhj4= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by sourceware.org (Postfix) with ESMTPS id 78DA13858D37 for ; Mon, 17 Aug 2020 09:38:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 78DA13858D37 Received: by mail-qk1-x749.google.com with SMTP id f18so10623174qke.0 for ; Mon, 17 Aug 2020 02:38:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=XhzrLY3Db8dkgu5jcCUn3kwIh/gTYVB8LyzxSA61CoY=; b=qQipste2mRubq1rZh6WwY8DPXsjc490MfhKfTxIRB1K7X4RF9BJQApJnJOUyJpUOJZ 9tAOIyRyZXFkVigMjcFXlIakIlrBr9XoCewMSwKppWyiouwzkUFBHqU3aeouScv3UIv1 5W+1Ag9jODhiN5yI15z3/WVxnAgQL1PrRXO1s6sJSuFPNdwE3BBkn3v3FAgYCeLp2Tj0 ftPZnpTOnZQT/Wu0TBIEi/Mi2Q37RDNOEAO+gSOKCmzrru/occl32GMMYwnXkP5Rpiup 86N9S2C9cAdq5/wfdouIWEF9mOm3VVyawSmTP1ciW6GLU55Z7jwbrRD4ivekjjlH0zXk 6YjA== X-Gm-Message-State: AOAM532HXB54FFl/BJRtlDnCt1stU5c8Y5qo5gf20nbFcpjpLgFg7Umj enJlWh9kMVgC9aI0TT2n6MUsBwOMYZ29I/LibUiIJloDVuKJr9Q3WXod6iVLmN5jGlqEzscVSwu k5uam3GQtMc6K4ssciDlSl2slbCfb1P1fmWk2NnGFvGBN5aOqkZJszkhYO7xTU1MQ4rPpIZI= X-Google-Smtp-Source: ABdhPJyRGg4vUpdanMCdCzElJow5xEMrubSs3ibf43lIZfeYmQXPkQsw9hDl72YgzAB6s1B7lEYkjuuwPb4D2g== X-Received: by 2002:a0c:f687:: with SMTP id p7mr13037421qvn.249.1597657106939; Mon, 17 Aug 2020 02:38:26 -0700 (PDT) Date: Mon, 17 Aug 2020 10:38:12 +0100 Message-Id: <20200817093819.172380-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog Subject: [PATCH 0/7] Suppression parsing - preparatory work To: libabigail@sourceware.org X-Spam-Status: No, score=-17.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Giuliano Procida via Libabigail From: Giuliano Procida Reply-To: Giuliano Procida Cc: kernel-team@android.com Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hi Dodji. Quite a while ago I had a series of patches with the aim of improving libabigail's suppression parsing with the main aims: * adding error handling and reporting * refactoring for easier maintenance (both fixes and features) Early on in the series, I changed the way regexes were parsed and passed in and out of the suppression specifications. This wasn't something you were happy with, so I shelved the series. I've taken a lttle time to remove those changes and rebase the series. My plan is to feed changes to you in digistible batches. This batch contains: * 2 commits that fix issues in an uncontroversial way * 3 commits to add the outer shell of error handling * 2 commits to simplify how suppressions are constructed The error handling commits do not add any error reporting but do add placeholder TODOs for where this could be added. The constructor change commits remove the non-default constructors for the 4 suppression types as they are antithetical to a table-driver parser where there are a large number of optional fields. If these constructors need to be preserved for other reasons, that can still be done. For (human) use, a better interface for building suppressions might be where setters can be chained (a.k.a. fluent interface) but that might not be your preference. Please take a fresh look at these. If you wanted to look ahead to what the end state could be, please see https://github.com/myxoid/libabigail/tree/suppression-parsing-revisited but note that the last few commits are not ready for consumption. Thank you, Giuliano. Giuliano Procida (7): Add missing newlines to end of test files. Fix two wrongs in test suppression regex Better suppression section parsing delegation. Add read_*_suppression success/failure plumbing. Add error handling to read_suppressions. Default construct suppression types. Refresh getter/setter comments. include/abg-suppression.h | 48 +- src/abg-suppression-priv.h | 28 +- src/abg-suppression.cc | 618 +++++++----------- src/abg-tools-utils.cc | 6 +- .../test-diff-suppr/test0-type-suppr-2.suppr | 2 +- .../test22-suppr-removed-var-sym-4.suppr | 2 +- .../test23-alias-filter-0.suppr | 2 +- .../test23-alias-filter-4.suppr | 2 +- .../test28-add-aliased-function-1.suppr | 2 +- .../test28-add-aliased-function-2.suppr | 2 +- .../test28-add-aliased-function-3.suppr | 2 +- .../test28-add-aliased-function-4.suppr | 2 +- .../test38-char-class-in-ini.abignore | 2 +- .../test41-enumerator-changes-0.suppr | 2 +- .../test-diff-suppr/test7-var-suppr-7.suppr | 2 +- .../test01-equal-in-property-string.abignore | 2 +- 16 files changed, 274 insertions(+), 450 deletions(-)