From patchwork Tue Apr 13 14:54:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 42976 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 EC9143944433; Tue, 13 Apr 2021 14:54:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC9143944433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618325686; bh=/8Gy3v4ODyP7t7j6lCCQai+S6JWGppTkJPowObLY9+A=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=AN7PWddatz3X8BgRxliqpZUdmIXvzXsEi2E57fumyERsDP60QxA0cjQfgCpqgBdXY CFUIjdHPTtyPcFsY/iQjsalEGBGI4gY0yufthOFtXTZpvVTwkzJCfd9ZanD+JTEtZr PwesCHqb86xUUVGPWdkjbWdmUc00yNeTqcD3eXqw= 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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6F5093943548 for ; Tue, 13 Apr 2021 14:54:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6F5093943548 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-lsqrPJ7kMEO6qgsqyW6HiA-1; Tue, 13 Apr 2021 10:54:41 -0400 X-MC-Unique: lsqrPJ7kMEO6qgsqyW6HiA-1 Received: by mail-wr1-f70.google.com with SMTP id b4so858468wrq.9 for ; Tue, 13 Apr 2021 07:54:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=/8Gy3v4ODyP7t7j6lCCQai+S6JWGppTkJPowObLY9+A=; b=htj14PdoJAg7A5iZokzeysxWHWU50pN7hAtqLbSiFMhHEiqYELtINs/FLaUk1OlDpo sHo90b118MJCK61prb14qIloflBqNyMd8gGjwxdJrfG1wFEnuCPWd+vt+0SLmBtPkTqc rwFKAKKSV2E2aStN+Ldxo9x1hk9H0HgmSe1/YW8Y6nW9RBIwXDilpXowEbWjmn6Hn0C2 uXsvIHaY1Qe0S7X43w48lBerWttflp05pA+KsNDSEibK51tLMl1IluTV49HIXbjEB/EN BofHx/8O//nZ3n9EEgo8sEOWPXCfLhk8rMKO19oKxLSbTm6S/Pv0nj5LGFffzH9diRJk 7VfA== X-Gm-Message-State: AOAM530sREKlx+ctdF5DdEoIoOQroU+jUu2f5Ij59JJGipbXnh8RaSym JzYo9U1KKQhZXTGsXmMrTITmxWejUjYTU7+KahlcJ3dx3MGMZCue4n8pI6NqY/0jSDoFDzxCQty PQByGWHoZZm4rcwkRhXA/DVCX4JQJab0FGrzYjk1+6ngLE/stGmcbWfWqrEMkFGG6LJ+4 X-Received: by 2002:adf:dfc2:: with SMTP id q2mr1365104wrn.128.1618325680003; Tue, 13 Apr 2021 07:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMfq6l0NbCLh4FnG8k2e2uSatr+wrMhhgZXlO2evEWSulRHCDc7SkWKngOf47xPGkZmhOoBQ== X-Received: by 2002:adf:dfc2:: with SMTP id q2mr1365083wrn.128.1618325679756; Tue, 13 Apr 2021 07:54:39 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id b12sm8824029wrn.18.2021.04.13.07.54.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 07:54:38 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 2CE7E58000E; Tue, 13 Apr 2021 16:54:38 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH, applied] dwarf-reader: properly set artificial-ness in opaque types Organization: Red Hat / France X-Operating-System: Fedora 34 X-URL: http://www.redhat.com Date: Tue, 13 Apr 2021 16:54:37 +0200 Message-ID: <87sg3utetu.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 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_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, get_opaque_version_of_type forgets to set the "is-artificial" property according to the initial type the opaque type is derived from. This can lead to some instability in the abixml output. Fixed thus. * src/abg-dwarf-reader.cc (get_opaque_version_of_type): Propagate the artificial-ness of the original type here. * tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Adjust. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 2 ++ tests/data/test-read-dwarf/PR27700/test-PR27700.abi | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 604c76e3..dd9d689c 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -14041,6 +14041,7 @@ get_opaque_version_of_type(read_context &ctxt, type_location, decl_base::VISIBILITY_DEFAULT)); klass->set_is_declaration_only(true); + klass->set_is_artificial(die_is_artificial(type_die)); add_decl_to_scope(klass, scope); ctxt.associate_die_to_type(type_die, klass, where_offset); ctxt.maybe_schedule_declaration_only_class_for_resolution(klass); @@ -14069,6 +14070,7 @@ get_opaque_version_of_type(read_context &ctxt, underlying_type, enumeratorz, linkage_name)); + enum_type->set_is_artificial(die_is_artificial(type_die)); add_decl_to_scope(enum_type, scope); result = enum_type; } diff --git a/tests/data/test-read-dwarf/PR27700/test-PR27700.abi b/tests/data/test-read-dwarf/PR27700/test-PR27700.abi index 5c49e369..02bd9e8e 100644 --- a/tests/data/test-read-dwarf/PR27700/test-PR27700.abi +++ b/tests/data/test-read-dwarf/PR27700/test-PR27700.abi @@ -5,7 +5,7 @@ - +