From patchwork Fri Oct 20 09:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78212 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 DEC633858C50 for ; Fri, 20 Oct 2023 09:57:28 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 835D63858D20 for ; Fri, 20 Oct 2023 09:57:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 835D63858D20 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 835D63858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795845; cv=none; b=INrm3LK5a0zEQcckGpH6Eyx7uX+9wAqKt57gCrHdAZZxr7zymrhfHcH5YH+9lUNtv5dbcb6SZ0V09c3x9QOn+Ar839D6xb7mQsMCdRY2pnVyPUbff9tCEE4oDBAGO6hqeylEwMng0IcE+97W54BFWsjithT+7qNsd2cK2ODZgNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795845; c=relaxed/simple; bh=f/jRKtVN2i1TkRI4rQHMd7rkdoh1xKZsoWfZ4ltDWoo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AaghGKR23nYaNmwOAwC5JkDWts3iEQNnTCcHL6TdxC2vksQoVckGEVx9+r1tfXxDCTKu8CnLeSP9owUCCy/bOPelCblj4VqY8QqxGorlhdo9euLDieSaa5fTgy9pwfmf2WNAHAiBv5WfQOe/+86ORCCV7RSQV6YmC6nh6haM7xY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697795841; 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=mKLruix1ZAnoRXv7F/gQZkmQMpOAloHtJ1IVCkgk2hc=; b=OQv3L3RMxyId0CUn6D45k5mji1unuyjXzdvkEQDBQk+HMnQ5wvhfnCW6DyS9vKgnWuvqLd M2SEectkAGs/TVs+kLbEnwat42jdJNdCJ/758yGNqSUL9Zm328+I7KSTA2yyJbtsAMQxPK uRPnrbAEwJdeUDuTtbNPL4LHvwfD9TE= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-P8iah98SNYqBmQ2kQKiqoQ-1; Fri, 20 Oct 2023 05:57:19 -0400 X-MC-Unique: P8iah98SNYqBmQ2kQKiqoQ-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-65afd7515aaso8549636d6.0 for ; Fri, 20 Oct 2023 02:57:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697795839; x=1698400639; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mKLruix1ZAnoRXv7F/gQZkmQMpOAloHtJ1IVCkgk2hc=; b=FO1zsMlCYQbo33b6zt/j6j52gCqxUFYaDOnuo30OnZWWP/wvFBVJXCoLxQ7mF1Fh37 vkwEuJGIO9+ktXpsZ3PeoCpVwaTuSL5g7VtERnddQR+hnd4zd1Oe5yW2mpg5D0lMYwqU esx9XsEPoMbIpZr2cLs3dnth015UPlBbusKBPRXqhY1h1Wna3WJ3Ec5WmFZZBnN1c2rT /tvzyGJ+gIaFG29u5ZgnYU7AD/3cATHLl6gnRpJHlpxr29PvRGHPY+d8zEm35KbsJAqT PTWkNWOhBFsc6+P/RlUmn9fZbHGbKd3an9dfxEqQntkynvjR0ykiE9a3oCOyy6QQgavC jHNA== X-Gm-Message-State: AOJu0YxZlEPNlttVisbZWaIJnELE2X40BoBq3G+ZY+KAMbB0ablMaMpU oPyKnB50GQVniMAhavhm2nici1eeGZc2GSU+OYF1tc3nu1Yn3fIyrB82P4h2lmBelegz442edXv CRyyufFdLUS8CE07YXJjl X-Received: by 2002:a05:6214:da2:b0:66d:5b9:927a with SMTP id h2-20020a0562140da200b0066d05b9927amr1970530qvh.54.1697795838748; Fri, 20 Oct 2023 02:57:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHjDh9AsSKE+jJVHyOvJW78emEXdFNlrhT7Yod2lPLj5vBqKOhmJ8L2gOkD4UXpwE6SMWgmw== X-Received: by 2002:a05:6214:da2:b0:66d:5b9:927a with SMTP id h2-20020a0562140da200b0066d05b9927amr1970509qvh.54.1697795838300; Fri, 20 Oct 2023 02:57:18 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id i9-20020ac85c09000000b0041cb787ff41sm468279qti.67.2023.10.20.02.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:57:17 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 5023F5077C49; Fri, 20 Oct 2023 11:57:15 +0200 (CEST) From: Dodji Seketeli To: John Moon Cc: Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org, dodji@redhat.com Subject: [PATCH 1/7, applied] suppression: Add "changed_enumerators_regexp" property Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 11:57:15 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <878r7x7h1g.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Currently, users are able to suppress changes to enumerator variants matching names specified in "changed_enumerators", but can't specify regular expressions. A common pattern when using enums is to have the final enum variant labeled as "*_MAX" or "*_LAST" so that users of the enum can have a way to determine how many variants there are. In these cases, when expanding an enum, the last variant will change, but that's an expected result that users may not want to flag as an ABI-breaking change. For example, if you have a change like this: enum foo { FOO, BAR, FOOBAR_MAX, }; ... enum foo { FOO, BAR, BAZ, FOOBAR_MAX, }; abidiff reports: 1 changed type unreachable from any public interface: [C] 'enum foo' changed: type size hasn't changed 1 enumerator insertion: 'foo::BAZ' value '2' 1 enumerator change: 'foo::FOOBAR_MAX' from value '2' to '3' at test_2.c:1:1 With a new changed_enumerators_regexp property, users can specify a suppression which stops abidiff from emitting this diff for any members which match the regular expressions in the list: [suppress_type] type_kind = enum changed_enumerators_regexp = .*_MAX$, .*_LAST$, .*_NUM$, .*_NBITS$ * include/abg-suppression.h (type_suppression::{g,s}et_changed_enumerators_regexp): Declare new accessor functions. * src/abg-suppression-priv.h (type_suppression::priv::changed_enumerators_regexp_): Define new data member. * src/abg-suppression.cc (type_suppression::{g,s}et_changed_enumerators_regexp): Define new accessor function. (type_suppression::suppresses_diff): For a type suppression to match an enum_diff, the names of all changed enumerators must match either the names returned by type_suppression::get_changed_enumerator_names or one of the regexps returned by the new member function type_suppression::get_changed_enumerators_regexp. (read_type_suppression): Parse the new 'changed_enumerators_regexp' property to set the type_suppression::get_changed_enumerators_regexp property. * doc/manuals/libabigail-concepts.rst: Add an entry for the new 'changed_enumerators_regexp' property. * tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-[1-5].suppr: Add new test suppression files. * tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-[0-5].txt: Add new test reference output files. * tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v{0,1}.c: Add source code for new binary test input files. * tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v{0,1}.o: Add new binary test input files. * tests/data/Makefile.am: Add the new test files to the source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input files to this test harness. Signed-off-by: John Moon Signed-off-by: Dodji Seketeli Applied to master. --- doc/manuals/libabigail-concepts.rst | 25 ++++++ include/abg-suppression.h | 6 ++ src/abg-suppression-priv.h | 1 + src/abg-suppression.cc | 84 +++++++++++++++--- tests/data/Makefile.am | 15 ++++ ...merator-changes-enumerator-changes-1.suppr | 3 + ...merator-changes-enumerator-changes-2.suppr | 3 + ...merator-changes-enumerator-changes-3.suppr | 3 + ...merator-changes-enumerator-changes-4.suppr | 3 + ...merator-changes-enumerator-changes-5.suppr | 3 + ...or-changes-enumerator-changes-report-0.txt | 29 ++++++ ...or-changes-enumerator-changes-report-1.txt | 21 +++++ ...or-changes-enumerator-changes-report-2.txt | 21 +++++ ...or-changes-enumerator-changes-report-3.txt | 13 +++ ...or-changes-enumerator-changes-report-4.txt | 21 +++++ ...or-changes-enumerator-changes-report-5.txt | 3 + ...enumerator-changes-enumerator-changes-v0.c | 37 ++++++++ ...enumerator-changes-enumerator-changes-v0.o | Bin 0 -> 3944 bytes ...enumerator-changes-enumerator-changes-v1.c | 40 +++++++++ ...enumerator-changes-enumerator-changes-v1.o | Bin 0 -> 4064 bytes tests/test-diff-suppr.cc | 60 +++++++++++++ 21 files changed, 381 insertions(+), 10 deletions(-) create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.c create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o new file mode 100644 index 00000000..e7f1bcc7 index 1a06e043..8c9ad070 100644 diff --git a/doc/manuals/libabigail-concepts.rst b/doc/manuals/libabigail-concepts.rst index f64f5229..324c5162 100644 --- a/doc/manuals/libabigail-concepts.rst +++ b/doc/manuals/libabigail-concepts.rst @@ -353,6 +353,31 @@ The potential properties of this sections are listed below: changed_enumerators = LAST_ENUMERATORS0, LAST_ENUMERATOR1 +.. _suppr_changed_enumerators_regexp_label: + +* ``changed_enumerators_regexp`` + + Usage: + + ``changed_enumerators_regexp`` ``=`` + + Suppresses change reports involving changes in the value of + enumerators of a given enum type. This property is applied if the + ``type_kind`` property is set to the value ``enum``, at least. The + value of the ``changed_enumerators_regexp`` property is a + comma-separated list of regular expressions that should match the + names of the enumerators that the user expects to change. For + instance: :: + + changed_enumerators_regexp = .*_MAX$, .*_LAST$, .*_NUM$, .*_NBITS$ + + In the example above, change reports to any enumerator which name + ends with _MAX, _LAST, _NUM or _NBITS will be suppressed. + + Note that for this property to be applied to changes to an enum + type, the size of the enum type must *NOT* have changed. + + * ``drop`` Usage: diff --git a/include/abg-suppression.h b/include/abg-suppression.h index 6b62f64d..cbb16207 100644 --- a/include/abg-suppression.h +++ b/include/abg-suppression.h @@ -330,6 +330,12 @@ public: void set_changed_enumerator_names(const vector&); + const vector& + get_changed_enumerators_regexp() const; + + void + set_changed_enumerators_regexp(const vector&); + virtual bool suppresses_diff(const diff* diff) const; diff --git a/src/abg-suppression-priv.h b/src/abg-suppression-priv.h index cf66a9f1..351c5965 100644 --- a/src/abg-suppression-priv.h +++ b/src/abg-suppression-priv.h @@ -585,6 +585,7 @@ class type_suppression::priv string source_location_to_keep_regex_str_; mutable regex::regex_t_sptr source_location_to_keep_regex_; mutable vector changed_enumerator_names_; + mutable vector changed_enumerators_regexp_; priv(); diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index 7053e728..f8d065f6 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -770,6 +770,28 @@ void type_suppression::set_changed_enumerator_names(const vector& n) {priv_->changed_enumerator_names_ = n;} +/// Getter of the vector of the regular expression strings for changed +/// enumerators that are supposed to be suppressed. Note that this +/// will be "valid" only if the type suppression has the +/// 'type_kind = enum' property. +/// +/// @return the vector of the regular expression strings that are +/// supposed to match enumertor names to be suppressed. +const vector& +type_suppression::get_changed_enumerators_regexp() const +{return priv_->changed_enumerators_regexp_;} + +/// Setter of the vector of the regular expression strings for changed +/// enumerators that are supposed to be suppressed. Note that this +/// will be "valid" only if the type suppression has the +/// 'type_kind = enum' property. +/// +/// @param n the vector of the regular expression strings that are +/// supposed to match enumertor names to be suppressed. +void +type_suppression::set_changed_enumerators_regexp(const vector& n) +{priv_->changed_enumerators_regexp_ = n;} + /// Evaluate this suppression specification on a given diff node and /// say if the diff node should be suppressed or not. /// @@ -1002,9 +1024,12 @@ type_suppression::suppresses_diff(const diff* diff) const // ... and yet carries some changed enumerators! && !enum_dif->changed_enumerators().empty()) { - // Make sure that all changed enumerators are listed in the - // vector of enumerator names returned by the - // get_changed_enumerator_names() member function. + + // Make sure that all changed enumerators are either: + // 1. listed in the vector of enumerator names returned + // by the get_changed_enumerator_names() member function + // 2. match a regular expression returned by the + // get_changed_enumerators_regexp() member function bool matched = true; for (string_changed_enumerator_map::const_iterator i = enum_dif->changed_enumerators().begin(); @@ -1012,13 +1037,20 @@ type_suppression::suppresses_diff(const diff* diff) const ++i) { matched &= true; - if (std::find(get_changed_enumerator_names().begin(), - get_changed_enumerator_names().end(), - i->first) == get_changed_enumerator_names().end()) - { - matched &= false; - break; - } + if ((std::find(get_changed_enumerator_names().begin(), + get_changed_enumerator_names().end(), + i->first) == get_changed_enumerator_names().end()) + && + (std::find_if(get_changed_enumerators_regexp().begin(), + get_changed_enumerators_regexp().end(), + [&] (const regex_t_sptr& enum_regexp) + { + return regex::match(enum_regexp, i->first); + }) == get_changed_enumerators_regexp().end())) + { + matched &= false; + break; + } } if (!matched) return false; @@ -2162,6 +2194,34 @@ read_type_suppression(const ini::config::section& section) changed_enumerator_names.push_back(p->get_value()->as_string()); } + /// Support 'changed_enumerators_regexp = .*_foo, bar_[0-9]+, baz' + /// + /// If the current type is an enum and if it carries changed + /// enumerators that match regular expressions listed in the + /// changed_enumerators_regexp property value then it should be + /// suppressed. + + ini::property_sptr changed_enumerators_regexp_prop = + section.find_property("changed_enumerators_regexp"); + + vector changed_enumerators_regexp; + if (changed_enumerators_regexp_prop) + { + if (ini::list_property_sptr p = + is_list_property(changed_enumerators_regexp_prop)) + { + for (string e : p->get_value()->get_content()) + changed_enumerators_regexp.push_back(regex::compile(e)); + } + else if (ini::simple_property_sptr p = + is_simple_property(changed_enumerators_regexp_prop)) + { + changed_enumerators_regexp.push_back( + regex::compile(p->get_value()->as_string()) + ); + } + } + if (section.get_name() == "suppress_type") result.reset(new type_suppression(label_str, name_regex_str, name_str)); else if (section.get_name() == "allow_type") @@ -2225,6 +2285,10 @@ read_type_suppression(const ini::config::section& section) && !changed_enumerator_names.empty()) result->set_changed_enumerator_names(changed_enumerator_names); + if (result->get_type_kind() == type_suppression::ENUM_TYPE_KIND + && !changed_enumerators_regexp.empty()) + result->set_changed_enumerators_regexp(changed_enumerators_regexp); + return result; } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d1c767b3..1aa37b16 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -1760,6 +1760,21 @@ test-diff-suppr/test39-public-headers-dir/test39-header-v0.h \ test-diff-suppr/test39-public-headers-dir/test39-header-v1.h \ test-diff-suppr/libtest40-enumerator-changes-v0.so \ test-diff-suppr/libtest40-enumerator-changes-v1.so \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.c \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o \ +test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o \ test-diff-suppr/libtest41-enumerator-changes-v0.so \ test-diff-suppr/libtest41-enumerator-changes-v1.so \ test-diff-suppr/test40-enumerator-changes-0.suppr \ diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr new file mode 100644 index 00000000..cbe76ab8 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = enum + changed_enumerators_regexp = ^.*_LAST$ diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr new file mode 100644 index 00000000..0ab63c10 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = enum + changed_enumerators_regexp = ^.*_MAX$ diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr new file mode 100644 index 00000000..e8bb9117 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = enum + changed_enumerators_regexp = ^.*_LAST$, ^.*_MAX$ \ No newline at end of file diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr new file mode 100644 index 00000000..492dd336 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = enum + changed_enumerators_regexp = ^LAST_.*$ \ No newline at end of file diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr new file mode 100644 index 00000000..3ee5d407 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = enum + changed_enumerators_regexp = ^.*_LAST$, ^.*_MAX$, ^LAST_.*$ \ No newline at end of file diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt new file mode 100644 index 00000000..26435de3 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt @@ -0,0 +1,29 @@ +Functions changes summary: 0 Removed, 3 Changed, 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +3 functions with some indirect sub-type change: + + [C] 'function void fun0(Enum0)' at test40.1-enumerator-changes-enumerator-changes-v0.c:25:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum0' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum0::ENUM0_E1' value '1' + 1 enumerator change: + 'Enum0::ENOM0_LAST' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:6:1 + + [C] 'function void fun1(Enum1)' at test40.1-enumerator-changes-enumerator-changes-v0.c:30:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum1' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum1::ENUM1_E1' value '1' + 1 enumerator change: + 'Enum1::ENUM1_MAX' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:13:1 + + [C] 'function void fun2(Enum2)' at test40.1-enumerator-changes-enumerator-changes-v0.c:35:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum2' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum2::ENUM2_E1' value '1' + 1 enumerator change: + 'Enum2::LAST_ENUM1_ENUMERATOR' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:20:1 + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt new file mode 100644 index 00000000..ff415ac5 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt @@ -0,0 +1,21 @@ +Functions changes summary: 0 Removed, 2 Changed (1 filtered out), 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +2 functions with some indirect sub-type change: + + [C] 'function void fun1(Enum1)' at test40.1-enumerator-changes-enumerator-changes-v0.c:30:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum1' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum1::ENUM1_E1' value '1' + 1 enumerator change: + 'Enum1::ENUM1_MAX' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:13:1 + + [C] 'function void fun2(Enum2)' at test40.1-enumerator-changes-enumerator-changes-v0.c:35:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum2' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum2::ENUM2_E1' value '1' + 1 enumerator change: + 'Enum2::LAST_ENUM1_ENUMERATOR' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:20:1 + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt new file mode 100644 index 00000000..7e4093ca --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt @@ -0,0 +1,21 @@ +Functions changes summary: 0 Removed, 2 Changed (1 filtered out), 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +2 functions with some indirect sub-type change: + + [C] 'function void fun0(Enum0)' at test40.1-enumerator-changes-enumerator-changes-v0.c:25:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum0' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum0::ENUM0_E1' value '1' + 1 enumerator change: + 'Enum0::ENOM0_LAST' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:6:1 + + [C] 'function void fun2(Enum2)' at test40.1-enumerator-changes-enumerator-changes-v0.c:35:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum2' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum2::ENUM2_E1' value '1' + 1 enumerator change: + 'Enum2::LAST_ENUM1_ENUMERATOR' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:20:1 + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt new file mode 100644 index 00000000..9f4bbcb2 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt @@ -0,0 +1,13 @@ +Functions changes summary: 0 Removed, 1 Changed (2 filtered out), 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void fun2(Enum2)' at test40.1-enumerator-changes-enumerator-changes-v0.c:35:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum2' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum2::ENUM2_E1' value '1' + 1 enumerator change: + 'Enum2::LAST_ENUM1_ENUMERATOR' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:20:1 + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt new file mode 100644 index 00000000..e09641c6 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt @@ -0,0 +1,21 @@ +Functions changes summary: 0 Removed, 2 Changed (1 filtered out), 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +2 functions with some indirect sub-type change: + + [C] 'function void fun0(Enum0)' at test40.1-enumerator-changes-enumerator-changes-v0.c:25:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum0' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum0::ENUM0_E1' value '1' + 1 enumerator change: + 'Enum0::ENOM0_LAST' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:6:1 + + [C] 'function void fun1(Enum1)' at test40.1-enumerator-changes-enumerator-changes-v0.c:30:1 has some indirect sub-type changes: + parameter 1 of type 'enum Enum1' has sub-type changes: + type size hasn't changed + 1 enumerator insertion: + 'Enum1::ENUM1_E1' value '1' + 1 enumerator change: + 'Enum1::ENUM1_MAX' from value '1' to '2' at test40.1-enumerator-changes-enumerator-changes-v1.c:13:1 + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt new file mode 100644 index 00000000..97239c74 --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt @@ -0,0 +1,3 @@ +Functions changes summary: 0 Removed, 0 Changed (3 filtered out), 0 Added functions +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c new file mode 100644 index 00000000..7b32ee8b --- /dev/null +++ b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c @@ -0,0 +1,37 @@ +/** + * compile this with: + * gcc -g -c test40.1-enumerator-changes-enumerator-changes-v0.c + */ + +enum Enum0 +{ + ENUM0_E0, + ENOM0_LAST +}; + +enum Enum1 +{ + ENUM1_E0, + ENUM1_MAX +}; + +enum Enum2 +{ + ENUM2_E0, + LAST_ENUM1_ENUMERATOR +}; + +void +fun0(enum Enum0 p __attribute__((unused))) +{ +} + +void +fun1(enum Enum1 p __attribute__((unused))) +{ +} + +void +fun2(enum Enum2 p __attribute__((unused))) +{ +} diff --git a/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o b/tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..8234f05d0e157a66a88be438cbe4a1f17c2fa01f GIT binary patch literal 3944 zcmc&$&2Jl35TEthaf%b?t3XUj<4{o2s$PGP21rTbD3~T9Ng*^65+Cl`UVl(~ZQ1K6 z1OYu26*#mKhaNa0AtVGvAWod%!e0QKI8li!M+69FcIT}(&l?Hl!dUxe<~JX2-rIR^ z{Z4N4*?^*eAO)78rwJ6GdS6e@+F}+?!UXKD-@JG8t-o%)`n{j@2YQA;8Ki&^4G+`c zrPCfIK=KAY12i~Q*rNgi!7v$JkD+U_hie+YA)A5}dWHrfu@L2>&rwrbaE5XPZr8!~ za|`PE{pk3eexCj8Qk0mxO+8P{7Sq@ZlsQnNry`g;sHoB9nQ&w#xG}Lfqg;$UH8Y@0 z;N&4t2N@XKmLQM?i7bS^=a4Ik@@I6I7_Ao{6sGN^2bAf+ zh?CY13n_5IRn?f%&EhYhVnA;D@>VLpx%%Q2=$f5c#WYIsnrXqM?cMlV`iXctt<7uc zcqWy3JhhOz5TDyYhjrazLn3oFo@iKI(^#q)rqQkyQPtbU>eBv`3yFpK#9k(zs6cLe zcPo?6r66Z^8#tnxvQ-q)Jz;D0C7@FBih{?PM89R+|kY zS!$MEuO%xrD_O4<^g^wo*XqfZZWXIWCutcStCKA0mTrrQQmtH0bh@op8^|=D($Wb7 zD>K@<)odqag0&BwqIdnjbY)_LB=_vavj@j4FranfU9E9Kh=`$dJt?LIP z?zZ_MyNVV+Qk|Qn&!oaYA4Y%*_6^f#Q{hA(=J?|!<3lP8`Jj{^Zwnt%VZ;X||KUFT z0wUv{{SkNIBI80Ae1&oG{sn%lvtb`kaZodMZQ^31yxv_El@m_8hgYmk(?dxHtQmvsPhxXKVUBQO}zgvq&%Oo{eeXPkP++do+e7wf$$;bPxF z>%7sh^a66L?eMCQEMwmSjlMvj6*?Wz+D2X1N=Bhu$=A$s6K%Gv7Yc1-?~qw<+h3zY zSiNQ%A_S)pBEflEFE$$u13%-M*|ZD|zX6Gkr5CSp5~G?gxAlf-JYLUn*%SuSo_fzV z<;v24B>$BmUoXv|LYRC*zvgxF$a4HF+UR^AH=g=M&PmgW`Tr)xL$WXRA^ktidVEOy zfj4B7n`#U(@)LKFxbNuRk#iyhFEjWaDISu2>A$axk^4OcQ=V87W#8uz^Q-@7E>y%* z{b79M`b$1J5rX@9-Bh2KKdDzanC2%)p1*|{YbO{)@C9qCv>Qhq%e{UW{bf_fy7rxvqPQYPdt;mW3wxcW zMF_;9qQIf8IFt_|B)A}PsKh_OhXfZcoH!x%0218b1QJLv^LEDGJZ~hF3uEnjGr#%G zyxI5VeKo!Eq)*cXizenp$6{27J9l;TlvGpVs2CPoOV@tB_R8Papa0rR3qqtE<J7hvgi zaSZeNZj^=OMZl2K;r#+O@FLGZk33nHHtv)RSceI$af4Vwn-Y3xJP0v-F z^6+d#I~{y163~VrX^+tR2pC!(_KgVPH?%XOdWb-6a&$;L(wiE&GK&13A?=~ia8REZ zn?QK*9+B`EaRf zi}c#oY9h0`a9*5U+X^ox9tkHB#rP``EW?Y&uFenLTItnlo0;|k8g<+fC zSlC?O5ZkS45}O1zPCAHzq)8Dg)+$ykU(3H(iWN$BtX#^P*;2tQm1A|&&K0d@%(j|# zGnO}PQ>xK?X?r``Y}M-xfv)Mek%(H5%xai+tr5)?&1%7FdOTsX?#qa-gIRJo-?F9qgJ_LLGI(WQ9ckZ1omo5Tb7y`O;|8)6uai|M( z_;3Yzh%OF$pqL--5)aYEfCq~F{x19!AV*yD!#CtC;cRn%hHzeg#t(En_XVIGN&JQgBDOSO0{I&ov+vbKyAd>txR<_#0#| zD)j@K%dk`O%6e*1J`(99Ro;P7MFIQ|c3%%WN`XXz# zwQCCl|ICDuZ8n9`u*#;9x3aB5rc~XoflumYHrudv_PEW4{A1gLl}lBNLtqG25za_E zSF2Pk_*gKiHQO@a?=EUK6`~k(OnDRprzk*X3V zkN20F6Vp@(d=m|qsN8elQ!%9fL15e!i>k_f3NWww&*5PP;drbczv9*U^MI*20TPq+ z-dLYoRBi^GUgN(;<6od)93LTd{5oKmlj{Uk$|V~AM+T_p@wtB)aIg4H+E61*+$a96 zed5dbQXu@lHJpaG2gXfR!Pe4IxiUI2H z(EKlvjq{IRGaS$R7wb{S#*h)Z+;36A_LK3)#(YJ^%m! literal 0 HcmV?d00001 diff --git a/tests/test-diff-suppr.cc b/tests/test-diff-suppr.cc --- a/tests/test-diff-suppr.cc +++ b/tests/test-diff-suppr.cc @@ -1836,6 +1836,66 @@ InOutSpec in_out_specs[] = "data/test-diff-suppr/test40-enumerator-changes-report-0.txt", "output/test-diff-suppr/test40-enumerator-changes-report-0.txt" }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt" + }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt" + }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt" + }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt" + }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt" + }, + { + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o", + "", + "", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr", + "--no-default-suppression", + "data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt", + "output/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt" + }, { "data/test-diff-suppr/libtest41-enumerator-changes-v0.so", "data/test-diff-suppr/libtest41-enumerator-changes-v1.so", From patchwork Fri Oct 20 09:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78213 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 329B6385841B for ; Fri, 20 Oct 2023 09:58:49 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 E944A3858D20 for ; Fri, 20 Oct 2023 09:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E944A3858D20 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 E944A3858D20 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=1697795925; cv=none; b=T3XQH65iqKrLFDZiersfqXbaJrVJq2rkm0TTz21nQhV7VK8jpx4gw0Hwe0wmyCA1v6pD4GqMOzARpP+FhOmUzbYJ/bMtAm6oC6F+C6m37v7oiYHe1dlodcxhtCF1po2gFcz2FcW/lWLt4OM150uq+xv8OOuQXcyCqH0PV9fPij4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795925; c=relaxed/simple; bh=cgrmZL6qeyx9Gn1SXkVdEieYP3tDmHpUXPsBKVAeCAU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Yfe6d1l9TWnAay5XYqrRocD8R9EcgjonyWrwmpK55UAuGTToIixI+uSsJHJvdz8PKWKRX1wgzr3N+b1Jhrap753fqzvO4TMdUFqyHPQhp8IG5w7VUAr8KvcO7FBDUt0hHtJg85gm20ifa98rbdTq0j7H8qjzJAYSxPF/gMR+sFY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697795923; 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=2W9kaM1PDB+KJrcYA5R/KolxKmKZMdH7rXSmVTWuGrA=; b=PaKzWhUNh5XJ7Sa7ZB0dNSieW7SFzQ2P+wOdhWBG6Yj1oZRLLHjGDk9Whn5w+jIFZcbZSi LGs18zDKTkGllVRzpx9M2zXn292hv/jHtE9bgW8+inw76VkeAMSOt9Yi6XVPUkmcZfJ+bG 5HgrFrr7duga8IYvIN0NiB1ZvGJ3J9c= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-118-c8vdAmb-O9y60xA9UDWjFg-1; Fri, 20 Oct 2023 05:58:26 -0400 X-MC-Unique: c8vdAmb-O9y60xA9UDWjFg-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4180bc4227bso27506151cf.1 for ; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697795906; x=1698400706; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2W9kaM1PDB+KJrcYA5R/KolxKmKZMdH7rXSmVTWuGrA=; b=WevzaCVLezDbLf0GUVhfE1uSlHbYkTrePic+rccdZBMOVGdf5ac+Z3noAEKLUWECGV AN/UuvMBrUYbd7xPhqWn9ur5vdlmecD/+VXFDRBsB0Jsz2WgKGeopKbfmvb3/s5k51Qk yUUVpBRc/ehsXwjMdy90Pqj/QP6J0Pxe//fA24r6icNXqJ2sJsRXjNp1PMfbz943zJOp 1NGK6oFJlbGhLtGW2EtXeqOfrPBWUo0E06XnRvDfQOLxEV1KmSf7xg+F5U9Zd9Wtd6ym USTlHfyFtP5hwUfOFuEsFVQIiF4vROKQ9ufONInnRcL0khQSYaA5wv7xRD2Z5OaBK5r9 3E1g== X-Gm-Message-State: AOJu0YxVzqdVCYwNRHQBI1fRmDRvA6omeTyq9RIg4MNPE41OdFrWaXxG RkCocqwyzYJaI2a7mawsq4DDIyDYrH+E4gQWjVQg5Owz0+lqMHj7LvmJ8PvKwaZIzqTCwHR+zjy Z4hEP7Zzel+KQISiBUvBG X-Received: by 2002:ac8:5c04:0:b0:3f9:d1c3:cc45 with SMTP id i4-20020ac85c04000000b003f9d1c3cc45mr5832395qti.28.1697795906437; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRUUyFmxLFwevYFLo1aDtAPMkcbXV8sqHUmX0SXimFEecvrumkeM6NAkrSGZieh13ZubK7Jg== X-Received: by 2002:ac8:5c04:0:b0:3f9:d1c3:cc45 with SMTP id i4-20020ac85c04000000b003f9d1c3cc45mr5832387qti.28.1697795906171; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id g14-20020ac84b6e000000b00419cb97418bsm476064qts.15.2023.10.20.02.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:58:25 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 243045077C49; Fri, 20 Oct 2023 11:58:24 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 2/7, applied] default-reporter,reporter-priv: Do not report names of anonymous enums Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 11:58:24 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <874jil7gzj.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, When reporting changes of anonymous enums, do not try to report their qualified name as that doesn't make any sense -- they are anonymous. Similarly, in report_name_size_and_alignment_changes do not try to report about changes in the name of an anonymous enum. * src/abg-default-reporter.cc (default_reporter::report): In the overload for enum_diff, do not get the qualified name of anonymous enums. * src/abg-reporter-priv.cc (report_name_size_and_alignment_changes): Do not report about name changes for anonymous enums. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-default-reporter.cc | 12 +++++++++--- src/abg-reporter-priv.cc | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc index b1df9300..c71f8d56 100644 --- a/src/abg-default-reporter.cc +++ b/src/abg-default-reporter.cc @@ -162,7 +162,9 @@ default_reporter::report(const enum_diff& d, ostream& out, { out << indent << " '" - << i->get_qualified_name() + << (first->get_is_anonymous() + ? i->get_name() + : i->get_qualified_name()) << "' value '" << i->get_value() << "'"; @@ -181,7 +183,9 @@ default_reporter::report(const enum_diff& d, ostream& out, { out << indent << " '" - << i->get_qualified_name() + << (second->get_is_anonymous() + ? i->get_name() + :i->get_qualified_name()) << "' value '" << i->get_value() << "'"; @@ -201,7 +205,9 @@ default_reporter::report(const enum_diff& d, ostream& out, { out << indent << " '" - << i->first.get_qualified_name() + << (first->get_is_anonymous() + ? i->first.get_name() + : i->first.get_qualified_name()) << "' from value '" << i->first.get_value() << "' to '" << i->second.get_value() << "'"; diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc index 63a45b80..cc38f240 100644 --- a/src/abg-reporter-priv.cc +++ b/src/abg-reporter-priv.cc @@ -965,7 +965,8 @@ report_name_size_and_alignment_changes(decl_base_sptr first, string fn = first->get_qualified_name(), sn = second->get_qualified_name(); - if (fn != sn) + if (!(first->get_is_anonymous() && second->get_is_anonymous()) + && fn != sn) { if (!(ctxt->get_allowed_category() & HARMLESS_DECL_NAME_CHANGE_CATEGORY) && filtering::has_harmless_name_change(first, second)) From patchwork Fri Oct 20 09:59:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78214 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 09A693858D20 for ; Fri, 20 Oct 2023 10:00:43 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 4F4773858D20 for ; Fri, 20 Oct 2023 09:59:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F4773858D20 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 4F4773858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796007; cv=none; b=D+G0CsWSx7NLlPNRlqoqqnGRNS+EbmNS7muIBd7vGKPcq6AxH6eUA2HotZkwl/X6PjX2BfLxHdavSIr//nwy5sWGXPlVXAeD62dCUgo3uBhX5LzfUbo1U6yoi9l7lMIf3sM3QKD+U+/TMWCbGpl8lrGDNSZrwNOJ1xVL7l0o+bU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796007; c=relaxed/simple; bh=lrAW5LOvaoIFWuTDlc6yWvnGwYiKG/3JIKAMyJhXJJw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=S1d0WIxNsZS6vw8CSKqEY3L1NbU8Htk0Os70WpVp2IbTvdDjVNwajwiRE7TV20v83vRi6RiOt/hjiL/sICBHiB0E3guxTQaS4ywHZkQ6ZgzLP8wKpb5/6OE4vqauITWHtSEZmV7lSoIYYxlS/yaabkwZSOMmo1CISU2Xe03eVpE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697795985; 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=ohMjWKMRpG1GWosvpu/X6TGUf2yd76S0cNsV4OPOf64=; b=FoiRlqMTc7uDthlnz98Yjmju5XsIYBrIyiNp0Nhwbjbl1/6JP5R4oun5iDSRJUFQh7PKuQ Hiwm2tslRhi+aEWSHZr7sKT65wKdSiauI1ez36AE6vOzzVcPSSPc6wNNz0y3UrVM0HEMHL R1wUl1r5IJTgSEOQY/K69GFEaXMwpcg= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-F_HhjiSCMuGTQCfBWes7NQ-1; Fri, 20 Oct 2023 05:59:21 -0400 X-MC-Unique: F_HhjiSCMuGTQCfBWes7NQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-66d24cdf232so8459686d6.1 for ; Fri, 20 Oct 2023 02:59:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697795960; x=1698400760; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ohMjWKMRpG1GWosvpu/X6TGUf2yd76S0cNsV4OPOf64=; b=Er2LBZWzxjXIVl1EopM0/S3IOiM7zTIySp8eBzV97lHCLzlocwGp8Ju6x5QD19xbSY msX5TvD7Iz/5FB9675UbERf8+GygF+KXqHBLQnRoowWdzS1KmMbJVnIDJ556KHa4UuMk Ktd8rDrQPX5pRtUs7BK/7eZsgQMQHWa6Te0XcmL2RYeXKGzGNGZl0OwBJ4F+eRVdePn/ l1UiGeV3UbKvNu53EeAmU01qfmXsvBzeJGq6GELYbl3bESxIutjkmZl7FzMX/ToReeT5 uZrSLAlFLMZ1jEs5Zu6xechLySOnV9x8UozVAiiKBw3HFhNxP6CH65G32NHyeVTejlL6 aaVw== X-Gm-Message-State: AOJu0YwlPrWMEzDulYoihJlhe/xtV6qK+YsZa1kAXI00F/j2lNpkTsjw DDj1yP9lfkMRgTILh07pHEGOGLKvjHDBn9R3wjCXd0jusgy7suSPooyplP8GXVLmkBNx/g0xNuc cs4tKaQYEf/wEjr9RJmnp X-Received: by 2002:ad4:4ea4:0:b0:66d:299d:e4c with SMTP id ed4-20020ad44ea4000000b0066d299d0e4cmr1585391qvb.20.1697795959562; Fri, 20 Oct 2023 02:59:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGe553ODPghpCK8qmaSGTrx6wMKNMOOFGQtkLPqelPum9I0vUkaE4KrD9MYjLh6d+kFUMN0Q== X-Received: by 2002:ad4:4ea4:0:b0:66d:299d:e4c with SMTP id ed4-20020ad44ea4000000b0066d299d0e4cmr1585358qvb.20.1697795958415; Fri, 20 Oct 2023 02:59:18 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id u12-20020a05621411ac00b0066d5220d860sm560674qvv.18.2023.10.20.02.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:59:17 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 93C065077C49; Fri, 20 Oct 2023 11:59:14 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 3/7, applied] ir,comparison,corpus: Better support anonymous enums comparison Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 11:59:14 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <87zg0d62dp.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Anonymous enums are designated using their internal names which are automatically generated. The problem however is that whenever a new anonymous enum gets inserted in the translation unit, that can randomly change the name of existing anonymous enums. This makes reporting of changes in anonymous enums essentially useless. To address this issue, this patch uses flat representation for anonymous enums, for the purpose of designating them outside of the context of type canonicalization. This is like what is done already for anonymous classes and unions. * include/abg-fwd.h (get_enum_flat_representation) (get_class_or_enum_flat_representation): Declare new functions. * include/abg-ir.h (enum_type_decl::get_sorted_enumerators): Declare new member functions. * src/abg-comparison.cc (corpus_diff::priv::{ensure_lookup_tables_populated, added_unreachable_type_is_suppressed, deleted_unreachable_type_is_suppressed, record_type_as_reachable_from_public_interfaces}): Use non-internal pretty representation to designate ABI artifacts so that anonymous enums get designated by their flat representation. * src/abg-corpus.cc (corpus::type_is_reachable_from_public_interfaces): Likewise. * src/abg-ir.cc (get_type_name): The type name of an anonymous enum or class should is now the flat representation if we are not in the context of type canonicalization. (enum_type_decl::get_pretty_representation): If we are not in the context of type canonicalization, the pretty representation of an enum is its flat representation. (get_enum_flat_representation) (get_class_or_enum_flat_representation): Define new functions. (enum_type_decl::get_sorted_enumerators): Likewise. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. Signed-off-by: Dodji Seketeli Applied to master. --- include/abg-fwd.h | 27 + include/abg-ir.h | 3 + src/abg-comparison.cc | 10 +- src/abg-corpus.cc | 4 +- src/abg-ir.cc | 203 +- tests/data/test-annotate/libtest23.so.abi | 224 +- .../test-anonymous-members-0.o.abi | 22 +- .../data/test-annotate/test15-pr18892.so.abi | 8 +- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 54 +- ...19-pr19023-libtcmalloc_and_profiler.so.abi | 10 +- ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 2 +- .../test43-PR22913-report-0.txt | 4 +- .../test-read-dwarf/PR22122-libftdc.so.abi | 12416 ++++++++-------- tests/data/test-read-dwarf/libtest23.so.abi | 216 +- .../test-read-dwarf/test-libandroid.so.abi | 44 +- .../test-read-dwarf/test16-pr18904.so.abi | 1816 +-- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 40 +- .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 60 +- 18 files changed, 7637 insertions(+), 7526 deletions(-) diff --git a/include/abg-fwd.h b/include/abg-fwd.h index 0afb2122..e494de07 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -1097,6 +1097,33 @@ get_class_or_union_flat_representation(const class_or_union_sptr& cou, bool internal, bool qualified_name = true); +string +get_enum_flat_representation(const enum_type_decl& enum_type, + const string& indent, + bool one_line, + bool internal, + bool qualified_names); + +string +get_enum_flat_representation(const enum_type_decl* enum_type, + const string& indent, + bool one_line, + bool internal, + bool qualified_names); + +string +get_enum_flat_representation(const enum_type_decl_sptr& enum_type, + const string& indent, + bool one_line, + bool qualified_names); + +string +get_class_or_enum_flat_representation(const type_base& coe, + const string& indent, + bool one_line, + bool internal, + bool qualified_name); + string get_debug_representation(const type_or_decl_base*); diff --git a/include/abg-ir.h b/include/abg-ir.h index 5a9aed9a..3729e84a 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2728,6 +2728,9 @@ public: const enumerators& get_enumerators() const; + const enumerators& + get_sorted_enumerators() const; + enumerators& get_enumerators(); diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 16afd556..61fe89e0 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -9551,7 +9551,8 @@ corpus_diff::priv::ensure_lookup_tables_populated() if (!is_user_defined_type(t)) continue; - string repr = abigail::ir::get_pretty_representation(t, true); + string repr = + abigail::ir::get_pretty_representation(t, /*internal=*/false); deleted_unreachable_types_[repr] = t; } @@ -9573,7 +9574,8 @@ corpus_diff::priv::ensure_lookup_tables_populated() if (!is_user_defined_type(t)) continue; - string repr = abigail::ir::get_pretty_representation(t, true); + string repr = + abigail::ir::get_pretty_representation(t, /*internal=*/false); // Let's see if the inserted type we are looking at was // reported as deleted as well. @@ -9857,7 +9859,7 @@ corpus_diff::priv::added_unreachable_type_is_suppressed(const type_base *t)const if (!t) return false; - string repr = abigail::ir::get_pretty_representation(t, /*internal=*/true); + string repr = abigail::ir::get_pretty_representation(t, /*internal=*/false); string_type_base_sptr_map::const_iterator i = suppressed_added_unreachable_types_.find(repr); if (i == suppressed_added_unreachable_types_.end()) @@ -9879,7 +9881,7 @@ corpus_diff::priv::deleted_unreachable_type_is_suppressed(const type_base *t) co if (!t) return false; - string repr = abigail::ir::get_pretty_representation(t, /*internal=*/true); + string repr = abigail::ir::get_pretty_representation(t, /*internal=*/false); string_type_base_sptr_map::const_iterator i = suppressed_deleted_unreachable_types_.find(repr); if (i == suppressed_deleted_unreachable_types_.end()) diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc index 7cf2d11d..4a4cb8bc 100644 --- a/src/abg-corpus.cc +++ b/src/abg-corpus.cc @@ -774,7 +774,7 @@ corpus::recording_types_reachable_from_public_interface_supported() void corpus::record_type_as_reachable_from_public_interfaces(const type_base& t) { - string repr = get_pretty_representation(&t, /*internal=*/true); + string repr = get_pretty_representation(&t, /*internal=*/false); interned_string s = t.get_environment().intern(repr); priv_->get_public_types_pretty_representations()->insert(s); } @@ -792,7 +792,7 @@ corpus::record_type_as_reachable_from_public_interfaces(const type_base& t) bool corpus::type_is_reachable_from_public_interfaces(const type_base& t) const { - string repr = get_pretty_representation(&t, /*internal=*/true); + string repr = get_pretty_representation(&t, /*internal=*/false); interned_string s = t.get_environment().intern(repr); return (priv_->get_public_types_pretty_representations()->find(s) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index fc3437d6..06dfbe20 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -8845,6 +8845,8 @@ get_type_name(const type_base* t, bool qualified, bool internal) return fn_type->get_cached_name(internal); } + const environment&env = d->get_environment(); + // All anonymous types of a given kind get to have the same internal // name for internal purpose. This to allow them to be compared // among themselves during type canonicalization. @@ -8863,10 +8865,18 @@ get_type_name(const type_base* t, bool qualified, bool internal) if (qualified) return d->get_qualified_name(internal); - const environment&env = d->get_environment(); return env.intern(get_internal_integral_type_name(t)); } + if (d->get_is_anonymous()) + { + if (is_class_or_union_type(t) || is_enum_type(t)) + return env.intern + (get_class_or_enum_flat_representation (*t, "", + /*one_line=*/true, + internal, qualified)); + } + if (qualified) return d->get_qualified_name(internal); return d->get_name(); @@ -9563,6 +9573,165 @@ get_class_or_union_flat_representation(const class_or_union_sptr& cou, internal, qualified_names);} +/// Get the flat representation of an instance of @ref enum_type_decl +/// type. +/// +/// The flat representation of a given @ref enum_type_decl type is the +/// actual definition of the type, for instance: +/// +/// enum {E_0 =0, E_1 = 1} +/// +///@param enum_type the enum type to consider. +/// +///@param indent the identation spaces to use in the representation. +/// +///@param one_line if true, then the flat representation stands on one +///line. Otherwise, it stands on multiple lines. +/// +///@param qualified_names use qualified names when applicable. +///Typically, if this is true, the name of the enum is going to be +///qualified. +/// +///@return the resulting flat representation. +string +get_enum_flat_representation(const enum_type_decl& enum_type, + const string& indent, bool one_line, + bool qualified_names) +{ + string repr; + std::ostringstream o; + string local_indent = " "; + + repr = indent + "enum "; + + if (!enum_type.get_is_anonymous()) + o << (qualified_names + ? enum_type.get_qualified_name() + : enum_type.get_name()) + " "; + + o << "{"; + + if (!one_line) + o << "\n"; + + for (const auto &enumerator : enum_type.get_sorted_enumerators()) + { + if (!one_line) + o << "\n" + indent; + + o << enumerator.get_name() + "=" << enumerator.get_value() << ", "; + } + + if (!one_line) + o << "\n" + indent << "}"; + else + o << "}"; + + repr =o.str(); + + return repr; +} + +/// Get the flat representation of an instance of @ref enum_type_decl +/// type. +/// +/// The flat representation of a given @ref enum_type_decl type is the +/// actual definition of the type, for instance: +/// +/// enum {E_0 =0, E_1 = 1} +/// +///@param enum_type the enum type to consider. +/// +///@param indent the identation spaces to use in the representation. +/// +///@param one_line if true, then the flat representation stands on one +///line. Otherwise, it stands on multiple lines. +/// +///@param qualified_names use qualified names when applicable. +///Typically, if this is true, the name of the enum is going to be +///qualified. +/// +///@return the resulting flat representation. +string +get_enum_flat_representation(const enum_type_decl* enum_type, + const string& indent, bool one_line, + bool qualified_names) +{ + if (!enum_type) + return ""; + + return get_enum_flat_representation(*enum_type, indent, + one_line, qualified_names); +} + +/// Get the flat representation of an instance of @ref enum_type_decl +/// type. +/// +/// The flat representation of a given @ref enum_type_decl type is the +/// actual definition of the type, for instance: +/// +/// enum {E_0 =0, E_1 = 1} +/// +///@param enum_type the enum type to consider. +/// +///@param indent the identation spaces to use in the representation. +/// +///@param one_line if true, then the flat representation stands on one +///line. Otherwise, it stands on multiple lines. +/// +///@param qualified_names use qualified names when applicable. +///Typically, if this is true, the name of the enum is going to be +///qualified. +/// +///@return the resulting flat representation. +string +get_enum_flat_representation(const enum_type_decl_sptr& enum_type, + const string& indent, bool one_line, + bool qualified_names) +{ + return get_enum_flat_representation(enum_type.get(), + indent, one_line, + qualified_names); +} + +/// Get the flat representation of an instance of @ref enum_type_decl +/// type. +/// +/// The flat representation of a given @ref enum_type_decl type is the +/// actual definition of the type, for instance: +/// +/// enum {E_0 =0, E_1 = 1} +/// +///@param enum_type the enum type to consider. +/// +///@param indent the identation spaces to use in the representation. +/// +///@param one_line if true, then the flat representation stands on one +///line. Otherwise, it stands on multiple lines. +/// +///@param qualified_names use qualified names when applicable. +///Typically, if this is true, the name of the enum is going to be +///qualified. +/// +///@return the resulting flat representation. +string +get_class_or_enum_flat_representation(const type_base& coe, + const string& indent, + bool one_line, + bool internal, + bool qualified_name) + +{ + string repr; + if (const class_or_union* cou = is_class_or_union_type(&coe)) + repr = get_class_or_union_flat_representation(cou, indent, one_line, + internal, qualified_name); + else if (const enum_type_decl* enom = is_enum_type(&coe)) + repr = get_enum_flat_representation(*enom, indent, one_line, qualified_name); + + return repr; +} + /// Get the textual representation of a type for debugging purposes. /// /// If the type is a class/union, this shows the data members, virtual @@ -18578,6 +18747,7 @@ class enum_type_decl::priv { type_base_sptr underlying_type_; enumerators enumerators_; + mutable enumerators sorted_enumerators_; friend class enum_type_decl; @@ -18643,6 +18813,33 @@ enum_type_decl::enumerators& enum_type_decl::get_enumerators() {return priv_->enumerators_;} +/// Get the lexicographically sorted vector of enumerators. +/// +/// @return the lexicographically sorted vector of enumerators. +const enum_type_decl::enumerators& +enum_type_decl::get_sorted_enumerators() const +{ + if (priv_->sorted_enumerators_.empty()) + { + for (auto e = get_enumerators().rbegin(); + e != get_enumerators().rend(); + ++e) + priv_->sorted_enumerators_.push_back(*e); + + std::sort(priv_->sorted_enumerators_.begin(), + priv_->sorted_enumerators_.end(), + [](enum_type_decl::enumerator& l, + enum_type_decl::enumerator& r) + { + if (l.get_name() == r.get_name()) + return l.get_value() < r.get_value(); + return (l.get_name() < r.get_name()); + }); + } + + return priv_->sorted_enumerators_; +} + /// Get the pretty representation of the current instance of @ref /// enum_type_decl. /// @@ -18668,6 +18865,10 @@ enum_type_decl::get_pretty_representation(bool internal, if (internal && get_is_anonymous()) r += get_type_name(this, qualified_name, /*internal=*/true); + else if (get_is_anonymous()) + r += get_enum_flat_representation(*this, "", + /*one_line=*/true, + qualified_name); else r += decl_base::get_pretty_representation(internal, qualified_name); diff --git a/tests/data/test-annotate/libtest23.so.abi b/tests/data/test-annotate/libtest23.so.abi index dcbf8edc..6ca5c79d 100644 --- a/tests/data/test-annotate/libtest23.so.abi +++ b/tests/data/test-annotate/libtest23.so.abi @@ -137,54 +137,54 @@ - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + @@ -201,7 +201,7 @@ - + @@ -209,11 +209,11 @@ - + - + @@ -235,12 +235,12 @@ - + - + @@ -263,7 +263,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -321,7 +321,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -341,9 +341,9 @@ - + - + @@ -352,13 +352,13 @@ - + - + - + - + @@ -367,13 +367,13 @@ - + - + - + - + @@ -384,11 +384,11 @@ - + - + @@ -399,7 +399,7 @@ - + @@ -412,9 +412,9 @@ - + - + @@ -427,7 +427,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -491,12 +491,12 @@ - + - + - - + + @@ -505,7 +505,7 @@ - + @@ -514,7 +514,7 @@ - + @@ -525,7 +525,7 @@ - + @@ -534,7 +534,7 @@ - + @@ -543,18 +543,18 @@ - + - + - + - + @@ -563,9 +563,9 @@ - + - + @@ -574,7 +574,7 @@ - + @@ -583,18 +583,18 @@ - + - + - + - + @@ -603,7 +603,7 @@ - + @@ -612,16 +612,16 @@ - + - + - + @@ -632,7 +632,7 @@ - + @@ -643,7 +643,7 @@ - + @@ -677,7 +677,7 @@ - + @@ -690,18 +690,18 @@ - + - + - + @@ -712,7 +712,7 @@ - + @@ -721,31 +721,31 @@ - + - + - + - + - + - + @@ -754,7 +754,7 @@ - + @@ -763,7 +763,7 @@ - + @@ -772,7 +772,7 @@ - + @@ -783,7 +783,7 @@ - + @@ -794,7 +794,7 @@ - + @@ -805,7 +805,7 @@ - + @@ -827,7 +827,7 @@ - + @@ -835,7 +835,7 @@ - + @@ -847,7 +847,7 @@ - + @@ -857,7 +857,7 @@ - + @@ -866,7 +866,7 @@ - + @@ -879,7 +879,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -898,7 +898,7 @@ - + @@ -906,9 +906,9 @@ - + - + @@ -918,7 +918,7 @@ - + @@ -927,7 +927,7 @@ - + @@ -936,9 +936,9 @@ - + - + @@ -1002,7 +1002,7 @@ - + @@ -1024,9 +1024,9 @@ - + - + @@ -1080,9 +1080,9 @@ - + - + diff --git a/tests/data/test-annotate/test-anonymous-members-0.o.abi b/tests/data/test-annotate/test-anonymous-members-0.o.abi index e272d213..d75e67ee 100644 --- a/tests/data/test-annotate/test-anonymous-members-0.o.abi +++ b/tests/data/test-annotate/test-anonymous-members-0.o.abi @@ -13,15 +13,15 @@ - - + + - - + + - + @@ -29,11 +29,11 @@ - - + + - - + + @@ -103,7 +103,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/tests/data/test-annotate/test15-pr18892.so.abi b/tests/data/test-annotate/test15-pr18892.so.abi index d3616699..b749a0a6 100644 --- a/tests/data/test-annotate/test15-pr18892.so.abi +++ b/tests/data/test-annotate/test15-pr18892.so.abi @@ -10883,7 +10883,7 @@ - + @@ -35469,7 +35469,7 @@ - + @@ -35517,9 +35517,9 @@ - + - + diff --git a/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi b/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi index 0a6893b4..adff58f8 100644 --- a/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi +++ b/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi @@ -8146,7 +8146,7 @@ - + @@ -12813,7 +12813,7 @@ - + @@ -21260,18 +21260,8 @@ - - - - - - - - - - - - + + @@ -21279,6 +21269,16 @@ + + + + + + + + + + @@ -24118,18 +24118,8 @@ - - - - - - - - - - - - + + @@ -24137,6 +24127,16 @@ + + + + + + + + + + @@ -27487,7 +27487,7 @@ - + diff --git a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi index ea12beac..97490f59 100644 --- a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi +++ b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi @@ -20183,7 +20183,7 @@ - + @@ -25068,21 +25068,21 @@ - + - + - + @@ -32572,7 +32572,7 @@ - + diff --git a/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi b/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi index 4b4166bf..3de32474 100644 --- a/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi +++ b/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi @@ -21731,7 +21731,7 @@ - + diff --git a/tests/data/test-diff-dwarf/test43-PR22913-report-0.txt b/tests/data/test-diff-dwarf/test43-PR22913-report-0.txt index fc35f21d..d0515c69 100644 --- a/tests/data/test-diff-dwarf/test43-PR22913-report-0.txt +++ b/tests/data/test-diff-dwarf/test43-PR22913-report-0.txt @@ -4,8 +4,8 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub-type change: [C] 'function char f1(Struct1Ptr)' has some indirect sub-type changes: - parameter 1 of type 'typedef Struct1Ptr' has sub-type changes: - underlying type '__anonymous_struct__1*' changed: + parameter 1 of type 'typedef Struct1Ptr' changed: + underlying type 'struct {char m1; char m2;}*' changed: in pointed to type 'struct {char m1; char m2;}': type size changed from 16 to 8 (in bits) 1 data member deletion: diff --git a/tests/data/test-read-dwarf/PR22122-libftdc.so.abi b/tests/data/test-read-dwarf/PR22122-libftdc.so.abi index a1f8778c..501658df 100644 --- a/tests/data/test-read-dwarf/PR22122-libftdc.so.abi +++ b/tests/data/test-read-dwarf/PR22122-libftdc.so.abi @@ -357,136 +357,133 @@ - - - - - + + + + + - - - - + + - - - + + - - - + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + @@ -494,105 +491,105 @@ - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + @@ -600,91 +597,91 @@ - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - - - + + + - + @@ -692,96 +689,96 @@ - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - - - + + + - - - - + + + + - - - + + + - + - + - - - + + + - + @@ -790,7 +787,7 @@ - + @@ -800,90 +797,90 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + @@ -891,13 +888,13 @@ - + - + @@ -915,26 +912,26 @@ - + - + - - + + - + @@ -946,19 +943,19 @@ - + - + - + @@ -970,90 +967,90 @@ - - + + - - + + - + - + - + - - + + - + - - + + - - - + + + - - + + - + - - + + - - + + @@ -1061,8 +1058,8 @@ - - + + @@ -1070,8 +1067,8 @@ - - + + @@ -1079,29 +1076,29 @@ - + - - + + - - + + - - + + @@ -1109,14 +1106,14 @@ - + - - + + @@ -1124,8 +1121,8 @@ - - + + @@ -1133,8 +1130,8 @@ - - + + @@ -1142,7 +1139,7 @@ - + @@ -1150,246 +1147,246 @@ - + - - + + - - + + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + - + - - + + - + - + - + - + - + - + - + @@ -1528,7 +1525,7 @@ - + @@ -1653,14 +1650,14 @@ - + - + @@ -1678,7 +1675,7 @@ - + @@ -1692,7 +1689,7 @@ - + @@ -1704,7 +1701,7 @@ - + @@ -1762,28 +1759,28 @@ - + - + - + - + - + - - + + - + @@ -1795,15 +1792,15 @@ - + - + - + @@ -1814,11 +1811,11 @@ - + - + @@ -1876,34 +1873,34 @@ - - + + - + - - + + - + - + - + - - + + - + - + @@ -2310,7 +2307,7 @@ - + @@ -2956,12 +2953,12 @@ - - + + - + @@ -2969,133 +2966,133 @@ - + - + - + - + - + - + - + - + - + - + - - - + + + - - - - + + + + - + - + - + - + - - + + - + - - + + - + - - - + + + - - + + - + - + - - + + - + - + - - + + - + - + - + @@ -3103,499 +3100,489 @@ - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - - + + - + - + - + - - + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - + - - - + + + - - + + - + - - - - - + + + + + + + - - - - - + + + + + - + - - - - + + + + - - + + - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + - - + + - + - + - + - + - - - + + + - - + + - + - - + + - - + + - + - + @@ -3603,429 +3590,429 @@ - - - + + + - + - - - - + + + + - - - - + + + + - + - - + + - + - + - + - + - + - - + + - - - + + + - + - - + + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - - + + - - + + - + - + - + - + - - + + - + - + - + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - - + + + + - - - - + + + + - + - - - + + + - + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - + - - - + + + - + - - - + + + - + - + - + - + - - + + - + - + - - - - + + + + - + - - - + + + - + - + - + - - - - + + + + - + - + - - + + - + - + - - - + + + - + - - - - + + + + - + - - - + + + - + - - + + - - - + + + - - + + - + - + - - - - + + + + - + - - + + - - + + - + - + - - + + - + - + - + - + @@ -4035,384 +4022,384 @@ - + - - + + - - + + - - + + - + - - + + - - + + - + - + - + - - + + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - + - + - - - + + + - - - + + + - + - - + + - - + + - + - + - - - + + + - - - + + + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - + - + - + - + - - + + - - - + + + - + - + - + - + - + - + - - - + + + - + - + - - + + - + - + - + @@ -4420,566 +4407,535 @@ - - + + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - + - - + + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - + - - + + - + - + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - - + + + - + - - - + + + - - + + - - - + + + - - - + + + - - + + - + - - - + + + - - - + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + - - - - - - + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - + + - - - - - + + + + + - - - + + + - + - + - + - + - - + + - + - - + + - - + + - - - + + + - - - + + + - + - + - + - + - + - + - - - + + + - - - + + + - + - + - - + + - + @@ -4987,963 +4943,963 @@ - + - + - - + + - - - - + + + + - - - + + + - + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - + - + - + - + - - - + + + - + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - - + + + + - - - + + + - + - - - + + + - + - + - + - + - - - - + + + + - + - - - - + + + + - + - + - + - - - + + + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - - + + + + - - - + + + - + - - - - - + + + + + - - - + + + - + - - + + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - + - + - - + + - + - - - + + + - - + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - - + + - - + + - + - + - - - + + + - - - + + + - + - + - + - + - - + + - - + + - - + + - + - + - - + + - - - + + + - - - + + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + - + - - - - - + + + + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - + - - - + + + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - - - + + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - + - - + + - + - - + + - + - + - + - + - + - + - - + + - + - - - + + + - + - - + + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + @@ -5952,1659 +5908,1629 @@ - - + + - + - - + + - + - - + + - + - - + + - + - - - + + + - - - + + + - - - + + + - + - - - + + + - + - + - - - + + + - - + + - + - + - - + + - - + + - + - + - + - - + + - - + + - - + + - - - + + + - + - - - + + + - - + + - - - + + + - + - - + + - + - - + + - - - + + + - + - + - - + + - - + + - + - + - - + + - - + + - - - + + + - + - + - + - - - + + + - - - + + + - + - + - - - + + + - - - + + + - - + + - + - + - + - - + + - - + + - - - + + + - - + + - - - + + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - + + + + + - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - + - + - + - - - - + + + + - - + + - - + + - + - - + + - + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - + + + - - - + + + - - - + + + - + - - + + - - + + - - - - - - + + + + + + - - - + + + - + - - - - + + + + - + - + - + - + - - + + - + - - + + - + - - - - + + + + - - - + + + - - - - + + + + - - + + - + - - - + + + - - - + + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - + - - + + - - - + + + - - + + - - + + - + - + - + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + - + - + - - - + + + - - - + + + - + - + - - - + + + - - + + - + - - - - - + + + + + - - + + - + - - - - - + + + + + - + - - - - + + + + - - + + - - + + - - + + - - + + - - - + + + - + - - + + - - - + + + - - + + - + - - + + - - - + + + - + - + - + - - - + + + - - + + - + - + - - + + - - - + + + - - + + - + - + - - + + - - - + + + - + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + - + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - - + + - - + + - + - + - + - + - - + + - + - + - + - - - - + + + + - - - + + + - + - - + + - + - - - + + + - + - + - + - - + + - + - - + + - + - + - + - - - + + + - + - - - - + + + + - + - - - + + + - + - + - - + + - - + + - - + + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - - - - + + + + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - + - + - - + + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - + - + - - + + - + - - - + + + - + - - + + - - + + - - + + - - + + - + - + - - + + - + - + - + @@ -7612,724 +7538,713 @@ - - + + - + - + - + - + - - - + + + - + - + - + - - + + - - + + - - - + + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + - - - + + + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - + - - - + + + - + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - - + + - + - - + + - - + + - - + + - + - + - - - + + + - - - + + + - + - - - + + + - + - - - + + + - - - + + + - + - + - - + + - - - + + + - - - + + + - - + + - + - - - + + + - + - - + + - + - + - - - + + + - - + + - - + + - + - + - - - + + + - + - + - + - + - - - + + + - - - + + + - - + + - - + + - - - + + + - + - + - + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - - + + - + - + - - + + - + - + - + - - - + + + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - - + + - - - + + + - + - - - + + + - - + + - - + + - - - + + + - - - + + + - - + + - + - + - - - + + + - + - + - + @@ -8337,1252 +8252,1298 @@ - - - + + + - - - + + + - + - - - - + + + + - - - - + + + + - + - + - + - + - - - - + + + + - - - - + + + + - + - - - + + + - + - - + + - + - + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - - + + - - - + + + - + - + - - + + - + - + - + - + - + - - + + - - - + + + - - + + - - + + - + - + - + - + - - - + + + - + - - - + + + - + - + - + - - + + - + - - + + - + - + - + - - + + - - + + - + - + - + - - - - + + + + - + - - + + - - - - + + + + - - + + - + - + - + - + - + - - - + + + - - - + + + - - + + - + - + - + - + - + - + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - + + - + - + - + - - + + - - - + + + - - - + + + - - + + - - + + - - + + - + - + - - + + - - - + + + - + - - + + - - - + + + - - + + - - - + + + - - + + - + - + - - + + - + - - - + + + - + - - + + - + - + - + - - + + - - - + + + - - - + + + - - - + + + - + - - - + + + - - + + - + - - - + + + - + - + - - + + - - + + - + - - + + - - - + + + - - - + + + - + - - + + - - - + + + - + - - + + - + - + - - - + + + - + - - + + - + - + - - - + + + - + - + - + - - - + + + - + - + - + - - - + + + - + - - + + - + - + - - + + - + - - - + + + - + - - - + + + - + - - - + + + - + - + - + - - - + + + - + - - - + + + - - + + - + - - + + - + - + - - + + - - - + + + - + - + - - + + - - + + - + - - + + - - - + + + - - - + + + - - + + - - - + + + - + - + - + - - + + - - + + - - + + - - - + + + - + - + - - + + - - + + - + - + - + - + - - + + - - - + + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - + - - + + - - + + - - - + + + - - + + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - + - + - + - - + + - - + + - - + + - - + + - - - + + + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + @@ -9592,278 +9553,212 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - + + + - - - + + - - - + + - - - - - + + + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - - + + - + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - + - + - + - + - - + + - - + + - - - + + + - - + + - - + + - - + + - + - + @@ -9871,170 +9766,170 @@ - - - + + + - + - - + + - - - + + + - + - - - - + + + + - + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - - + + + - - + + - + - - + + - + - + @@ -10042,861 +9937,861 @@ - - - + + + - + - - - - - + + + + + - - - + + + - + - + - + - + - - - + + + - + - - - - + + + + - - - + + + - + - + - - + + - + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - - - + + + - + - - - + + + - - + + - - - - + + + + - + - + - + - + - - - - - + + + + + - - - + + + - + - - + + - + - - + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - + - - + + - - + + - - + + - - + + - + - + - + - - + + - - + + - + - + - + - + - - + + - + - + - + - - + + - - + + - - + + - + - - + + - + - + - - - + + + - - + + - + - + - + - + - - + + - + - + - + - - + + - - + + - - + + - - + + - + - + - + - - + + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - + + - - + + - + - - - + + + - - - - + + + + - + - - + + - + - + - - - + + + - - - + + + - - + + - - - + + + - - + + - + - - + + - + - + - - + + - + - + - + - - + + - + - - - - + + + + - + - - + + - + - + - - + + - + - - - - + + + + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - - - + + + @@ -10905,424 +10800,424 @@ - + - - - + + + - - - + + + - + - + - - + + - - - - - + + + + + - - + + - - + + - - - - - + + + + + - - + + - - + + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + - - - - - + + + + + - + - + - + - - - + + + - - + + - - + + - + - + - + - - - - + + + + - - - + + + - - - + + + - + - + - + - - + + - - + + - + - - - + + + - + - - + + - + - - - + + + - + - + - + - - + + - - + + - - + + - + - + - - + + - - - + + + - - + + - + - - - + + + - + - - - + + + - + - + - + - - + + - - + + - + - - + + - - - + + + - - - + + + - - + + - + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - - + + - + - + - + @@ -11330,1179 +11225,1174 @@ - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + - - - + + + - + - + - + - + - - + + - - + + - - + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - - + + - - - + + + - - - + + + - - + + - + - - - + + + - + - - + + - + - + - - + + - - - + + + - + - + - + - - + + - - + + - - + + - - - + + + - + - + - - + + - - - + + + - + - - + + - - + + - - - + + + - + - + - + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - + + - - - + + + - + - - + + - - - + + + - + - - + + - - + + - - - + + + - + - - - + + + - - + + - - + + - + - + - - + + - - + + - + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - + - + - + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - - + + + - + - - + + - + - + - + - - - + + + - - - - + + + + - - - + + + - - - + + + - - + + - - + + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + - + - - + + - - + + - - - + + + - - - + + + - + - - + + - - + + - - + + - - + + - - + + - + - - - + + + - - + + - - - + + + - - + + - + - + - + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - + - + - - + + - + - + - - + + - - + + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - - + + - + - - + + - + - + - - - + + + - - + + - - - + + + - + - + - + - + - + - - + + - + - - - - - + + + + + - - + + - + - - + + - + - + - + - + - - - + + + - + @@ -12510,183 +12400,183 @@ - + - + - + - + - + - + - + - + - - + + - + - + - - - + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - + + + - + - - - + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - + + + - + - - + + - - + + - + - + - + - + - - - + + + - + - + - - - + + + - + @@ -12695,7 +12585,7 @@ - + @@ -12705,376 +12595,376 @@ - + - - + + - + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - + - - + + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - - + + - + - - - + + + - - + + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - - - + + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - + - + - + - + - + - - + + - + - + - + @@ -13082,567 +12972,567 @@ - - - + + + - - + + - + - + - + - + - + - + - + - - - + + + - - + + - + - + - - + + - + - + - - + + - - + + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - - + + - - - + + + - - - + + + - + - - + + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - + - + - - + + - + - - - + + + - + - - + + - - - + + + - - + + - - + + - + - + - + - - - + + + - + - + - - + + - - - - + + + + - - + + - + - - - + + + - - - + + + - + - + - - + + - + - + - - + + - + - + - + - - - + + + - + - + - + - - - + + + @@ -13651,64 +13541,64 @@ - - + + - + - - + + - + - + - + - - - + + + - + - - - + + + - - + + - - + + - + - + @@ -13716,733 +13606,728 @@ - + - - + + - - - + + + - - - + + + - - + + - - - + + + - + - - - + + + - + - - + + - + - + - - - + + + - - + + - + - + - + - - + + - - + + - - + + - - - + + + - + - + - - + + - - + + - + - + - - + + - - + + - + - + - - + + - - + + - + - + - + - - + + - - + + - - + + - - - + + + - + - + - - + + - - - + + + - + - - - + + + - - - + + + - - + + - + - - + + - + - + - + - - + + - - + + - - - + + + - - + + - - - + + + - - - + + + - + - + - + - - + + - - + + - + - - - + + + - - + + - - - + + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - + - - + + - - + + - + - - - + + + - + - + - + - - + + - - + + - - - + + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + + + - - + + - + - - + + - + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - + - + - + - + - - + + - - + + - + - + - + - - + + - + - + - - + + - - + + - + - + - + - - + + - + - + - + - - - + + + - + - - - + + + @@ -14450,370 +14335,370 @@ - + - - + + - + - + - - + + - + - + - - + + - + - + - + - + - + - - - + + + - - - + + + - + - + - - + + - - + + - - + + - + - + - - - + + + - - + + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - + - + - - + + - + - - + + - + - - + + - - - + + + - - - + + + - + - + - + - + - + - - - + + + - + - + - + - - + + - + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - + - + - - + + - + - + - + @@ -14821,145 +14706,145 @@ - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - - + + - + - + - - + + @@ -14968,498 +14853,489 @@ - - + + - + - - + + - + - + - - - + + + - + - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - - + + + - + - + - - + + - - + + - + - - + + - - + + - + - + - - + + - - + + - + - + - - - + + + - - + + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - - + + - - + + - - - + + + - + - + - + - + - + - + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - - - + + + - - - + + + - - - + + + - + - + - + - + @@ -15467,222 +15343,222 @@ - - - + + + - - - + + + - - - + + + - - + + - + - - + + - + - - + + - + - - + + - + - + - + - + - + - + - - + + - + - + - - - - + + + + - + - - - - + + + + - + - + - - - + + + - - + + - + - + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - + - - - + + + - + - - - + + + @@ -15690,626 +15566,626 @@ - + - - + + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - + + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - - + + - + - + - + - + - - - + + + - + - + - - - + + + - + - - + + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - + - - - + + + - - + + - + - + - - + + - - - + + + - + - + - + - + - + - - - + + + - + - + - + - - + + - + - + @@ -16317,657 +16193,657 @@ - - + + - + - + - + - + - + - + - + - - + + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + - + - - + + - - + + - + - + - - + + - - - + + + - - - + + + - - + + - - + + - + - + - - - - + + + + - - - - + + + + - + - - + + - - + + - - + + - - + + - + - - + + - + - - + + - - - + + + - - + + - + - - + + - + - - - + + + - - - + + + - - - + + + - - - + + + - + - - + + - + - + - - + + - + - - + + - + - + - + - + - + - - + + - + - - + + - + - - + + - + - + - - - + + + - - - + + + - + - - + + - - - + + + - - - + + + - + - + - + - + - - - + + + - - + + - + - + - + - + - - + + - + - + - + - - + + - - + + - + - + - - + + - + - - + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - - - - + + + + - - + + - + - - - + + + - - - - + + + + - - - + + + - + - - + + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + @@ -16976,667 +16852,667 @@ - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - + - - + + - - + + - - + + - + - + - - - + + + - + - + - + - - - + + + - + - + - - + + - - + + - - + + - - - + + + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - + - - - + + + - + - - + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - - + + - - + + - + - - + + - + - - - + + + - - - + + + - - - + + + - + - + - - - + + + - - - + + + - + - - + + - - - + + + - - + + - - + + - - - + + + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - + - - + + - - - + + + - - - + + + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - + + - + - + - + - + - - - + + + - + - - - + + + - + - - + + diff --git a/tests/data/test-read-dwarf/libtest23.so.abi b/tests/data/test-read-dwarf/libtest23.so.abi index 459527f0..53fa11ad 100644 --- a/tests/data/test-read-dwarf/libtest23.so.abi +++ b/tests/data/test-read-dwarf/libtest23.so.abi @@ -92,30 +92,30 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + @@ -125,16 +125,16 @@ - + - + - + @@ -148,10 +148,10 @@ - + - + @@ -168,7 +168,7 @@ - + @@ -204,62 +204,62 @@ - + - + - + - - + + - - - - + + + + - - - - + + + + - + - + - + @@ -267,8 +267,8 @@ - - + + @@ -276,7 +276,7 @@ - + @@ -302,7 +302,7 @@ - + @@ -315,91 +315,91 @@ - + - + - + - + - + - + - - + + - - + + - - + + - + - - + + - - + + - + - + - - + + - + - + @@ -418,77 +418,77 @@ - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + @@ -500,71 +500,71 @@ - + - + - + - + - + - + - + - + - - + + - + - + - - + + @@ -600,7 +600,7 @@ - + @@ -612,8 +612,8 @@ - - + + @@ -644,8 +644,8 @@ - - + + diff --git a/tests/data/test-read-dwarf/test-libandroid.so.abi b/tests/data/test-read-dwarf/test-libandroid.so.abi index 29eda64b..32c1a0a4 100644 --- a/tests/data/test-read-dwarf/test-libandroid.so.abi +++ b/tests/data/test-read-dwarf/test-libandroid.so.abi @@ -8037,17 +8037,7 @@ - - - - - - - - - - - + @@ -8067,6 +8057,16 @@ + + + + + + + + + + @@ -18980,7 +18980,6 @@ - @@ -19098,6 +19097,7 @@ + @@ -24528,6 +24528,8 @@ + + @@ -25770,7 +25772,7 @@ - + @@ -30500,7 +30502,7 @@ - + @@ -31186,7 +31188,7 @@ - + @@ -35836,7 +35838,7 @@ - + @@ -37487,7 +37489,7 @@ - + @@ -37510,7 +37512,7 @@ - + @@ -37590,7 +37592,7 @@ - + @@ -37613,7 +37615,7 @@ - + @@ -37693,7 +37695,7 @@ - + diff --git a/tests/data/test-read-dwarf/test16-pr18904.so.abi b/tests/data/test-read-dwarf/test16-pr18904.so.abi index 805ff811..a7cc8997 100644 --- a/tests/data/test-read-dwarf/test16-pr18904.so.abi +++ b/tests/data/test-read-dwarf/test16-pr18904.so.abi @@ -2168,56 +2168,50 @@ - - + + - - - - - - - + - + - + - - + + - - + + - - + + - - + + - - + + - + @@ -2225,14 +2219,14 @@ - + - + @@ -2241,26 +2235,26 @@ - - + + - + - + - + @@ -2268,7 +2262,7 @@ - + @@ -2276,35 +2270,35 @@ - - + + - + - + - + - + - + - + @@ -2319,35 +2313,35 @@ - + - + - - + + - - + + - - + + - + @@ -2355,7 +2349,7 @@ - + @@ -2363,85 +2357,85 @@ - - + + - - + + - - + + - - + + - + - + - + - + - + - + - - + + - + - + - + - - + + - - + + - + - + @@ -2450,7 +2444,7 @@ - + @@ -2598,12 +2592,12 @@ - + - + - + @@ -2611,33 +2605,33 @@ - + - + - + - + - + - + - + - + @@ -2645,22 +2639,22 @@ - + - + - + - + - + - + @@ -2668,30 +2662,30 @@ - + - + - + - + - + - + - + @@ -2704,10 +2698,10 @@ - + - + @@ -2716,37 +2710,37 @@ - + - + - + - + - + - + - + - + - + - + @@ -2755,22 +2749,22 @@ - + - + - + - + - + - + @@ -2780,47 +2774,47 @@ - - + + - + - - + + - - - + + + - - + + - - + + - - - + + + @@ -2833,13 +2827,13 @@ - + - + @@ -2847,41 +2841,41 @@ - + - + - + - + - + - - + + - + @@ -2889,151 +2883,151 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + @@ -3054,29 +3048,29 @@ - + - + - + - + - + - + - + - + @@ -3085,33 +3079,33 @@ - + - + - + - + - + - + @@ -3120,13 +3114,13 @@ - + - + - + @@ -3135,31 +3129,31 @@ - + - + - + - + - + @@ -3168,53 +3162,53 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3223,40 +3217,40 @@ - + - + - + - + - + - + - + - + - + - + @@ -3277,10 +3271,10 @@ - + - + @@ -3304,81 +3298,81 @@ - + - - + + - - + + - + - + - + - + - + - + - + - + - - - + + + - + - + - + @@ -3387,11 +3381,11 @@ - + - + - + @@ -3399,20 +3393,20 @@ - + - + - + @@ -3420,12 +3414,12 @@ - + - - + + - + @@ -3433,69 +3427,69 @@ - + - + - + - + - - + + - + - + - - + + - + - + - + - + @@ -3503,22 +3497,22 @@ - + - + - - - + + + @@ -3527,44 +3521,44 @@ - + - + - - + + - - + + - - + + - - + + - - + + @@ -3572,12 +3566,12 @@ - - + + - - - + + + @@ -3587,36 +3581,36 @@ - + - + - - + + - - + + - + - + - + @@ -3632,7 +3626,7 @@ - + @@ -3647,21 +3641,21 @@ - + - + - + - + - + @@ -3672,14 +3666,14 @@ - + - + - + @@ -3689,7 +3683,7 @@ - + @@ -3698,18 +3692,18 @@ - + - + - + - + @@ -3718,17 +3712,17 @@ - + - + - + - + @@ -3736,38 +3730,38 @@ - + - - + + - + - - + + - + - + @@ -3776,32 +3770,32 @@ - + - - + + - - + + - + - + @@ -3809,14 +3803,14 @@ - + - + @@ -3834,7 +3828,7 @@ - + @@ -3845,7 +3839,7 @@ - + @@ -3855,21 +3849,21 @@ - + - + - + - + - + - + @@ -3879,7 +3873,7 @@ - + @@ -3887,9 +3881,9 @@ - + - + @@ -3899,7 +3893,7 @@ - + @@ -3907,20 +3901,20 @@ - + - + - + - + @@ -3935,19 +3929,19 @@ - + - + - + - + - + @@ -3956,7 +3950,7 @@ - + @@ -3964,34 +3958,40 @@ - + - + - + - + + + + + + + - - - - - - - - - + + + + + + + + + - - - + + + @@ -4009,7 +4009,7 @@ - + @@ -4081,37 +4081,37 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + @@ -4144,29 +4144,29 @@ - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + @@ -4250,7 +4250,7 @@ - + @@ -4422,8 +4422,8 @@ - - + + @@ -4465,7 +4465,7 @@ - + @@ -4486,12 +4486,12 @@ - + - + @@ -4515,7 +4515,7 @@ - + @@ -4609,8 +4609,8 @@ - - + + @@ -4646,17 +4646,17 @@ - - + + - - + + - - + + @@ -4676,11 +4676,11 @@ - - + + - - + + @@ -4692,14 +4692,14 @@ - - + + - - + + @@ -4796,10 +4796,10 @@ - + - + @@ -4960,7 +4960,7 @@ - + @@ -4979,7 +4979,7 @@ - + @@ -4999,7 +4999,7 @@ - + @@ -5023,7 +5023,7 @@ - + @@ -5037,7 +5037,7 @@ - + @@ -5050,7 +5050,7 @@ - + @@ -5070,7 +5070,7 @@ - + @@ -5171,10 +5171,10 @@ - + - + @@ -5252,7 +5252,7 @@ - + @@ -5287,7 +5287,7 @@ - + @@ -5349,7 +5349,7 @@ - + @@ -5377,7 +5377,7 @@ - + @@ -5392,7 +5392,7 @@ - + @@ -5418,7 +5418,7 @@ - + @@ -5431,7 +5431,7 @@ - + @@ -6274,7 +6274,7 @@ - + @@ -6287,7 +6287,7 @@ - + @@ -6300,7 +6300,7 @@ - + @@ -6323,7 +6323,7 @@ - + @@ -6691,7 +6691,7 @@ - + @@ -6699,13 +6699,13 @@ - + - + @@ -6713,7 +6713,7 @@ - + @@ -6742,7 +6742,7 @@ - + @@ -6750,7 +6750,7 @@ - + @@ -6758,28 +6758,28 @@ - + - + - + - + @@ -6805,10 +6805,10 @@ - + - + @@ -6819,10 +6819,10 @@ - + - + @@ -6845,7 +6845,7 @@ - + @@ -6859,7 +6859,7 @@ - + @@ -6988,7 +6988,7 @@ - + @@ -7002,7 +7002,7 @@ - + @@ -7145,7 +7145,7 @@ - + @@ -7231,7 +7231,7 @@ - + @@ -7244,26 +7244,26 @@ - + - - + + - + - - + + @@ -7345,7 +7345,7 @@ - + @@ -7357,7 +7357,7 @@ - + @@ -7381,7 +7381,7 @@ - + @@ -7429,10 +7429,10 @@ - + - + @@ -7516,10 +7516,10 @@ - + - + @@ -7896,13 +7896,13 @@ - + - + @@ -7914,13 +7914,13 @@ - + - + @@ -8453,7 +8453,7 @@ - + @@ -8468,7 +8468,7 @@ - + @@ -8484,7 +8484,7 @@ - + @@ -8492,7 +8492,7 @@ - + @@ -8514,7 +8514,7 @@ - + @@ -8529,7 +8529,7 @@ - + @@ -8545,7 +8545,7 @@ - + @@ -8553,7 +8553,7 @@ - + @@ -8647,7 +8647,7 @@ - + @@ -8655,14 +8655,14 @@ - + - + @@ -8670,8 +8670,8 @@ - - + + @@ -8685,7 +8685,7 @@ - + @@ -8693,8 +8693,8 @@ - - + + @@ -8811,8 +8811,8 @@ - - + + @@ -8822,8 +8822,8 @@ - - + + @@ -8858,7 +8858,7 @@ - + @@ -8910,7 +8910,7 @@ - + @@ -8918,7 +8918,7 @@ - + @@ -8934,7 +8934,7 @@ - + @@ -8942,7 +8942,7 @@ - + @@ -8950,7 +8950,7 @@ - + @@ -9150,7 +9150,7 @@ - + @@ -9628,8 +9628,8 @@ - - + + @@ -9667,14 +9667,14 @@ - + - + @@ -9694,7 +9694,7 @@ - + @@ -9773,21 +9773,21 @@ - + - + - + @@ -9873,7 +9873,7 @@ - + @@ -9937,14 +9937,14 @@ - + - + @@ -9985,7 +9985,7 @@ - + @@ -10023,7 +10023,7 @@ - + @@ -10084,7 +10084,7 @@ - + @@ -10142,7 +10142,7 @@ - + @@ -10154,7 +10154,7 @@ - + @@ -10535,7 +10535,7 @@ - + @@ -10551,7 +10551,7 @@ - + @@ -10582,7 +10582,7 @@ - + @@ -10715,15 +10715,15 @@ - - - - + + + + - + @@ -10738,7 +10738,7 @@ - + @@ -10749,8 +10749,8 @@ - - + + @@ -10761,8 +10761,8 @@ - - + + @@ -10775,14 +10775,14 @@ - - + + - + @@ -10791,8 +10791,8 @@ - - + + @@ -10804,19 +10804,19 @@ - - + + - + - + - + @@ -10830,7 +10830,7 @@ - + @@ -10844,7 +10844,7 @@ - + @@ -10861,18 +10861,18 @@ - + - + - + - + @@ -10883,10 +10883,10 @@ - + - + @@ -10928,7 +10928,7 @@ - + @@ -10952,7 +10952,7 @@ - + @@ -11005,7 +11005,7 @@ - + @@ -11029,7 +11029,7 @@ - + @@ -11168,7 +11168,7 @@ - + @@ -11181,7 +11181,7 @@ - + @@ -11189,8 +11189,8 @@ - - + + @@ -11329,7 +11329,7 @@ - + @@ -11370,7 +11370,7 @@ - + @@ -11406,7 +11406,7 @@ - + @@ -11436,7 +11436,7 @@ - + @@ -11701,7 +11701,7 @@ - + @@ -11725,7 +11725,7 @@ - + @@ -11742,7 +11742,7 @@ - + @@ -11759,7 +11759,7 @@ - + @@ -11793,7 +11793,7 @@ - + @@ -11817,7 +11817,7 @@ - + @@ -11840,7 +11840,7 @@ - + @@ -12171,7 +12171,7 @@ - + @@ -12189,8 +12189,8 @@ - - + + @@ -12213,14 +12213,14 @@ - + - + - + @@ -12235,10 +12235,10 @@ - + - + @@ -12247,20 +12247,20 @@ - - + + - + - + - + @@ -12302,11 +12302,11 @@ - + - + @@ -12327,7 +12327,7 @@ - + @@ -12339,7 +12339,7 @@ - + @@ -12364,7 +12364,7 @@ - + @@ -12373,15 +12373,15 @@ - - + + - - + + @@ -12391,42 +12391,42 @@ - - + + - - + + - + - + - + - - + + - + - - + + @@ -12436,7 +12436,7 @@ - + @@ -12447,7 +12447,7 @@ - + @@ -12458,7 +12458,7 @@ - + @@ -12469,18 +12469,18 @@ - - + + - + - + @@ -12490,30 +12490,30 @@ - + - + - + - + - + @@ -12531,35 +12531,35 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -12580,7 +12580,7 @@ - + @@ -12592,7 +12592,7 @@ - + @@ -12618,7 +12618,7 @@ - + @@ -12636,7 +12636,7 @@ - + @@ -12718,28 +12718,28 @@ - + - + - - + + - + - + - + - + @@ -12759,7 +12759,7 @@ - + @@ -12767,7 +12767,7 @@ - + @@ -12786,31 +12786,31 @@ - - + + - + - - - - + + + + - - - + + + - - + + @@ -12891,14 +12891,14 @@ - + - + @@ -12906,7 +12906,7 @@ - + @@ -13080,16 +13080,16 @@ - + - + - + @@ -13268,7 +13268,7 @@ - + @@ -13448,8 +13448,8 @@ - - + + @@ -13698,7 +13698,7 @@ - + @@ -13706,7 +13706,7 @@ - + @@ -13978,7 +13978,7 @@ - + @@ -13994,14 +13994,14 @@ - + - + @@ -14009,7 +14009,7 @@ - + @@ -14036,7 +14036,7 @@ - + @@ -14044,7 +14044,7 @@ - + @@ -14067,7 +14067,7 @@ - + @@ -14075,7 +14075,7 @@ - + @@ -14208,7 +14208,7 @@ - + @@ -14216,7 +14216,7 @@ - + @@ -14224,7 +14224,7 @@ - + @@ -14233,14 +14233,14 @@ - + - + @@ -14327,11 +14327,11 @@ - + - + @@ -14435,7 +14435,7 @@ - + @@ -14514,8 +14514,8 @@ - - + + @@ -14530,16 +14530,16 @@ - - + + - - + + @@ -14570,7 +14570,7 @@ - + @@ -14617,11 +14617,11 @@ - + - + - + @@ -15108,7 +15108,7 @@ - + @@ -15158,13 +15158,13 @@ - + - + @@ -15183,25 +15183,25 @@ - + - + - + - + - + @@ -15223,14 +15223,14 @@ - + - + @@ -15242,16 +15242,16 @@ - + - + - + @@ -15322,7 +15322,7 @@ - + @@ -15533,7 +15533,7 @@ - + @@ -16478,7 +16478,7 @@ - + @@ -16518,7 +16518,7 @@ - + @@ -16583,14 +16583,14 @@ - + - + @@ -16688,14 +16688,14 @@ - + - + @@ -16721,7 +16721,7 @@ - + @@ -17420,7 +17420,7 @@ - + @@ -17455,7 +17455,7 @@ - + @@ -17477,7 +17477,7 @@ - + @@ -17485,15 +17485,15 @@ - + - - + + @@ -17634,13 +17634,13 @@ - + - + @@ -17648,7 +17648,7 @@ - + @@ -17677,7 +17677,7 @@ - + @@ -17685,7 +17685,7 @@ - + @@ -17693,20 +17693,20 @@ - + - + - + @@ -17788,20 +17788,20 @@ - + - - + + - + @@ -17812,14 +17812,14 @@ - + - - + + @@ -17878,8 +17878,8 @@ - - + + @@ -18406,7 +18406,7 @@ - + @@ -18414,7 +18414,7 @@ - + @@ -18424,7 +18424,7 @@ - + @@ -18436,7 +18436,7 @@ - + @@ -18599,7 +18599,7 @@ - + @@ -18706,13 +18706,13 @@ - + - + @@ -18768,16 +18768,16 @@ - + - + - + @@ -18786,30 +18786,30 @@ - + - + - + - + - + - + - - + + @@ -18944,8 +18944,8 @@ - - + + @@ -19034,8 +19034,8 @@ - - + + @@ -19049,7 +19049,7 @@ - + @@ -19587,14 +19587,14 @@ - + - + @@ -19757,7 +19757,7 @@ - + @@ -19765,8 +19765,8 @@ - - + + @@ -19781,8 +19781,8 @@ - - + + @@ -20015,13 +20015,13 @@ - + - - + + @@ -20043,8 +20043,8 @@ - - + + @@ -20222,13 +20222,13 @@ - + - + @@ -20239,7 +20239,7 @@ - + @@ -20425,7 +20425,7 @@ - + @@ -20477,7 +20477,7 @@ - + @@ -20529,7 +20529,7 @@ - + @@ -20581,7 +20581,7 @@ - + @@ -20633,7 +20633,7 @@ - + @@ -20679,7 +20679,7 @@ - + @@ -20687,7 +20687,7 @@ - + @@ -20695,7 +20695,7 @@ - + @@ -20752,7 +20752,7 @@ - + @@ -20818,7 +20818,7 @@ - + @@ -20880,7 +20880,7 @@ - + @@ -20919,7 +20919,7 @@ - + @@ -20949,10 +20949,10 @@ - + - - + + @@ -20989,8 +20989,8 @@ - - + + @@ -21078,11 +21078,11 @@ - - + + - + @@ -21094,24 +21094,24 @@ - + - + - + - + - - + + - + @@ -21131,37 +21131,37 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -21206,7 +21206,7 @@ - + @@ -21254,92 +21254,92 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -21371,7 +21371,7 @@ - + @@ -21398,8 +21398,8 @@ - - + + @@ -21422,10 +21422,10 @@ - - + + - + @@ -21437,15 +21437,15 @@ - + - - + + @@ -21500,7 +21500,7 @@ - + @@ -21803,7 +21803,7 @@ - + @@ -21811,7 +21811,7 @@ - + @@ -21833,7 +21833,7 @@ - + @@ -22070,7 +22070,7 @@ - + @@ -22081,13 +22081,13 @@ - + - + @@ -22159,44 +22159,44 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -22207,24 +22207,24 @@ - + - + - + - + - + - + @@ -22235,10 +22235,10 @@ - + - + @@ -22249,10 +22249,10 @@ - + - + @@ -22263,10 +22263,10 @@ - + - + @@ -22311,7 +22311,7 @@ - + @@ -22320,14 +22320,14 @@ - + - + @@ -22335,14 +22335,14 @@ - + - + diff --git a/tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi b/tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi index 4b385657..698dcce2 100644 --- a/tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi +++ b/tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi @@ -12933,16 +12933,7 @@ - - - - - - - - - - + @@ -12950,6 +12941,15 @@ + + + + + + + + + @@ -14796,16 +14796,7 @@ - - - - - - - - - - + @@ -14813,6 +14804,15 @@ + + + + + + + + + diff --git a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi index e46bbec1..2ade2cff 100644 --- a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi +++ b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi @@ -22274,20 +22274,20 @@ - - - - - - - + + + + + + + @@ -22540,7 +22540,7 @@ - + @@ -41532,7 +41532,7 @@ - + @@ -41641,20 +41641,20 @@ - - - - - - - + + + + + + + @@ -41907,7 +41907,7 @@ - + @@ -48396,15 +48396,7 @@ - - - - - - - - - + @@ -48413,6 +48405,14 @@ + + + + + + + + @@ -52359,15 +52359,15 @@ - + - + - + - + From patchwork Fri Oct 20 10:00:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78215 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 2FF313858D39 for ; Fri, 20 Oct 2023 10:00:57 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 19C503858C52 for ; Fri, 20 Oct 2023 10:00:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19C503858C52 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 19C503858C52 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=1697796053; cv=none; b=drHh4G3UlZLxic+twAAvsWK13vIYDI46SE3ELhAkf/xjSP87b0SHqe/TH/DvmnTWDO4txLtrWEcKMqOxrqoP8kTCgksuL9ARovjNKi9ljqeX3nql0t/mLhYZd8zP8+rlWBdFR9j4TOd3KCfhifCk0yOPw7WZ0/wpn7ya2QdjqYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796053; c=relaxed/simple; bh=qJMqcAIymKY6n3c9h31LaBmsTHKBdvHn1kIFG179Svc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=trf7e+egW1tfsnqq0mqBwCOEZKrSP1yzboxwgtUftSNP4EBqn7a9pJHISsafudNqgUvx3WBudcB+YZ+M77p3XSS9zHWbhBBu9Q47Gdg60w6EhCBUYYqn8bTvsTVG3sPIIZyfWNF6AuZLIPEPCJxX6sdCQmeK1LWmZz5sKhCQy98= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697796049; 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=4cgwK2KeW6Z80EisHP2lDVcOwke9sJqqzZqSNxjozmQ=; b=N0zNuqobtO6shm9RO2E/lRw+5SPKTiTg2xGiFaxphQjpYpKT/1ZE6EK14NdTu5ZddiFqUB Ee8MnsWele7tNYjZvgDBagMphNyvBeDNTxhQ1X/26J9apvpSaoS14vgSzR9HlxfLgKGOiZ N9w4ekHVFL9fklPUjkt954Y1op5fgY8= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-L2pf7p30O2i4QO0q9RLCSg-1; Fri, 20 Oct 2023 06:00:47 -0400 X-MC-Unique: L2pf7p30O2i4QO0q9RLCSg-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7789577b582so71140785a.0 for ; Fri, 20 Oct 2023 03:00:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697796047; x=1698400847; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4cgwK2KeW6Z80EisHP2lDVcOwke9sJqqzZqSNxjozmQ=; b=LHb/IE60T+2Q3ejwpgZU2TNakU+lxjcTHDZ2HMBaonnozw8G8Te1PEdizO4oOLtX1R J11Q9P0tLM9MJ0G7bVV703sxTmv4BBXY6NTGnMTpRyy8wpG1B0o+FmvmAX+5i/jJyATj uFeLlK5EWi7V70QNx2XxRmRi5y8m2lyp3UT/KS9UlOpqlOubIKnSzT2PBWR3B5gRISYn 1hbkZGLzkpW7hZ8ibQFGEyoJepxggJloqvreQHC+nOGe3N0XYHWIRCUoAJnx8pvJS37S Q0CRu3Go1rmCfU6/XcmhEiu0xGsn3BW/HXDJK9NrRqWlcxkYvEnqYwX+PBL3+vy8FO+3 Q83g== X-Gm-Message-State: AOJu0Yzyo+DEir3j3XbTvZW9Ui4QtuSO7n0zxkgR7B7TT1nkbgUCzNTk p38tixfcRCC72XLXDH/vywgg9VfKaIEvtkv/7Up46beCs/05ig1mQwubFtfaRxiGk+b3W/ZcM3a POE0zUTqsOjFCySNCM3EjCni7jGd9 X-Received: by 2002:a05:620a:2714:b0:774:1e10:6822 with SMTP id b20-20020a05620a271400b007741e106822mr1192852qkp.77.1697796046552; Fri, 20 Oct 2023 03:00:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOgtzgi+QWrBg7WRxX1ezlVbHV6HN5WHt2nVjdvtxdtk+HWOaViPvUskeN5iNcqn0U96KFiA== X-Received: by 2002:a05:620a:2714:b0:774:1e10:6822 with SMTP id b20-20020a05620a271400b007741e106822mr1192833qkp.77.1697796046167; Fri, 20 Oct 2023 03:00:46 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id v10-20020ae9e30a000000b00777611164c6sm484280qkf.15.2023.10.20.03.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:00:45 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 66E2E5077C49; Fri, 20 Oct 2023 12:00:43 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 4/7, applied] ir, comparison: Represent changed anonymous enums Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 12:00:43 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <87v8b162b8.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Now that added/removed non-reachable anonymous enums is supported, we want to represent changing an anonymous enum. Strictly speaking, adding or removing an enumerator from an anonymous enum is represented as deleting of the anonymous enum in the old state and the addition of an anonymous enum in the new state. This patch analyses the added/removed anonymous enums and if the old enum has enumerators contained in the new one, then it assumes we are looking at anonymous enum change. * include/abg-ir.h (is_enumerator_present_in_enum): Declare new public function. * src/abg-ir.cc (is_enumerator_present_in_enum): Turn this static function into a public one. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Detect that an removed/added anonymous enum is actually a changed anonymous enum and represent it as such. * tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v{0,1}.txt: New reference test output files. * tests/data/test-abidiff-exit/test-anonymous-enums-change-v{0,1}.c: Source code for the some input test binary. * tests/data/test-abidiff-exit/test-anonymous-enums-change-v{0,1}.o: New test input binaries. * tests/data/Makefile.am: Add the new test materials above to source distribution. * tests/test-abidiff-exit.cc (in_out_specs): Add the new test input to the harness. Signed-off-by: Dodji Seketeli Applied to master. --- include/abg-ir.h | 4 + src/abg-comparison.cc | 76 ++++++++++++++++++ src/abg-ir.cc | 2 +- tests/data/Makefile.am | 6 ++ .../test-anonymous-enums-change-report-v0.txt | 16 ++++ .../test-anonymous-enums-change-report-v1.txt | 21 +++++ .../test-anonymous-enums-change-v0.c | 36 +++++++++ .../test-anonymous-enums-change-v0.o | Bin 0 -> 3296 bytes .../test-anonymous-enums-change-v1.c | 41 ++++++++++ .../test-anonymous-enums-change-v1.o | Bin 0 -> 3336 bytes tests/test-abidiff-exit.cc | 32 ++++++++ 11 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o new file mode 100644 index 00000000..886dbd2b index fb3d6fff..4c1eaea5 100644 diff --git a/include/abg-ir.h b/include/abg-ir.h index 3729e84a..b599ef3e 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2813,6 +2813,10 @@ public: set_enum_type(enum_type_decl*); }; // end class enum_type_def::enumerator +bool +is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr, + const enum_type_decl &enom); + bool equals(const typedef_decl&, const typedef_decl&, change_kind*); diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 61fe89e0..1126ed58 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include "abg-comparison-priv.h" #include "abg-reporter-priv.h" @@ -9619,6 +9620,81 @@ corpus_diff::priv::ensure_lookup_tables_populated() added_unreachable_types_[repr] = t; } } + + // Handle anonymous enums that got changed. An anonymous enum is + // designated by its flat textual representation. So a change to + // any of its enumerators results in a different enum. That is + // represented by a deletion of the previous anonymous enum, and + // the addition of a new one. For the user however, it's the same + // enum that changed. Let's massage this "added/removed" pattern + // to show what the user expects, namely, a changed anonymous + // enum. + { + std::set deleted_anon_enums; + std::set added_anon_enums; + + for (auto entry : deleted_unreachable_types_) + if (is_enum_type(entry.second) + && is_enum_type(entry.second)->get_is_anonymous()) + deleted_anon_enums.insert(is_enum_type(entry.second)); + + for (auto entry : added_unreachable_types_) + if (is_enum_type(entry.second) + && is_enum_type(entry.second)->get_is_anonymous()) + added_anon_enums.insert(is_enum_type(entry.second)); + + string_type_base_sptr_map added_anon_enum_to_erase; + string_type_base_sptr_map removed_anon_enum_to_erase; + + // Look for deleted anonymous enums which have enumerators + // present in an added anonymous enums ... + for (auto deleted_enum : deleted_anon_enums) + { + // Look for any enumerator of 'deleted_enum' that is also + // present in an added anonymous enum. + for (auto enr : deleted_enum->get_enumerators()) + { + bool this_enum_got_changed = false; + for (auto added_enum : added_anon_enums) + { + if (is_enumerator_present_in_enum(enr, *added_enum)) + { + // So the enumerator 'enr' from the + // 'deleted_enum' enum is also present in the + // 'added_enum' enum so we assume that + // 'deleted_enum' and 'added_enum' are the same + // enum that got changed. Let's represent it + // using a diff node. + diff_sptr d = compute_diff(deleted_enum, + added_enum, ctxt); + ABG_ASSERT(d->has_changes()); + string repr = + abigail::ir::get_pretty_representation(is_type(deleted_enum), + /*internal=*/false); + changed_unreachable_types_[repr]= d; + this_enum_got_changed = true; + string r1 = abigail::ir::get_pretty_representation(is_type(deleted_enum)); + string r2 = abigail::ir::get_pretty_representation(is_type(added_enum)); + removed_anon_enum_to_erase[r1] = deleted_enum; + added_anon_enum_to_erase[r2] = added_enum; + break; + } + } + if (this_enum_got_changed) + break; + } + } + + // Now remove the added/removed anonymous enums from their maps, + // as they are now represented as a changed enum, not an added + // and removed enum. + + for (auto entry : added_anon_enum_to_erase) + added_unreachable_types_.erase(entry.first); + + for (auto entry : removed_anon_enum_to_erase) + deleted_unreachable_types_.erase(entry.first); + } } } diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 06dfbe20..171267f8 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -18997,7 +18997,7 @@ enum_has_non_name_change(const enum_type_decl& l, /// /// @return true iff the enumerator @p enr is present in the enum @p /// enom. -static bool +bool is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr, const enum_type_decl &enom) { diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 1aa37b16..adb6d8bd 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -356,6 +356,12 @@ test-abidiff-exit/test-enumerator-changes1-v0.c \ test-abidiff-exit/test-enumerator-changes1-v0.o \ test-abidiff-exit/test-enumerator-changes1-v1.c \ test-abidiff-exit/test-enumerator-changes1-v1.o \ +test-abidiff-exit/test-anonymous-enums-change-report-v0.txt \ +test-abidiff-exit/test-anonymous-enums-change-report-v1.txt \ +test-abidiff-exit/test-anonymous-enums-change-v0.c \ +test-abidiff-exit/test-anonymous-enums-change-v0.o \ +test-abidiff-exit/test-anonymous-enums-change-v1.c \ +test-abidiff-exit/test-anonymous-enums-change-v1.o \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt new file mode 100644 index 00000000..2a408ea0 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt @@ -0,0 +1,16 @@ +Functions changes summary: 0 Removed, 0 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable +Unreachable types summary: 0 removed, 1 changed (1 filtered out), 1 added types + +1 changed type unreachable from any public interface: + + [C] 'enum {E4_0=0, E4_1=1, E4_2=2, E4_LAST_ELEMENT=3, }' changed: + type size hasn't changed + 2 enumerator deletions: + 'E4_2' value '2' + 'E4_LAST_ELEMENT' value '3' + +1 added type unreachable from any public interface: + + [A] 'enum {E5_0=0, E5_1=1, }' at test-anonymous-enums-change-v1.c:26:1 + diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt new file mode 100644 index 00000000..8639fa44 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt @@ -0,0 +1,21 @@ +Functions changes summary: 0 Removed, 0 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable +Unreachable types summary: 0 removed, 2 changed, 1 added types + +2 changed types unreachable from any public interface: + + [C] 'enum {E4_0=0, E4_1=1, E4_2=2, E4_LAST_ELEMENT=3, }' changed: + type size hasn't changed + 2 enumerator deletions: + 'E4_2' value '2' + 'E4_LAST_ELEMENT' value '3' + + [C] 'enum {E3_0=0, E3_1=1, }' changed: + type size hasn't changed + 1 enumerator insertion: + 'E3_2' value '2' + +1 added type unreachable from any public interface: + + [A] 'enum {E5_0=0, E5_1=1, }' at test-anonymous-enums-change-v1.c:26:1 + diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c new file mode 100644 index 00000000..443eb971 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c @@ -0,0 +1,36 @@ +/* + * Compile this with: + * gcc -c -g -fno-eliminate-unused-debug-types test-anonymous-enums-change-v0.c + */ + +enum + { + E1_0, + E1_1, + } v1; + +enum + { + E3_0, + E3_1, + }; + +enum + { + E4_0, + E4_1, + E4_2, + E4_LAST_ELEMENT + }; + +enum + { + E0_0, + E0_1, + } v0; + +enum + { + E2_0, + E2_1, + } v2; diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..26c6df80f0d5203c520890f433cd5bba20b0bc4f GIT binary patch literal 3296 zcmb_e&2Jl35P$2nNn4Y&sU^Nrl6BRJ1laZ3aYJd9U=*3O5Gn*kLR_4+{p>8*>)>6R zL})`WoOXA z9GAtpMG(%Ks3NI=*$zm@0u)^MSc8>IMy+NXx$uSN0ySK*h=E#-;?L8b6>;U;W1hlT z7UtZgJnSoLY!qkm#q90EjiPZg|7_7T3h)M1VV)r%cf0W1qnSs9$j%#A=L&gqX<_NY z!*DuRL_WWfH|HSrC3rIM2$48WrN>JJSPpDY0yhlfuen)d_=fO+utcxClsO-#QDLJX z^t*v9`YNicpl;oH-P$Za zW0lKJ)hSyQx3cQ4x!0`aS0Vc?FCv3oS+VSXGz#Q;R|azEw?OrVt=;wg>udH})gD(Y zyKC8m!VawIQNx*ap>x6r!UwTS#kgGG^?3CtiTC0+xk@CfjS52zX3iL|G7!g~137t0yhFtCG+u-U>0-0~3((?n!Ay9%vgd0k44f=fvKRr$`h@=Cv%nl>3#c#$N{%?E%!tiYQ zJUL5^1&yO`lCVDz(6DQ5_$R=I_v)m0eKJkv1m(oVfJU+fFa zS(|vo!VWdnpA>+-hkiT*;D3msby)SBXjmlh73Fob=)P#zG4u`yv`|Tq?)wth()Rxb z{WS1CasLSE`)>oL=LAT6N+8b*#E^8~24HFR_o)6Y6&2rIoMU?ZJ<92lAG1R$bjSd4 zuFw2Ez){xYKgz@be^4AVj${4_7}DbJQA6@PKPevPBIjZsH3f1ireO;)}B{0Z^j)A##w5*Z76{6Aj89Torp literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c @@ -0,0 +1,41 @@ +/* + * Compile this with: + * gcc -c -g -fno-eliminate-unused-debug-types test-anonymous-enums-change-v1.c + */ + +enum + { + E1_0, + E1_1, + } v1; + +enum + { + E3_0, + E3_1, + E3_2 + }; + +enum + { + E4_0, + E4_1, + }; + +enum + { + E5_0, + E5_1, + }; + +enum + { + E0_0, + E0_1, + } v0; + +enum + { + E2_0, + E2_1, + } v2; diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..7d0f71b47a47d0a7eb893ddd41c4515cfb4b28fa GIT binary patch literal 3336 zcmb_eO>7%g5T5ngq^(JsG>D(JkTtX=q3o``aY6}7YAFqA1*#Ad7cORPKRXNdI`Xbf zB7|Cr3j&D?91s^SaN>jnhe`->=$%u!aOsH)2gHd32bg&~FWEeAFhY#9Z)U#vdprBy z*tfP`elcelpvZs?IMfsh@cxNIxhBOLoPjy`73BgL(wZmyacSfww}QeHElEzf8c@hj zk%Kv^z^NxtIBAkfBm<_qD5V3WoJ))ky{8!y`0Qtyu=TYLo1-#3Mb28$OFxf$da!i& zh$k3}V9uN`;zskvMro>8%HNn@D;X~opD&rlJibyD%o7Y0Zp>eOEcYlte$Kc!GhZ|p z&MnM7g6+Bh#o|WMoWa!R@yX!>km|40lf^?;K-)9O4a4|zW||oF10NI?lGYdtxzkA+ z88!@~pc9Ig6@)QtRqAD0DzH^1X(d^tic6K$Dp{9FT23Snwr{>>ZC0MMDix>dR4lLT zEtglzE7szxnD@FLv%&V3EV~yEL$Tfwp%?^BRQ*A7XMOL=s=ZpZN1kPOEV~`{ZP5*S zLFmWA9)`n6wCt8>3_Etbzbhix@~FIrF&Rjgtw}W8jmB%%$E-y~#z!m9F?ABMGv!}@Dl51Q@E-{&{7Jg{HmU-;i}#h4QCa$ zS)lW!auD=7<7)pj^NHS&YqEE$yT*E3!>_XbwuWD3{ap<&v;L8W(?BKqBw?~=R9E%q zOAW_)Ea@u^zr^}?%;|m8r|U<}{~OltY4{!1e_>8}PP0r*odN1wA%)ZVBvRk^twe=q znJfHT)+-wR6YJna`@Pt2Add$L-%(O5_F`~oG=kHJB5($x>pOBN*MqR#M;i_3y5DFF z#OR3GAJ8~H8qy6yp+c~P5(%zLz1i>e1pXp9VLuiQ4mvxE{ib>|wc-E9&tVw#R`pY5 zsVPC@1eaWt4 X-Patchwork-Id: 78216 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 A0F7D3858D39 for ; Fri, 20 Oct 2023 10:01:50 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 2CF1C38582BD for ; Fri, 20 Oct 2023 10:01:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CF1C38582BD 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 2CF1C38582BD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796106; cv=none; b=BRUIle9r7CITnKND2hqpHIMA+KNVksIptF/QqtqL2HM4cbjAK5d4d3zCsqS8QaYyaXcdWa9o+UV34PE2gCHER4emrd95yonSvWRiwOtMD8Vav7WvqaNtT/2GagYbTY5e4S9NgPsAbZEw8fpADg2SpfBmzh2MJnsDIJWt+YH4Whs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796106; c=relaxed/simple; bh=zRD1IyXv5zLcgsa+5kvkMDcz8iPZ+S1G/+rCj334NWs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WX52dm5uWl/oxf2cpGBnocpBU/OUH3h708Hn+2JsoJK+Tv+uxpYVmJsyqDWHIS5rusv9GmpEoI7E5SJ4R9jcWkVT653o+Jd7v4R3yDEn4IuDf6ZSytsvy1i4vlK2zQDxdT09wSd6zy5ZMqqENMwyh8ZzPAYEd6mZTLziy967Ado= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697796102; 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=1BdPAvXAuhBnIJmD+6ciFsWRBga3YK6n8Y6c+IeC7xw=; b=Ywtx2j/lP+05pCjfHizqCz0RSR5GeoegI4/T8Lq3wyTpS/BaD9l3rKImug4UwOcU8R/4tZ h9ElJ0EW1qNNkewz3XmkvZSIx09pCkvQqsDRlUA8bEolCB3jcixQyiGIrq5Ocd0Sxpa2yO /bhmDYV/+Dwpc1EcjpL57l/fVbSZ8F8= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-9a8eDKyXMVmkyxouAb2A0w-1; Fri, 20 Oct 2023 06:01:41 -0400 X-MC-Unique: 9a8eDKyXMVmkyxouAb2A0w-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-77892f2ee51so74058685a.1 for ; Fri, 20 Oct 2023 03:01:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697796101; x=1698400901; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1BdPAvXAuhBnIJmD+6ciFsWRBga3YK6n8Y6c+IeC7xw=; b=Qs7py4SAgmA+D+uKjj4TDO2NbfouTO4AbzpvnD93WygzJgwjSBrLNH/NynISMQf81V t5YLhu8v/OeWdeDOXVHHKPbysHhW4S0RFbUW+aLQUCHg7QOsOdWQXw/ZlDuduBJ4+oND M176j18RbGpS0Q6TN+5rG7damn1nOQ+cIht7TkE+hR4i110eGMbVvTdbJTINCMlT71ZD EnZ9BJ8evYBQAs0yxVg3D+tdK5KQnGfg98KWcXB0J3V9Meir2hz6UYtLETGMQ9hdu2P3 GCJzbWk7BmKHbG4DqAphiS1sW+ozwAgcQjaGZsGLGIYEK+OgACou+/ykwR9IkBR6N9JD HIyQ== X-Gm-Message-State: AOJu0YxYSgUTIjV2UBHKhCMYtQIOfKbvaRhIDHcXhLtJwAHb+2J1WqIJ G+agNAFNPGHNNDdy9vLEB1o+LtKmyRnjmsAh2bdGnaZcu4uQMXXSEJ9u8MUVApRNidBiAnd5sCE DbyaWQgUOw3ryF4+hbTt6 X-Received: by 2002:a05:622a:134d:b0:41c:c692:e3ed with SMTP id w13-20020a05622a134d00b0041cc692e3edmr1499078qtk.34.1697796099772; Fri, 20 Oct 2023 03:01:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzKeTUVh7WmdTnPbf0sotf7ia+CD4wxx6OKVsyABDxE/GCOG46pg9bsD+WJcjFkcXrkQ6ujw== X-Received: by 2002:a05:622a:134d:b0:41c:c692:e3ed with SMTP id w13-20020a05622a134d00b0041cc692e3edmr1499029qtk.34.1697796098920; Fri, 20 Oct 2023 03:01:38 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id l9-20020ac80789000000b00419732075b4sm468502qth.84.2023.10.20.03.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:01:38 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id BCFD95077C49; Fri, 20 Oct 2023 12:01:36 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 5/7, applied] comparison: Represent changed unreachable anonymous unions, structs & enums Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 12:01:36 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <87r0lp629r.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Following the changes to represent changed anonymous unreachable enums, this patch does the same for anonymous unreachable unions, classes and structs. Basically, without this patch, this change: union { int a; int b; }; ------ union { int a; int b; int c; }; yields: 1 removed type unreachable from any public interface: [D] 'union {int a; int b;}' at test_1.c:1:1 1 added type unreachable from any public interface: [A] 'union {int a; int b; int c;}' at test_2.c:1:1 But with the patch, it does yield: 1 changed type unreachable from any public interface: [C] 'union {int a; int b;}' changed: type size hasn't changed 1 data member insertion: 'int c' at test-anon-union-v1.c:5:1 type changed from: union {int a; int b;} to: union {int a; int b; int c;} * include/abg-fwd.h (class_or_union_types_of_same_kind) (is_data_member_of_anonymous_class_or_union): Declare new functions. * include/abg-ir.h (lookup_data_member): Likewise, declare a new overload. * src/abg-ir.cc (class_or_union_types_of_same_kind) (lookup_data_member, is_data_member_of_anonymous_class_or_union): Define news functions & overloads. * src/abg-reporter-priv.cc (represent): When representing a change in the name of a data member, if the context is an anonymous type, use the non-qualified name of the data member, not its qualified name. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Handle deleted/added anonymous enums, unions, classes and structs similarly. That is, if an anonymous type was removed and another one got added, if they both have data members (or enumerators) in common, then we are probably looking at an anonymous type that was changed. This is because these anonymous types are named using their flat representation. * tests/data/test-abidiff-exit/test-anon-types-report-1.txt: New reference test comparison output. * tests/data/test-abidiff-exit/test-anon-types-v{0,1}.o: New binary tests input files. * tests/data/test-abidiff-exit/test-anon-types-v{0,1}.c: Source code of new binary test input. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-abidiff-exit.cc (in_out_specs): Add the test inputs above to this test harness. Signed-off-by: Dodji Seketeli Applied to master. --- include/abg-fwd.h | 17 ++ include/abg-ir.h | 4 + src/abg-comparison.cc | 162 ++++++++++++------ src/abg-ir.cc | 92 ++++++++++ src/abg-reporter-priv.cc | 8 +- tests/data/Makefile.am | 5 + .../test-anon-types-report-1.txt | 31 ++++ .../test-abidiff-exit/test-anon-types-v0.c | 42 +++++ .../test-abidiff-exit/test-anon-types-v0.o | Bin 0 -> 3240 bytes .../test-abidiff-exit/test-anon-types-v1.c | 33 ++++ .../test-abidiff-exit/test-anon-types-v1.o | Bin 0 -> 3168 bytes tests/test-abidiff-exit.cc | 16 ++ 12 files changed, 360 insertions(+), 50 deletions(-) create mode 100644 tests/data/test-abidiff-exit/test-anon-types-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v0.c create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v0.o create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v1.c create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v1.o new file mode 100644 index 00000000..73716a1f index 4c1eaea5..b9ea4792 100644 diff --git a/include/abg-fwd.h b/include/abg-fwd.h index e494de07..0edc9927 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -495,6 +495,14 @@ is_class_or_union_type(const type_or_decl_base*); class_or_union_sptr is_class_or_union_type(const type_or_decl_base_sptr&); +bool +class_or_union_types_of_same_kind(const class_or_union *, + const class_or_union*); + +bool +class_or_union_types_of_same_kind(const class_or_union_sptr&, + const class_or_union_sptr&); + bool is_union_type(const type_or_decl_base&); @@ -731,6 +739,15 @@ is_anonymous_data_member(const var_decl*); bool is_anonymous_data_member(const var_decl&); +bool +is_data_member_of_anonymous_class_or_union(const var_decl&); + +bool +is_data_member_of_anonymous_class_or_union(const var_decl*); + +bool +is_data_member_of_anonymous_class_or_union(const var_decl_sptr&); + const var_decl_sptr get_first_non_anonymous_data_member(const var_decl_sptr); diff --git a/include/abg-ir.h b/include/abg-ir.h index b599ef3e..0cb378ad 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -4626,6 +4626,10 @@ const var_decl* lookup_data_member(const type_base* type, const char* dm_name); +const var_decl_sptr +lookup_data_member(const type_base_sptr& type, + const var_decl_sptr& dm); + const function_decl::parameter* get_function_parameter(const decl_base* fun, unsigned parm_num); diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 1126ed58..8a705c54 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -9630,69 +9630,135 @@ corpus_diff::priv::ensure_lookup_tables_populated() // to show what the user expects, namely, a changed anonymous // enum. { - std::set deleted_anon_enums; - std::set added_anon_enums; + std::set deleted_anon_types; + std::set added_anon_types; for (auto entry : deleted_unreachable_types_) - if (is_enum_type(entry.second) - && is_enum_type(entry.second)->get_is_anonymous()) - deleted_anon_enums.insert(is_enum_type(entry.second)); - - for (auto entry : added_unreachable_types_) - if (is_enum_type(entry.second) - && is_enum_type(entry.second)->get_is_anonymous()) - added_anon_enums.insert(is_enum_type(entry.second)); + { + if ((is_enum_type(entry.second) + && is_enum_type(entry.second)->get_is_anonymous()) + || (is_class_or_union_type(entry.second) + && is_class_or_union_type(entry.second)->get_is_anonymous())) + deleted_anon_types.insert(entry.second); + } - string_type_base_sptr_map added_anon_enum_to_erase; - string_type_base_sptr_map removed_anon_enum_to_erase; - // Look for deleted anonymous enums which have enumerators - // present in an added anonymous enums ... - for (auto deleted_enum : deleted_anon_enums) + for (auto entry : added_unreachable_types_) + if ((is_enum_type(entry.second) + && is_enum_type(entry.second)->get_is_anonymous()) + || (is_class_or_union_type(entry.second) + && is_class_or_union_type(entry.second)->get_is_anonymous())) + added_anon_types.insert(entry.second); + + string_type_base_sptr_map added_anon_types_to_erase; + string_type_base_sptr_map removed_anon_types_to_erase; + enum_type_decl_sptr deleted_enum; + class_or_union_sptr deleted_class; + + // Look for deleted anonymous types (enums, unions, structs & + // classes) which have enumerators or data members present in an + // added anonymous type ... + for (auto deleted: deleted_anon_types) { - // Look for any enumerator of 'deleted_enum' that is also - // present in an added anonymous enum. - for (auto enr : deleted_enum->get_enumerators()) + deleted_enum = is_enum_type(deleted); + deleted_class = is_class_or_union_type(deleted); + + // For enums, look for any enumerator of 'deleted_enum' that + // is also present in an added anonymous enum. + if (deleted_enum) { - bool this_enum_got_changed = false; - for (auto added_enum : added_anon_enums) + for (auto enr : deleted_enum->get_enumerators()) { - if (is_enumerator_present_in_enum(enr, *added_enum)) + bool this_enum_got_changed = false; + for (auto t : added_anon_types) { - // So the enumerator 'enr' from the - // 'deleted_enum' enum is also present in the - // 'added_enum' enum so we assume that - // 'deleted_enum' and 'added_enum' are the same - // enum that got changed. Let's represent it - // using a diff node. - diff_sptr d = compute_diff(deleted_enum, - added_enum, ctxt); - ABG_ASSERT(d->has_changes()); - string repr = - abigail::ir::get_pretty_representation(is_type(deleted_enum), - /*internal=*/false); - changed_unreachable_types_[repr]= d; - this_enum_got_changed = true; - string r1 = abigail::ir::get_pretty_representation(is_type(deleted_enum)); - string r2 = abigail::ir::get_pretty_representation(is_type(added_enum)); - removed_anon_enum_to_erase[r1] = deleted_enum; - added_anon_enum_to_erase[r2] = added_enum; - break; + if (enum_type_decl_sptr added_enum = is_enum_type(t)) + if (is_enumerator_present_in_enum(enr, *added_enum)) + { + // So the enumerator 'enr' from the + // 'deleted_enum' enum is also present in the + // 'added_enum' enum so we assume that + // 'deleted_enum' and 'added_enum' are the same + // enum that got changed. Let's represent it + // using a diff node. + diff_sptr d = compute_diff(deleted_enum, + added_enum, ctxt); + ABG_ASSERT(d->has_changes()); + string repr = + abigail::ir::get_pretty_representation(is_type(deleted_enum), + /*internal=*/false); + changed_unreachable_types_[repr]= d; + this_enum_got_changed = true; + string r1 = + abigail::ir::get_pretty_representation(is_type(deleted_enum), + /*internal=*/false); + string r2 = + abigail::ir::get_pretty_representation(is_type(added_enum), + /*internal=*/false); + removed_anon_types_to_erase[r1] = deleted_enum; + added_anon_types_to_erase[r2] = added_enum; + break; + } } + if (this_enum_got_changed) + break; + } + } + else if (deleted_class) + { + // For unions, structs & classes, look for any data + // member of 'deleted_class' that is also present in an + // added anonymous class. + for (auto dm : deleted_class->get_data_members()) + { + bool this_class_got_changed = false; + for (auto klass : added_anon_types) + { + if (class_or_union_sptr added_class = + is_class_or_union_type(klass)) + if (class_or_union_types_of_same_kind(deleted_class, + added_class) + && lookup_data_member(added_class, dm)) + { + // So the data member 'dm' from the + // 'deleted_class' class is also present in + // the 'added_class' class so we assume that + // 'deleted_class' and 'added_class' are the + // same anonymous class that got changed. + // Let's represent it using a diff node. + diff_sptr d = compute_diff(is_type(deleted_class), + is_type(added_class), + ctxt); + ABG_ASSERT(d->has_changes()); + string repr = + abigail::ir::get_pretty_representation(is_type(deleted_class), + /*internal=*/false); + changed_unreachable_types_[repr]= d; + this_class_got_changed = true; + string r1 = + abigail::ir::get_pretty_representation(is_type(deleted_class), + /*internal=*/false); + string r2 = + abigail::ir::get_pretty_representation(is_type(added_class), + /*internal=*/false); + removed_anon_types_to_erase[r1] = deleted_class; + added_anon_types_to_erase[r2] = added_class; + break; + } + } + if (this_class_got_changed) + break; } - if (this_enum_got_changed) - break; } } - // Now remove the added/removed anonymous enums from their maps, - // as they are now represented as a changed enum, not an added - // and removed enum. - - for (auto entry : added_anon_enum_to_erase) + // Now remove the added/removed anonymous types from their maps, + // as they are now represented as a changed type, not an added + // and removed anonymous type. + for (auto entry : added_anon_types_to_erase) added_unreachable_types_.erase(entry.first); - for (auto entry : removed_anon_enum_to_erase) + for (auto entry : removed_anon_types_to_erase) deleted_unreachable_types_.erase(entry.first); } } diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 171267f8..bb9483c9 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -6061,6 +6061,47 @@ is_anonymous_data_member(const var_decl& d) && is_class_or_union_type(d.get_type())); } +/// Test if a @ref var_decl is a data member belonging to an anonymous +/// type. +/// +/// @param d the @ref var_decl to consider. +/// +/// @return true iff @p d is a data member belonging to an anonymous +/// type. +bool +is_data_member_of_anonymous_class_or_union(const var_decl& d) +{ + if (is_data_member(d)) + { + scope_decl* scope = d.get_scope(); + if (scope && scope->get_is_anonymous()) + return true; + } + return false; +} + +/// Test if a @ref var_decl is a data member belonging to an anonymous +/// type. +/// +/// @param d the @ref var_decl to consider. +/// +/// @return true iff @p d is a data member belonging to an anonymous +/// type. +bool +is_data_member_of_anonymous_class_or_union(const var_decl* d) +{return is_data_member_of_anonymous_class_or_union(*d);} + +/// Test if a @ref var_decl is a data member belonging to an anonymous +/// type. +/// +/// @param d the @ref var_decl to consider. +/// +/// @return true iff @p d is a data member belonging to an anonymous +/// type. +bool +is_data_member_of_anonymous_class_or_union(const var_decl_sptr& d) +{return is_data_member_of_anonymous_class_or_union(d.get());} + /// Get the @ref class_or_union type of a given anonymous data member. /// /// @param d the anonymous data member to consider. @@ -10791,6 +10832,36 @@ shared_ptr is_class_or_union_type(const shared_ptr& t) {return dynamic_pointer_cast(t);} +/// Test if two class or union types are of the same kind. +/// +/// @param first the first type to consider. +/// +/// @param second the second type to consider. +/// +/// @return true iff @p first is of the same kind as @p second. +bool +class_or_union_types_of_same_kind(const class_or_union* first, + const class_or_union* second) +{ + if ((is_class_type(first) && is_class_type(second)) + || (is_union_type(first) && is_union_type(second))) + return true; + + return false; +} + +/// Test if two class or union types are of the same kind. +/// +/// @param first the first type to consider. +/// +/// @param second the second type to consider. +/// +/// @return true iff @p first is of the same kind as @p second. +bool +class_or_union_types_of_same_kind(const class_or_union_sptr& first, + const class_or_union_sptr& second) +{return class_or_union_types_of_same_kind(first.get(), second.get());} + /// Test if a type is a @ref union_decl. /// /// @param t the type to consider. @@ -27430,6 +27501,27 @@ lookup_data_member(const type_base* type, return cou->find_data_member(dm_name).get(); } +/// Look for a data member of a given class, struct or union type and +/// return it. +/// +/// The data member is designated by its name. +/// +/// @param type the class, struct or union type to consider. +/// +/// @param dm the data member to lookup. +/// +/// @return the data member iff it was found in @type or NULL if no +/// data member with that name was found. +const var_decl_sptr +lookup_data_member(const type_base_sptr& type, const var_decl_sptr& dm) +{ + class_or_union_sptr cou = is_class_or_union_type(type); + if (!cou) + return var_decl_sptr(); + + return cou->find_data_member(dm); +} + /// Get the function parameter designated by its index. /// /// Note that the first function parameter has index 0. diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc index cc38f240..c8122af3 100644 --- a/src/abg-reporter-priv.cc +++ b/src/abg-reporter-priv.cc @@ -402,8 +402,12 @@ represent(const var_diff_sptr &diff, const bool o_anon = !!is_anonymous_data_member(o); const bool n_anon = !!is_anonymous_data_member(n); const bool is_strict_anonymous_data_member_change = o_anon && n_anon; - const string o_name = o->get_qualified_name(); - const string n_name = n->get_qualified_name(); + const string o_name = (is_data_member_of_anonymous_class_or_union(o) + ? o->get_name() + : o->get_qualified_name()); + const string n_name = (is_data_member_of_anonymous_class_or_union(n) + ? n->get_name() + : n->get_qualified_name()); const uint64_t o_size = get_var_size_in_bits(o); const uint64_t n_size = get_var_size_in_bits(n); const uint64_t o_offset = get_data_member_offset(o); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index adb6d8bd..3134df7d 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -362,6 +362,11 @@ test-abidiff-exit/test-anonymous-enums-change-v0.c \ test-abidiff-exit/test-anonymous-enums-change-v0.o \ test-abidiff-exit/test-anonymous-enums-change-v1.c \ test-abidiff-exit/test-anonymous-enums-change-v1.o \ +test-abidiff-exit/test-anon-types-report-1.txt \ +test-abidiff-exit/test-anon-types-v0.c \ +test-abidiff-exit/test-anon-types-v0.o \ +test-abidiff-exit/test-anon-types-v1.c \ +test-abidiff-exit/test-anon-types-v1.o \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-anon-types-report-1.txt b/tests/data/test-abidiff-exit/test-anon-types-report-1.txt new file mode 100644 index 00000000..916b880d --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anon-types-report-1.txt @@ -0,0 +1,31 @@ +Functions changes summary: 0 Removed, 0 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable +Unreachable types summary: 2 removed, 3 changed, 0 added types + +2 removed types unreachable from any public interface: + + [D] 'struct {char z; int w;}' at test-anon-types-v0.c:34:1 + [D] 'union {char x; unsigned int y;}' at test-anon-types-v0.c:28:1 + +3 changed types unreachable from any public interface: + + [C] 'struct {int a; int b;}' changed: + type size changed from 64 to 96 (in bits) + 1 data member insertion: + 'int c', at offset 64 (in bits) at test-anon-types-v1.c:18:1 + + [C] 'enum {a=0, b=1, c=2, d=3, }' changed: + type size hasn't changed + 2 enumerator insertions: + 'e' value '4' + 'f' value '5' + + [C] 'union {int a; int b; int d;}' changed: + type size hasn't changed + 1 data member change: + name of 'd' changed to 'c' at test-anon-types-v1.c:11:1 + type changed from: + union {int a; int b; int d;} + to: + union {int a; int b; int c;} + diff --git a/tests/data/test-abidiff-exit/test-anon-types-v0.c b/tests/data/test-abidiff-exit/test-anon-types-v0.c new file mode 100644 index 00000000..2f9a2599 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-anon-types-v0.c @@ -0,0 +1,42 @@ +/** + * Compile with: + * + * gcc -c -g -fno-eliminate-unused-debug-types test-anon-types-v{0,1}.c + */ + +union +{ + int a; + int b; + int d; +}; + +struct +{ + int a; + int b; +}; + +enum +{ + a, + b, + c, + d +}; + +union +{ + char x; + unsigned y; +}; + +struct +{ + char z; + int w; +}; + +void +fun() +{} diff --git a/tests/data/test-abidiff-exit/test-anon-types-v0.o b/tests/data/test-abidiff-exit/test-anon-types-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..32d7fdfc3631aa467094410a8df1e50d39792972 GIT binary patch literal 3240 zcmbtWPj4Gl5TCbeCr&m=orKbs1ng9;NGf(6hf+eSgg`_S0;;M?<%Z0z{bDcJ>u7f! zk|0#U0SR#_5=U-ufEx(D0Uv=&B+f{P11e_@Fta<)-7K#vDkJUA%y0g_H~XG__q8`~ z7(##|0UPi@Qz*bUqYvcGMBIcYU>5G|eERFXw}1K_p(2P9SrX5u6Q9g06Ay*aTWAq3 zjHQAHA6gpop0 zurU8UIUT|?r9?P_$^`kth!`POy!bP|jbpf!*ui)oE^~qLy+HtCX}B3`0pd##lVFzC z7Q}VyCF}KBj6bEXTG-1Xdd#CxI47)yLh8F91UeUI5#i_*8My?OwPBf4xOday^3<$l zR^}?xVrH~_4xq$V+}p8&*sv@txn@ym$~Nx6%NMYj1fY=3^T!u(Nzc);@WJ@xtzK#s zN>_Xrg(CW1K`w;&Yig1hEgl~fD#<<=qGFs$(Q?>5YQ63}@6@X+%PTAO`bxdJcpDvd+?Wma)upQ4iwA*RZ_7Z2eiKzUY zoTLuM(>0v=DZ7al9hq1`M|etgFlNzzr6!C$#2*iuhD?~ypm;a|Pnw2IIHN(yfAU}W zlZeb@_Gj3!cF1&rpx zK+qQ%JiEI;=I{?$|Al!zzgi3BFR~A@GRt}Yi;S!OcUh-^^`K9ra?@Lmr1I?Aq32r2Mv)}7Uyda&RA4>;s06U7^=6jq(b{c!3+mpPI|HARv^ zXfxwO;y!<@CyY-cCqH#Y&NIG_JfD+HFEIEO`ze<9P5$sGV}_rw<8lTgF(3a1V!Hl! zc%Ukt`lngu`)_G-A_OHq95+eHP`-WxZMyo0T>l-8rTTP_MvMmbfVC?@n4*Z)`n z%vF8GKR{d;f5P$KJ|h0Jhs1xxA7t$j@pRv)Ub3#=_FqPF(ea6lH@zBo(`kO(`K&f+2#mDJrN^kI3D%pX~*E9eLML zT0Y7N3317RBN7Kt1>y!5jv&;(qG$d9&KzK7cV4o2SyTj!v^z7u`FQi*y!Un=yz$nX zIUzuifGs%I6bf*+cq}(#u?c6P3U{u5_S@mRzy5+y0Yr%`d3rrfuQa9Np^z6v@eW#Z zE|g>L!F0^qU=oL^e8CSQD9(sE@geGl3zgVlcrZ^w-e|)D2_+~M^IxMN&WV`0D0(17 z8*-uphLDgKT`aDgk4u>DP680t(HvD>;!6-KV3aPISk^2G8_VLF`O0$fMiqxY39O?} zeqKB`S2c~L#ie<%P^_HC1voEEbHl_aQ((~4vtXKArh$u6te&ux@?y(0%^THY=Q2Cb z0Zcpa>O~wsPDHtz7w%ug3BG_&4j-Cxn$!%^7|FZ%6wvoFav{VYbF;)~;`pGj6t6)} zEalE5Y0-ia0?J3KVTnR+H)o*xBnbUpAUhWIW#`r%YrFokRj)fQI(4hD)@ao0jk>jR z8y&8@5gY6)tCl^CCV|}S$v}?%HmdHp-QPS|ziMB-V(&LByJy+mU}VdIKlB4PlJ+E+ zgtB9Iq&Ml=(Y-wxLajd<%35dCdC#x){HQkYJ=gPlu0N=GGK%Ebc7su1w+C(**7nAc z45JX}o#1g2d%y0q|Hn+3>0xJkd&646^;!J~i-XI3HePh>$Nk$N4k}`CrdT?}##}<2 z9-_Fxugz6H&27(4y^anEocX4n=Hd50vy9lrEEo*lR=UwZOBNZ)5kF-zVCob`fRW7L zl+A$hDJ=2F^OZpc%w(XHA5TpN8E_^8CI8t|_&G!tQtNYcs50A3cSu627t^SwXRk&e zoMx%?g(M6Jr{^WsX?!AuCmO(0EKui;jwQ;M87F^L13?c{czShzU|i3mYNk8|_90eb zS@(a2aaHFo>vTC0Df~gALY=w7zhM0ub3MPsIL$RZUvR>E!^riJN8^O|l@!T?2%L@^ zx!`zV2+mjzTqnLiT7J+Sp^fg6mg{+Axqrg!j@_V#7fd>2;0IEL;1EhAxE1T|(Qqj7 z7IcD9Bpp2Kb{M(s_c@8|x4L6@D0w3Pku738t&!@JO4nrJXrHo9zG+%Ug)sdj@1&hl zvL63D+Gv0M+j#1~o|A@C<3A!LMY=ETEBc{mrhG_j@@D;+@p=QUG%`zTzJso)!O)>EED`wf={^{%W7n`qS4+#Vb5(Y|8x; qkKgBl>AON-K|P*&nl)96&yV`Ppj%A({Hd<2_;0!XA307jJ^n9btofJ# literal 0 HcmV?d00001 diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc --- a/tests/test-abidiff-exit.cc +++ b/tests/test-abidiff-exit.cc @@ -1064,6 +1064,22 @@ InOutSpec in_out_specs[] = "data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt", "output/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt" }, + { + "data/test-abidiff-exit/test-anon-types-v0.o", + "data/test-abidiff-exit/test-anon-types-v1.o", + "", + "", + "", + "", + "", + "", + "", + "--no-default-suppression --harmless --non-reachable-types", + abigail::tools_utils::ABIDIFF_ABI_CHANGE + | abigail::tools_utils::ABIDIFF_ABI_INCOMPATIBLE_CHANGE, + "data/test-abidiff-exit/test-anon-types-report-1.txt", + "output/test-abidiff-exit/test-anon-types-report-1.txt" + }, #ifdef WITH_BTF { "data/test-abidiff-exit/btf/test0-v0.o", From patchwork Fri Oct 20 10:03:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78218 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 B918A3858C50 for ; Fri, 20 Oct 2023 10:03:32 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 2C3D73858D39 for ; Fri, 20 Oct 2023 10:03:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C3D73858D39 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 2C3D73858D39 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=1697796208; cv=none; b=OIh8q494juaef0YtNOLehHrKje6LorXhW4XpswJNeJ0DOGeMtLonu8G1fAfk/v92kK1FAHHdizjdtYYhd9c3hHDTxbO0m0o6cX4r+flftSpMNLHee0N1K/n7yb2y80qGopvSSI+mFAJhpSuEXNGTTr3+XwyidfMB9XBSqmQn99U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796208; c=relaxed/simple; bh=2Da83VjDDUhdMwFI7leIUlZnQAE6Qp3SjX2S13PHlBc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PZO+U8C0G6P3WaaVOEs1BDeTlrWTqx0A9qvppblN/x0CBtv/rf3+j0ti8Amsgi4rw8oICp9rqeqDg7zSv5F5ZWfyt2aWmS0XM0RcXgeVczQh9Q5S6rG5QY2MS5TN7fRpOFZAZ9Yr2o4FKLxvSnyruj3CyjDaxPsPl+m7TJuZXYE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697796203; 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=e/YpszuNSfbt9hlhSCl58vLdjA6wUt+61ITSysRfvNQ=; b=RIz8DyaFha24Dg2NvRebT66tNMeLQbGNPRNr3szMDfGA8Dd4sJ38UgIgyEJzE9X44AcOhh FHE/P1J4rjq/xy5enJ5Tsn4sJ07/KumMZSQUT/PXPPorOoxVrrRtx6YIIHAP15IZHImzgu jmlw7U0vBBu2MN2jT2xLUJP1GWEJnJE= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-EUtG_ti3OxuhcOFUsnL9_w-1; Fri, 20 Oct 2023 06:03:17 -0400 X-MC-Unique: EUtG_ti3OxuhcOFUsnL9_w-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7740517a478so71259285a.3 for ; Fri, 20 Oct 2023 03:03:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697796197; x=1698400997; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e/YpszuNSfbt9hlhSCl58vLdjA6wUt+61ITSysRfvNQ=; b=G2PKlCFRYQJHJomQ3Rn9VJdMYCjCnFikY5JA6D0Y/TOdF1AgaqrRMKgcF3vv3feoQs E2IPAtTwpyc8xgf5RGicLFO057VxgPi/g6E9dRn+7hg8a/qaoPWmZzoYNBf27eumEV5C 82e5NMPJWOGzU8g46nzsGLM/F+pnU68WexiqYQdNW23925jJWynixb1/sL0omCG7QDOg aYV8Nd4Yj5oduzlZq94jSAUWsU3pzFZbIVHJ0Gugh5EeIJPjwyF4q3MXWrMKLux7hkOY H+RPbDFCFTg4GYg5zNXQjIqrCd0EhxTtUrfGDigR0E3kRYJnsFbYuvQrvd44ep0PaBCG 0Log== X-Gm-Message-State: AOJu0Yw+XtvOFxZGasUtBB2Pt6GD2abc8ja8piH0zGFKR1tPFlzjrRsG 3J2t0uzomdjckKJAtPdSf+d6JTFcEHDnWGOGKBPCv2x7LmVPVqfHeBIkGwdp5FqQcuKolbV+g1R E2R/WPilmh6YaEWckMa2G X-Received: by 2002:a05:620a:27cc:b0:778:8b53:cda2 with SMTP id i12-20020a05620a27cc00b007788b53cda2mr1327038qkp.23.1697796196360; Fri, 20 Oct 2023 03:03:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE649HpG80smJBSWFtoGeVizgJi10PRyGkPZUId4mO1qZSxf4w40tTSozXTzqvVbjunkriw4Q== X-Received: by 2002:a05:620a:27cc:b0:778:8b53:cda2 with SMTP id i12-20020a05620a27cc00b007788b53cda2mr1327016qkp.23.1697796195795; Fri, 20 Oct 2023 03:03:15 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id m1-20020ae9e701000000b00767da9b6ae9sm486669qka.11.2023.10.20.03.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:03:15 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6B30C5077C49; Fri, 20 Oct 2023 12:03:13 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 6/7, applied] Support suppressing data member insertion before a flexible array member Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 12:03:13 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <87mswd6272.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Consider this code example: $ cat test-v0.c 1 struct foo 2 { 3 int member0; 4 char pad[]; /* <-- flexible array member. */ 5 }; 6 7 void 8 foo(struct foo * p __attribute__((unused))) 9 { 10 } $ Consider this new version of the code where a data member has been added right before the flexible array member: $ cat -n test-v1.c 1 struct foo 2 { 3 int member0; 4 char member1; /*<-- added member. */ 5 char pad[]; /* <-- flexible array member. */ 6 }; 7 8 void 9 foo(struct foo * p __attribute__((unused))) 10 { 11 } $ Here is what abidiff reports about the change: $ abidiff test-v0.o test-v1.o || echo "returned value: $?" Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub-type change: [C] 'function void foo(foo*)' at test-v0.c:8:1 has some indirect sub-type changes: parameter 1 of type 'foo*' has sub-type changes: in pointed to type 'struct foo' at test-v1.c:1:1: type size changed from 32 to 64 (in bits) 1 data member insertion: 'char member1', at offset 32 (in bits) at test-v1.c:4:1 1 data member change: 'char pad[]' offset changed from 32 to 40 (in bits) (by +8 bits) returned value: 4 $ This patch allows users to suppress this change report using a new property value to the "has_data_member_inserted_at" property of the [suppress_type] directive. The resulting suppression specification reads: $ cat -n foo.suppr 1 [suppress_type] 2 type_kind = struct 3 name = foo 4 has_data_member_inserted_at = offset_of_flexible_array_data_member 5 has_size_change = yes $ With this suppression specification the previous command now gives: $ abidiff --suppr foo.suppr test-v0.o test-v1.o && echo "returned value: $?" Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable returned value: 0 $ The patch adds new test cases and updates the documentation to add a mention to the new offset_of_flexible_array_data_member named boundary. * doc/manuals/libabigail-concepts.rst: Add documentation for the new "offset_of_flexible_array_data_member" named boundary. * include/abg-fwd.h (has_flexible_array_data_member): Declare new function. * src/abg-ir.cc (has_flexible_array_data_member): Define it. * include/abg-suppression.h (type_suppression::insertion_range::named_boundary_sptr): Define new typedef. (type_suppression::insertion_range::create_named_boundary): Declare new static function member function. (is_named_boundary): Declare new function. (class type_suppression::insertion_range::named_boundary): Declare new type. * src/abg-suppression.cc (struct type_suppression::insertion_range::named_boundary::priv): Define new private type. (OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING): Define new static constant string getter function. (type_suppression::insertion_range::create_named_boundary): Define new static member function. (is_named_boundary): Define new function. (read_type_suppression): Parse the new "offset_of_flexible_array_data_member" named boundary. (type_suppression::insertion_range::eval_boundary): Evaluate the new "offset_of_flexible_array_data_member" named boundary. * tests/data/test-abidiff-exit/test-fam1-report-[1-5].txt: New reference test output. * tests/data/test-abidiff-exit/test-fam2-report-1.txt: Likewise. * tests/data/test-abidiff-exit/test-fam1-suppr-[1-4].abignore: New test suppression specification. * tests/data/test-abidiff-exit/test-fam{1,2}-v{0,1}.o: New test input binaries. * tests/data/test-abidiff-exit/test-fam{1,2}-v{0,1}.c: Source code of the test input binaries. * tests/data/Makefile.am: Add the new test material to the source distribution. * tests/test-abidiff-exit.cc (in_out_specs): Add the new test input to this harness. Signed-off-by: Dodji Seketeli Applied to master. --- doc/manuals/libabigail-concepts.rst | 5 + include/abg-fwd.h | 9 ++ include/abg-suppression.h | 27 +++++ src/abg-ir.cc | 61 ++++++++++ src/abg-suppression.cc | 83 ++++++++++++++ tests/data/Makefile.am | 18 +++ .../test-abidiff-exit/test-fam1-report-1.txt | 14 +++ .../test-abidiff-exit/test-fam1-report-2.txt | 3 + .../test-abidiff-exit/test-fam1-report-3.txt | 14 +++ .../test-abidiff-exit/test-fam1-report-4.txt | 3 + .../test-abidiff-exit/test-fam1-report-5.txt | 14 +++ .../test-fam1-suppr-1.abignore | 4 + .../test-fam1-suppr-2.abignore | 3 + .../test-fam1-suppr-3.abignore | 5 + .../test-fam1-suppr-4.abignore | 5 + tests/data/test-abidiff-exit/test-fam1-v0.c | 10 ++ tests/data/test-abidiff-exit/test-fam1-v0.o | Bin 0 -> 3184 bytes tests/data/test-abidiff-exit/test-fam1-v1.c | 11 ++ tests/data/test-abidiff-exit/test-fam1-v1.o | Bin 0 -> 3224 bytes .../test-abidiff-exit/test-fam2-report-1.txt | 14 +++ tests/data/test-abidiff-exit/test-fam2-v0.c | 10 ++ tests/data/test-abidiff-exit/test-fam2-v0.o | Bin 0 -> 3184 bytes tests/data/test-abidiff-exit/test-fam2-v1.c | 12 ++ tests/data/test-abidiff-exit/test-fam2-v1.o | Bin 0 -> 3232 bytes tests/test-abidiff-exit.cc | 105 ++++++++++++++++++ 25 files changed, 430 insertions(+) create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-2.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-3.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-4.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-5.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-1.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-2.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-3.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-4.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-v0.c create mode 100644 tests/data/test-abidiff-exit/test-fam1-v0.o create mode 100644 tests/data/test-abidiff-exit/test-fam1-v1.c create mode 100644 tests/data/test-abidiff-exit/test-fam1-v1.o create mode 100644 tests/data/test-abidiff-exit/test-fam2-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-fam2-v0.c create mode 100644 tests/data/test-abidiff-exit/test-fam2-v0.o create mode 100644 tests/data/test-abidiff-exit/test-fam2-v1.c create mode 100644 tests/data/test-abidiff-exit/test-fam2-v1.o new file mode 100644 index 00000000..0267d32b new file mode 100644 index 00000000..e922b423 new file mode 100644 index 00000000..35002c53 index b9ea4792..42b717f6 100644 diff --git a/doc/manuals/libabigail-concepts.rst b/doc/manuals/libabigail-concepts.rst index 324c5162..28e71684 100644 --- a/doc/manuals/libabigail-concepts.rst +++ b/doc/manuals/libabigail-concepts.rst @@ -500,6 +500,11 @@ names start with the string "private_data_member". value equals the offset of the end of the structure or class. + - the keyword ``offset_of_flexible_array_data_member`` + which is a named constant that evaluates to the offset + of the flexible array data member contained in the + relevant structure. + - the function call expression ``offset_of(data-member-name)`` where `data-member-name` is the name of a given data member of the relevant structure diff --git a/include/abg-fwd.h b/include/abg-fwd.h index 0edc9927..7d6637b9 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -481,6 +481,15 @@ is_class_type(const type_or_decl_base*); class_decl_sptr is_class_type(const type_or_decl_base_sptr&); +var_decl_sptr +has_flexible_array_data_member(const class_decl&); + +var_decl_sptr +has_flexible_array_data_member(const class_decl*); + +var_decl_sptr +has_flexible_array_data_member(const class_decl_sptr&); + bool is_declaration_only_class_or_union_type(const type_base *t, bool look_through_decl_only = false); diff --git a/include/abg-suppression.h b/include/abg-suppression.h index cbb16207..996600bb 100644 --- a/include/abg-suppression.h +++ b/include/abg-suppression.h @@ -366,6 +366,7 @@ public: class boundary; class integer_boundary; class fn_call_expr_boundary; + class named_boundary; /// Convenience typedef for a shared_ptr to @ref boundary typedef shared_ptr boundary_sptr; @@ -377,6 +378,10 @@ public: /// fn_call_expr_boundary typedef shared_ptr fn_call_expr_boundary_sptr; + /// Convenience typedef for a shared_ptr to a @ref + /// named_boundary + typedef shared_ptr named_boundary_sptr; + insertion_range(); insertion_range(boundary_sptr begin, boundary_sptr end); @@ -396,6 +401,9 @@ public: static insertion_range::fn_call_expr_boundary_sptr create_fn_call_expr_boundary(const string&); + static insertion_range::named_boundary_sptr + create_named_boundary(const string&); + static bool eval_boundary(const boundary_sptr boundary, const class_or_union* context, @@ -411,6 +419,9 @@ is_integer_boundary(type_suppression::insertion_range::boundary_sptr); type_suppression::insertion_range::fn_call_expr_boundary_sptr is_fn_call_expr_boundary(type_suppression::insertion_range::boundary_sptr); +type_suppression::insertion_range::named_boundary_sptr +is_named_boundary(type_suppression::insertion_range::boundary_sptr); + /// The abstraction of the boundary of an @ref insertion_range, in the /// context of a @ref type_suppression class type_suppression::insertion_range::boundary @@ -458,6 +469,22 @@ public: ~fn_call_expr_boundary(); }; //end class type_suppression::insertion_range::fn_call_expr_boundary +/// An @ref insertion_range boundary that is expressed as a named +/// constant that is to be evaluated later in the context of a given +/// type and resolved to a bit offset. +class type_suppression::insertion_range::named_boundary + : public type_suppression::insertion_range::boundary +{ + struct priv; + std::unique_ptr priv_; + + named_boundary(); + +public: + named_boundary(const string& name); + const string& get_name() const; +}; //end class type_suppression::insertion_range::named_boundary + /// Abstraction of a negated type suppression specification. /// /// A negated type suppression suppresses a type if the negation of diff --git a/src/abg-ir.cc b/src/abg-ir.cc index bb9483c9..79aec355 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -10760,6 +10760,67 @@ class_decl_sptr is_class_type(const type_or_decl_base_sptr& d) {return dynamic_pointer_cast(d);} +/// Test if the last data member of a class is an array with +/// non-finite data member. +/// +/// The flexible data member idiom is a well known C idiom: +/// https://en.wikipedia.org/wiki/Flexible_array_member. +/// +/// @param klass the class to consider. +/// +/// @return the data member which type is a flexible array, if any, or +/// nil. +var_decl_sptr +has_flexible_array_data_member(const class_decl& klass) +{ + var_decl_sptr nil; + const class_or_union::data_members& dms = klass.get_data_members(); + if (dms.empty()) + return nil; + + if (array_type_def_sptr array = is_array_type(dms.back()->get_type())) + {// The type of the last data member is an array. + if (array->is_infinite()) + // The array has a non-finite size. We are thus looking at a + // flexible array data member. Let's return it. + return dms.back(); + } + + return nil; +} + +/// Test if the last data member of a class is an array with +/// non-finite data member. +/// +/// The flexible data member idiom is a well known C idiom: +/// https://en.wikipedia.org/wiki/Flexible_array_member. +/// +/// @param klass the class to consider. +/// +/// @return the data member which type is a flexible array, if any, or +/// nil. +var_decl_sptr +has_flexible_array_data_member(const class_decl* klass) +{ + if (!klass) + return var_decl_sptr(); + + return has_flexible_array_data_member(*klass); +} + +/// Test if the last data member of a class is an array with +/// non-finite data member. +/// +/// The flexible data member idiom is a well known C idiom: +/// https://en.wikipedia.org/wiki/Flexible_array_member. +/// +/// @param klass the class to consider. +/// +/// @return the data member which type is a flexible array, if any, or +/// nil. +var_decl_sptr +has_flexible_array_data_member(const class_decl_sptr& klass) +{return has_flexible_array_data_member(klass.get());} /// Test wheter a type is a declaration-only class. /// diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index f8d065f6..d84857ba 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -43,6 +43,14 @@ using namespace comparison; using std::dynamic_pointer_cast; using regex::regex_t_sptr; +/// @return the string constant "offset_of_flexible_array_data_member". +static const string& +OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING() +{ + static string s = "offset_of_flexible_array_data_member"; + return s; +} + // // section parsing @@ -1482,6 +1490,25 @@ type_suppression::insertion_range::create_fn_call_expr_boundary(const string& s) return result; } +/// Create a named boundary. +/// +/// The return value is to be used as a boundary for an instance of +/// @ref type_suppression::insertion_range. The value of that +/// boundary is a named constant that is to be evaluated to an integer +/// value, in the context of a @ref class_decl. That evaluate is +/// performed by the function +/// type_suppression::insertion_range::eval_boundary(). +/// +/// @param name the name of the boundary. +/// +/// @return the newly created named boundary. +type_suppression::insertion_range::named_boundary_sptr +type_suppression::insertion_range::create_named_boundary(const string& name) +{ + named_boundary_sptr result(new named_boundary(name)); + return result; +} + /// Evaluate an insertion range boundary to get a resulting integer /// value. /// @@ -1563,6 +1590,19 @@ type_suppression::insertion_range::eval_boundary(const boundary_sptr boundary, } } } + else if (named_boundary_sptr b = is_named_boundary(boundary)) + { + if (b->get_name() == OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING()) + { + // Look at the last data member of 'context' and make sure + // its type is an array with non-finite size. + if (var_decl_sptr dm = has_flexible_array_data_member(is_class_type(context))) + { + value = get_data_member_offset(dm); + return true; + } + } + } return false; } @@ -1605,6 +1645,18 @@ type_suppression::insertion_range::fn_call_expr_boundary_sptr is_fn_call_expr_boundary(type_suppression::insertion_range::boundary_sptr b) {return dynamic_pointer_cast(b);} +/// Test if a given instance of @ref +/// type_suppression::insertion_range::boundary is actually a named boundary. +/// +/// @param b the boundary to consider. +/// +/// @return the instance of @ref +/// type_suppression::insertion_range::named_boundary if @p b is a +/// named boundary, or nil. +type_suppression::insertion_range::named_boundary_sptr +is_named_boundary(type_suppression::insertion_range::boundary_sptr b) +{return dynamic_pointer_cast(b);} + /// The private data type of @ref /// type_suppression::insertion_range::boundary. struct type_suppression::insertion_range::boundary::priv @@ -1706,6 +1758,35 @@ type_suppression::insertion_range::fn_call_expr_boundary::operator ini::function type_suppression::insertion_range::fn_call_expr_boundary::~fn_call_expr_boundary() {} +/// The private data type for the @ref +/// type_suppression::insertion_range::named_boundary. +struct type_suppression::insertion_range::named_boundary::priv +{ + string name_; + + priv() + {} + + priv(const string& name) + : name_(name) + {} +}; // end struct type_suppression::insertion_range::named_boundary::priv + +/// Constructor for @ref +/// type_suppression::insertion_range::named_boundary +/// +/// @param name the name of the @ref named_boundary type. +type_suppression::insertion_range::named_boundary::named_boundary(const string& name) + : priv_(new priv(name)) +{} + +/// Getter for the name of the named boundary. +/// +/// @return the name of the named boundary. +const string& +type_suppression::insertion_range::named_boundary::get_name() const +{return priv_->name_;} + /// Test if an instance of @ref suppression is an instance of @ref /// type_suppression. /// @@ -2021,6 +2102,8 @@ read_type_suppression(const ini::config::section& section) type_suppression::insertion_range::boundary_sptr begin, end; if (ins_point == "end") begin = type_suppression::insertion_range::create_integer_boundary(-1); + else if (ins_point == OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING()) + begin = type_suppression::insertion_range::create_named_boundary(ins_point); else if (isdigit(ins_point[0])) begin = type_suppression::insertion_range::create_integer_boundary (atoi(ins_point.c_str())); diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 3134df7d..945831ff 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -367,6 +367,24 @@ test-abidiff-exit/test-anon-types-v0.c \ test-abidiff-exit/test-anon-types-v0.o \ test-abidiff-exit/test-anon-types-v1.c \ test-abidiff-exit/test-anon-types-v1.o \ +test-abidiff-exit/test-fam1-report-1.txt \ +test-abidiff-exit/test-fam1-report-2.txt \ +test-abidiff-exit/test-fam1-report-3.txt \ +test-abidiff-exit/test-fam1-report-4.txt \ +test-abidiff-exit/test-fam1-report-5.txt \ +test-abidiff-exit/test-fam1-suppr-1.abignore \ +test-abidiff-exit/test-fam1-suppr-2.abignore \ +test-abidiff-exit/test-fam1-suppr-3.abignore \ +test-abidiff-exit/test-fam1-suppr-4.abignore \ +test-abidiff-exit/test-fam1-v0.c \ +test-abidiff-exit/test-fam1-v0.o \ +test-abidiff-exit/test-fam1-v1.c \ +test-abidiff-exit/test-fam1-v1.o \ +test-abidiff-exit/test-fam2-report-1.txt \ +test-abidiff-exit/test-fam2-v0.c \ +test-abidiff-exit/test-fam2-v0.o \ +test-abidiff-exit/test-fam2-v1.c \ +test-abidiff-exit/test-fam2-v1.o \ \ test-diff-dwarf/test0-v0.cc \ test-diff-dwarf/test0-v0.o \ diff --git a/tests/data/test-abidiff-exit/test-fam1-report-1.txt b/tests/data/test-abidiff-exit/test-fam1-report-1.txt new file mode 100644 index 00000000..90861635 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-report-1.txt @@ -0,0 +1,14 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void foo(foo*)' at test-fam1-v0.c:8:1 has some indirect sub-type changes: + parameter 1 of type 'foo*' has sub-type changes: + in pointed to type 'struct foo' at test-fam1-v1.c:1:1: + type size changed from 32 to 64 (in bits) + 1 data member insertion: + 'char member1', at offset 32 (in bits) at test-fam1-v1.c:4:1 + 1 data member change: + 'char pad[]' offset changed from 32 to 40 (in bits) (by +8 bits) + diff --git a/tests/data/test-abidiff-exit/test-fam1-report-2.txt b/tests/data/test-abidiff-exit/test-fam1-report-2.txt new file mode 100644 index 00000000..9666a8fd --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-report-2.txt @@ -0,0 +1,3 @@ +Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + diff --git a/tests/data/test-abidiff-exit/test-fam1-report-3.txt b/tests/data/test-abidiff-exit/test-fam1-report-3.txt new file mode 100644 index 00000000..90861635 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-report-3.txt @@ -0,0 +1,14 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void foo(foo*)' at test-fam1-v0.c:8:1 has some indirect sub-type changes: + parameter 1 of type 'foo*' has sub-type changes: + in pointed to type 'struct foo' at test-fam1-v1.c:1:1: + type size changed from 32 to 64 (in bits) + 1 data member insertion: + 'char member1', at offset 32 (in bits) at test-fam1-v1.c:4:1 + 1 data member change: + 'char pad[]' offset changed from 32 to 40 (in bits) (by +8 bits) + diff --git a/tests/data/test-abidiff-exit/test-fam1-report-4.txt b/tests/data/test-abidiff-exit/test-fam1-report-4.txt new file mode 100644 index 00000000..9666a8fd --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-report-4.txt @@ -0,0 +1,3 @@ +Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + diff --git a/tests/data/test-abidiff-exit/test-fam1-report-5.txt b/tests/data/test-abidiff-exit/test-fam1-report-5.txt new file mode 100644 index 00000000..90861635 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-report-5.txt @@ -0,0 +1,14 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void foo(foo*)' at test-fam1-v0.c:8:1 has some indirect sub-type changes: + parameter 1 of type 'foo*' has sub-type changes: + in pointed to type 'struct foo' at test-fam1-v1.c:1:1: + type size changed from 32 to 64 (in bits) + 1 data member insertion: + 'char member1', at offset 32 (in bits) at test-fam1-v1.c:4:1 + 1 data member change: + 'char pad[]' offset changed from 32 to 40 (in bits) (by +8 bits) + diff --git a/tests/data/test-abidiff-exit/test-fam1-suppr-1.abignore b/tests/data/test-abidiff-exit/test-fam1-suppr-1.abignore new file mode 100644 index 00000000..ab6f8500 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-suppr-1.abignore @@ -0,0 +1,4 @@ +[suppress_type] + type_kind = struct + has_data_member_inserted_at = offset_of_flexible_array_data_member + has_size_change = yes \ No newline at end of file diff --git a/tests/data/test-abidiff-exit/test-fam1-suppr-2.abignore b/tests/data/test-abidiff-exit/test-fam1-suppr-2.abignore new file mode 100644 index 00000000..1699a00f --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-suppr-2.abignore @@ -0,0 +1,3 @@ +[suppress_type] + type_kind = struct + has_data_member_inserted_at = offset_of_flexible_array_data_member diff --git a/tests/data/test-abidiff-exit/test-fam1-suppr-3.abignore b/tests/data/test-abidiff-exit/test-fam1-suppr-3.abignore new file mode 100644 index 00000000..7ff5e6d1 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-suppr-3.abignore @@ -0,0 +1,5 @@ +[suppress_type] + type_kind = struct + name = foo + has_data_member_inserted_at = offset_of_flexible_array_data_member + has_size_change = yes \ No newline at end of file diff --git a/tests/data/test-abidiff-exit/test-fam1-suppr-4.abignore b/tests/data/test-abidiff-exit/test-fam1-suppr-4.abignore new file mode 100644 index 00000000..6afd1283 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-suppr-4.abignore @@ -0,0 +1,5 @@ +[suppress_type] + type_kind = struct + name = bar + has_data_member_inserted_at = offset_of_flexible_array_data_member + has_size_change = yes \ No newline at end of file diff --git a/tests/data/test-abidiff-exit/test-fam1-v0.c b/tests/data/test-abidiff-exit/test-fam1-v0.c new file mode 100644 index 00000000..982f0429 --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-v0.c @@ -0,0 +1,10 @@ +struct foo +{ + int member0; + char pad[]; +}; + +void +foo(struct foo * p __attribute__((unused))) +{ +} diff --git a/tests/data/test-abidiff-exit/test-fam1-v0.o b/tests/data/test-abidiff-exit/test-fam1-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..e36cdc0864827b07b045e1fafae82038a4c250bf GIT binary patch literal 3184 zcmb_e&2Jl35TEC@<4v}4oH&A}0cDFo{SdqUpoGwpVib`kfGVg|ZdJOr*Y<+fwstpB zC_)I3kSZ=ka6%j^gphjRfVgn)jsJr?+$wQ^ncaDt?aNk0z)1UM<~N`3)BgDNx3&vH zfFuEz;YgDxz_ffMw_~vl%TR;sJGXz^x&6_DJ2&p%L%0M&Cu@O*r)kKNkx{h%WCBGY z^mh>~l0j%?lA$zpdLWAW4U~&8Q!IJo2+AR9Bm8t4uu9yI5HqCBQZAvVeakxH+aJ(6 zH$~eLNrf+mVCXi5h-bktE*n|}(M9oGrDkYrt80s5sa$;$K&uH&H;jwMCF5m7)Uc0v z&?_#dY@ULBJGp6R>)(nlu1)K31BQ> zUlat-Q^V9M#48$0G|0)N01Mm5OXzzZxe(&d$~-Yz6Z}wEildtpmT3)OG#L-f{c-3G#u!d}>AQZ%4I0oLIsrs(7+HPCZ(0Wpy9@Q< z#CPkxN$)+cKJcRY$m=*AZ{T>NIyzb5{&X7DDJHD7N%&R9513P3!iTJX%3Q50=Scn~_8~^=Mx^>b zlfdbG-(j6zFCsbLuM!oS%q9LE>zA0T`Ax=YZRktM4nOcCrvr8v1qmNYDRK`Zu<3aK zyAy_B2kywRdv0fcu;-2Y6ST#$)9D26!9!*zaK;1o;gFFxc4Y{bkRri*vEH5dzKidg zJ)T6ajSqtrMo#yAPV5f%`hnxSY3Kh*SjA{sBe_p9S(}CQJhM)|SvrjhVd{;4GwYO* z)%Y`Lqx1N0<7xlZoK#NM|B;joslIfs=-)y+<3pm!hxK>H7m<^nygT^Q8q+3@YECjd zh^+wfJhFPs_iZ%f#ec(KLk2QeeQBO~{a1NIWjysyuc_L94>2_-LhvhtZ;+B9)prkV zdG*^||0c&$eR?m{`cuRxr|c8On3nl+`VwF+>r4J2;(76(aQsh?iT~me@hv`(^~c12 z&GCvGIO>6B2idpuzsK?1u7qL8@f#_U2y*=-{5=YJ>wlNmU!GH1fBKD(@e-$g)Y=Ha sU9LamhUs^Rel68_+S9zL>U@9X{}gnKNu59Sl^6dD_y04;Nv6jC4RnF@YybcN literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-fam1-v1.c b/tests/data/test-abidiff-exit/test-fam1-v1.c --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam1-v1.c @@ -0,0 +1,11 @@ +struct foo +{ + int member0; + char member1; + char pad[]; +}; + +void +foo(struct foo * p __attribute__((unused))) +{ +} diff --git a/tests/data/test-abidiff-exit/test-fam1-v1.o b/tests/data/test-abidiff-exit/test-fam1-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..3bfcfc3f15baea9759c977da0a2f38f84f2527ad GIT binary patch literal 3224 zcmb_eOOG2x5U%#v>+w$ZX#~40XlJ9KJj9IcB`nK^4Mr;xuZW@$DMz#!+hco(U$V!G z2?B(WkRpT>1QHxL0Yc(N1PAV1_ywG~@B_FZae%6sYP;Q;C@7*NPgQ+gUv+i$bdTSE z^~$A`5FkasMVNXL1^6;MwabxNhQ}ZeH!64jsN8w?ue)#j@)N=t5GIWp^mv*cs#uDX zZuEL!3SoK(Ml%{&GGjY!w$Myx`d%GG#_XY!fw^=h=!TFIa}<}Qi1+Yk(gRXvRAG+N ziri!ga!T>lJq()fOr-=ECk|wnVU@c)8M1p6jVyYFQ?nV|p8x_-HeEI4P`=IoKT`IZf-IBds+-O~ar6Bn{#&Cc$_}C%Zi}Zp6oT1|!G78Ir_+=s?~# zWPoyMD5D1C6mM!84|tyqI57=UECcX>CWrw`2`JUSa38*m$g0wx$%)eTm#!5Oxd-!T ztE-lo30GIQN+cA*=_loJHY6@9ev)z8F?Dy&DePk4tMlv}Zy z;5XU-K*O)H{|Rfo9=UePpWzr%)K3yU{$vbK`tUmYbhDAjK71CtP+~3dui3xATF-AY zPCZlm2JZ0fPUuxphl5zRq!s$(5L~)2z^x94;12w@=hpq|sCg808$BG0Y_D1!_{THD z-oWcN{aH#o==zd^Q%IBGqsXuIIvpQxJh$5meHX6^XBc|5Tb$T$9W@4CM{Xdm=TX%L z5~)XWpJbjg8oU%?dBRR>3 zb0h)Qa(=1bK|G271@rGcg#Yma_!WL33lHIc&U`Hl-qK%a4v=-r`0trNa~B~tX8x`W zWG(wA;cwAM>i@6YfBBwL|LNNy`4Xpk^tlm&A9(&27fjzL`ikm&+S8<^uJQSi|6edH U5`FztR}%ksuK!2oNu~4u1vo+YiU0rr literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-fam2-report-1.txt b/tests/data/test-abidiff-exit/test-fam2-report-1.txt --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam2-report-1.txt @@ -0,0 +1,14 @@ +Functions changes summary: 0 Removed, 1 Changed, 0 Added function +Variables changes summary: 0 Removed, 0 Changed, 0 Added variable + +1 function with some indirect sub-type change: + + [C] 'function void foo(foo*)' at test-fam2-v0.c:8:1 has some indirect sub-type changes: + parameter 1 of type 'foo*' has sub-type changes: + in pointed to type 'struct foo' at test-fam2-v1.c:1:1: + type size hasn't changed + 1 data member insertion: + 'char member1', at offset 32 (in bits) at test-fam2-v1.c:4:1 + 1 data member change: + 'char pad[10]' offset changed from 32 to 40 (in bits) (by +8 bits) + diff --git a/tests/data/test-abidiff-exit/test-fam2-v0.c b/tests/data/test-abidiff-exit/test-fam2-v0.c new file mode 100644 index 00000000..2403e6cf --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam2-v0.c @@ -0,0 +1,10 @@ +struct foo +{ + int member0; + char pad[10]; +}; + +void +foo(struct foo * p __attribute__((unused))) +{ +} diff --git a/tests/data/test-abidiff-exit/test-fam2-v0.o b/tests/data/test-abidiff-exit/test-fam2-v0.o new file mode 100644 index 0000000000000000000000000000000000000000..e5cc0b042e78465c477f6905b60bc70a446d38ea GIT binary patch literal 3184 zcmb_e&2Jl35TEC@<4v}4oVcP*1IiYG`XP4xK^sC#icv(G0IHx;xmD@fUfT=awYA=a zP=q)XAyr(8;0RKMkPsY@5SQLL^Jny4ZXgbHWWnI~bVQbq4sSG>9`{ZB1Zndb4E%j7dxP!i>i z16T{#*$!IZ1!|d^g>+I=iC%JeQ-Fmn!D*baoiN#p{EeO; z`Ek%j)r;Hxjf3?yXYHJ`->{t?42Dt9-iyXTFT!wI&d?8Aeq4ig--{vf$BEPR!iKY7 zbK6ku4@1A&8Ftqt&gEk!1JXm6fh(7UVm0u*W|8p^8`*#( zS?<^+9@Y#pU?Bs=Lk#ne;blaYl=+z+C2fi6LLriCFo&`_YMGgEb#zMhyqC%ay#J^?zB6B^z%{a}CIzQl!KMWJEg*=HTyf3B1KS;o(y8+zR zcnogr4?MTyxAuCwLDU_hEtS1iEB5yfnZ4MHdj8>%K@j;e1WQPf;N4Vj55v&MOU;dj ziSOdA;EWTm{XQr5`@7xP3w<8Q6S5VIr#X`AB-1rnnC@rR$ycS5s1T-~_%~H2Mb_g_ zp^f(Ae~qX0*K<-iS^pf2LM| z@0d%b`@W3^9V6dw7_7-a=DIJ9GpqkHFQ|;C{^>T=`|lv8=R^p8WAF`96w-Zn(Uw)e z$@On=EY+v`MXx_XjB?68QB3I=A5Qu^Q%TmB{3A4G#ed52KdZs)OOTBJoMpZKdESs! za#l#jN&Xeuq^!6>N8iwF)O~;8_(OLQVttNZSCgVF=TE}4zq024F3-Q*r!@ccjgavY xr+)O>2*F*h-{*$uJ49bgJ)YJyYp5olANikxZYk;Gr@pe{?{WXXaGYd%{6j_-^xgmf literal 0 HcmV?d00001 diff --git a/tests/data/test-abidiff-exit/test-fam2-v1.c b/tests/data/test-abidiff-exit/test-fam2-v1.c --- /dev/null +++ b/tests/data/test-abidiff-exit/test-fam2-v1.c @@ -0,0 +1,12 @@ +struct foo +{ + int member0; + char member1; /* This is an added data member. */ + char pad[10]; /* This is not a fam, so the change should not be + suppressed. */ +}; + +void +foo(struct foo * p __attribute__((unused))) +{ +} diff --git a/tests/data/test-abidiff-exit/test-fam2-v1.o b/tests/data/test-abidiff-exit/test-fam2-v1.o new file mode 100644 index 0000000000000000000000000000000000000000..867701a692dd3f2a056d5154c11336ffe4602e52 GIT binary patch literal 3232 zcmb_e-ESL35TEtg@x|9TPK=--pj;4DKg69sC?TYz7)7*+T2)Y~k0?FcXZxsqw(N5h zf>04iNEH$)f+xfSLh#T>KuGkNe}Gs103=>{L*fBu?q)CN?Nvn;BYAh`Hy=AYv%BZp zZ(O~U5dtI$xCqCRL;=3eAM=fnZNL*yh8w$ge&4HTt*$MJ<$UQWOsgz3-7vNcau8)q4Fl+r82Qh!Kh`2I#9o<<^mW)PS1|azEnZuZ z_NP}UYUAY53fUBLi9nf?0LCIFvWFUYfpVs7AuMpn(IEF11I+B=oI~4lI13^EE-uhS zWx*dZYhi^lVlA^6g$@030_I~;D~OLW8X8}|cEjAMy=>NM_IbNz)~odws~gpq%rn>B zwz=yBtgz~5O=}QLeRsR-`tI0kq3DcTz3s!z4Qu1Pbx=30F7$_f*PQwjuj`{bb+pxU z#xQUPO?O=7xdwqd39ODYs9Og$y9JfraNt(j!}dE~rRxQizSne`Uf1#Z6*RIY)6r;L zA)iU5?F3H9T4>SsIvvYB^n(8(f|8OV!sVTvE%OW(>+FB1R9J4nI~0*Px(?#7Bvw!4 z^}E=bXAq_zQP|?wi=~e(_SN9t-8{`@CRiLFe7@v_D(pV4d4HJ-sp&~Sw` z(jdH;52!RqJRS+HhPO72w1*sO4Njz)V?KCKQ%Hlw6qNE`cmOXUvYe<-e65rw)9XSc zdr&|=xoa7j@Z|26$q9*Y`bm0{8Hvk`pJtpomh8^CguTpxpjQ((t?RN(&j1m{CwxEx z(yeHU@tZ7vsNmOF{*-4mAGvpmpJN-EsGdZs{c{l<*WoRe>3JiPb@)6Ip~kbszhU_T z&uV;=ajF^pVzMXi4g#kM_9Pfbb5C-Cdl-OCuLju7$pq}N+js1?+njdyJ-;(VUC2Al z=GZ-$Q9EPD@4B-teb0BL3oap9g7-tYH5?3FeD-XA7`QgR7uFNc{NSM*vn5;nwc@?q84VF@v^lXnWgy&-MmsKz8kmcj2rtK&hneG^qGM%MQjtRB0D zoN7z^Ov}H)4VC_sKfSVQ{%yq6meAL9@%lH}m)58EMO}Y{7{!!% zA{){vzMNAD@GRGt^LvP=`G3j&-#^0tlZW_U;R9KDg#Q=pub9D+dZ5`r<}K~-vH#3l zgxCk{zbOrQmi3eHx5%W`|5vWRJf~ED`gTZviBmr6+6ckVync@prtcGdMOA<5Y1&pz bzCZH+3z~(b?w|5X^Z$eM|B?OVr2790Gb;H( literal 0 HcmV?d00001 diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc --- a/tests/test-abidiff-exit.cc +++ b/tests/test-abidiff-exit.cc @@ -1080,6 +1080,111 @@ InOutSpec in_out_specs[] = "data/test-abidiff-exit/test-anon-types-report-1.txt", "output/test-abidiff-exit/test-anon-types-report-1.txt" }, + { + "data/test-abidiff-exit/test-fam1-v0.o", + "data/test-abidiff-exit/test-fam1-v1.o", + "", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_ABI_CHANGE, + "data/test-abidiff-exit/test-fam1-report-1.txt", + "output/test-abidiff-exit/test-fam1-report-1.txt" + }, + { + "data/test-abidiff-exit/test-fam1-v0.o", + "data/test-abidiff-exit/test-fam1-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-1.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_OK, + "data/test-abidiff-exit/test-fam1-report-2.txt", + "output/test-abidiff-exit/test-fam1-report-2.txt" + }, + { + "data/test-abidiff-exit/test-fam1-v0.o", + "data/test-abidiff-exit/test-fam1-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-2.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_ABI_CHANGE, + "data/test-abidiff-exit/test-fam1-report-3.txt", + "output/test-abidiff-exit/test-fam1-report-3.txt" + }, + { + "data/test-abidiff-exit/test-fam1-v0.o", + "data/test-abidiff-exit/test-fam1-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-3.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_OK, + "data/test-abidiff-exit/test-fam1-report-4.txt", + "output/test-abidiff-exit/test-fam1-report-4.txt" + }, + { + "data/test-abidiff-exit/test-fam1-v0.o", + "data/test-abidiff-exit/test-fam1-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-4.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_ABI_CHANGE, + "data/test-abidiff-exit/test-fam1-report-5.txt", + "output/test-abidiff-exit/test-fam1-report-5.txt" + }, + { + "data/test-abidiff-exit/test-fam2-v0.o", + "data/test-abidiff-exit/test-fam2-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-1.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_ABI_CHANGE, + "data/test-abidiff-exit/test-fam2-report-1.txt", + "output/test-abidiff-exit/test-fam2-report-1.txt" + }, + { + "data/test-abidiff-exit/test-fam2-v0.o", + "data/test-abidiff-exit/test-fam2-v1.o", + "data/test-abidiff-exit/test-fam1-suppr-3.abignore", + "", + "", + "", + "", + "", + "", + "--no-default-suppression", + abigail::tools_utils::ABIDIFF_ABI_CHANGE, + "data/test-abidiff-exit/test-fam2-report-1.txt", + "output/test-abidiff-exit/test-fam2-report-1.txt" + }, #ifdef WITH_BTF { "data/test-abidiff-exit/btf/test0-v0.o", From patchwork Fri Oct 20 10:04:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78219 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 A302E3858D39 for ; Fri, 20 Oct 2023 10:04:39 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 10BE53858D20 for ; Fri, 20 Oct 2023 10:04:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10BE53858D20 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 10BE53858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796276; cv=none; b=xI/1k68vutbMhstF9l3qHegpvn63qAzJsXVmaM11l5QDFUjRu2anuCGosZ8XhInoIfqSmMFuqB7rMGdrd5qN77ln6AEN947HMv/ZbgSm7F+ysu/6dBtuC7GIuut89Eln9SV6ZTPipWgtzORP5zn7Sq5r5deLu6bSH+/IOv19Lis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697796276; c=relaxed/simple; bh=sDjjaIqs1XIPnQdQfNVtpGJGg7VKJVmW8/ubEw3g5F4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZMFC0KsEKpLVQYPiTV0K0P7EKq4jZidSgYFbmeWjnS39DkmtCMvYDIQZuNi8M1C9Vb7C67sm8LB1gsqe4JUy6oKOnlwak6geFNdPeiXNalp9O8A15odaZjnPRphvNUmTQQLoaYhyi2f0OHsFG4d62UIFJYsEQp7p7m1ILh5Y7ww= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697796274; 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=d7aERRWvu/M8RvZD4r7bQL8QLxlI5x9fTO0yqcK/ziQ=; b=c01RY/o/G3vTEM587NxnsebzthLh7Rkz8d9HbEBPMtFV/RQrQNWMRsJTAErUfcrfrPiEa6 5fQjaKvj+ryziTQoorADprG0Johiy3iafkTqYcFS6jAN+YKGmmcwqhx1WcCz8YvU1LIoff HLnRjCsNrs9YFUYq4x0u1VutY9AXYBY= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-539-ZF45ycV0MWK4s3v8BOSvQg-1; Fri, 20 Oct 2023 06:04:33 -0400 X-MC-Unique: ZF45ycV0MWK4s3v8BOSvQg-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-41cd638a4beso6263871cf.3 for ; Fri, 20 Oct 2023 03:04:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697796273; x=1698401073; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d7aERRWvu/M8RvZD4r7bQL8QLxlI5x9fTO0yqcK/ziQ=; b=iI/MCLgwP3Lo3PyzjURSUqZgyMFavt7TLhCgLJho5mmntqenEsY0eAgaNkoAwv7dqy kRnPfRKCLGXvrtLwfBeXJ593Nrys/n2xj1FgkB9KYCGtONeb+2Vr1JUQ6OcM+8jslLHe h9Fj0yMrYNcU7fIOQ5hxHCf4pPfu2kowD5qC9tnWG8VgdC0PdHXh0dsWbPVXnrKe12kw yrliS2JOtemRO2IE514I4t3T6psHC4Eaj4GPehA7VDmHfA5VyzFEWXpY3xTasz7uJ+/P O1NF2hugQqVRfFXrPWfWJjkZMi47JbVy4lNm4M/Dd5p/4GenFr9DtWPlNzfMXN8SNIEJ LUtQ== X-Gm-Message-State: AOJu0YwoBHk8holdzBuGc7QJOXWG+Af+yu02vIIJXZIXCOF7Yid8BO0g cVcne00vSzdzNg7X8tbqXNCKn5Lw3/wcPIrcfUG3YZnZKr1lpfakwy1MZ4j3diAlvhr5Z8LwlZ5 lwoArn2M0RsIEn6oJE1zr X-Received: by 2002:a05:622a:44f:b0:41c:c149:731e with SMTP id o15-20020a05622a044f00b0041cc149731emr1140507qtx.28.1697796272795; Fri, 20 Oct 2023 03:04:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuXt3zrtPFOWjB5JoDUa4ThxLJLBRpJTOAptkmwTZ6E3h9WrA68Go+tKuv+8lOw4hU0gKt4A== X-Received: by 2002:a05:622a:44f:b0:41c:c149:731e with SMTP id o15-20020a05622a044f00b0041cc149731emr1140492qtx.28.1697796272512; Fri, 20 Oct 2023 03:04:32 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id dn26-20020a05622a471a00b0040331a24f16sm479937qtb.3.2023.10.20.03.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:04:32 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 9623E5077C49; Fri, 20 Oct 2023 12:04:30 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 7/7, applied] suppression: Make the "end" data member offset selector be named boundary Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 12:04:30 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <87il71624x.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, Now that we have what is called a "named boundary", introduced by commit [1], this patch re-writes the handling of the "end" data member offset selector (used in expressions like: offset_of(end) in suppression specifications) in terms of the new "named boundary" infrastructure. In other words, the "end" keyword is now a named boundary constant, just like the "offset_of_flexible_array_data_member" is a named boundary constant. [1]: The patch that introduced the concept of "named boundary" is this one: commit b12ba51e62de7c61526bd0a0cac6cc9bcf28fdee Author: Dodji Seketeli Date: Thu Oct 5 13:32:21 2023 +0200 Support suppressing data member insertion before a flexible array member * src/abg-suppression.cc (END_STRING): Define new static string constant accessor. (type_suppression::insertion_range::eval_boundary): Eval the "end" named boundary as having a numerical value of std::numeric_limits::max(). (read_type_suppression): Parse the "end" token as a named boundary. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-suppression.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index d84857ba..326d003e 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -51,6 +51,14 @@ OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING() return s; } +/// @return the string constant "end"; +static const string& +END_STRING() +{ + static string s = "end"; + return s; +} + // // section parsing @@ -1602,6 +1610,14 @@ type_suppression::insertion_range::eval_boundary(const boundary_sptr boundary, return true; } } + else if (b->get_name() == END_STRING()) + { + // The 'end' of a struct is represented by the value + // std::numeric_limits::max(), recognized by + // type_suppression::insertion_range::boundary_value_is_end. + value = std::numeric_limits::max(); + return true; + } } return false; } @@ -2100,8 +2116,8 @@ read_type_suppression(const ini::config::section& section) // has_data_member_inserted_at = string ins_point = prop->get_value()->as_string(); type_suppression::insertion_range::boundary_sptr begin, end; - if (ins_point == "end") - begin = type_suppression::insertion_range::create_integer_boundary(-1); + if (ins_point == END_STRING()) + begin = type_suppression::insertion_range::create_named_boundary(ins_point); else if (ins_point == OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING()) begin = type_suppression::insertion_range::create_named_boundary(ins_point); else if (isdigit(ins_point[0]))