Message ID | 20210527085305.1400592-2-gprocida@google.com |
---|---|
State | Under Review |
Headers |
Return-Path: <libabigail-bounces@sourceware.org> 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 28B6F383B43B; Thu, 27 May 2021 08:53:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28B6F383B43B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622105607; bh=GzWOogOQFLAq2f4/whnSk7mUG2s1sdcWXhsHnUkdpOs=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=i+ELJ+PsReNne7TKk3a7T8aXqnSs0YPdzWZHz5QmZ0KdI6CX/CH8sHGoKQdAM+HKz SeU/2rp9JuDfDtXCBJUxGDjfYVI2d/LHL3gB8HXY2W9thbavGUyPBEeHOvgizMf2BF p2IIQOsWrH1XBn3uEM2ErQo2a7TPxWu2mAaYtpgI= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id E69C239540BA for <libabigail@sourceware.org>; Thu, 27 May 2021 08:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E69C239540BA Received: by mail-wm1-x34a.google.com with SMTP id x20-20020a1c7c140000b029018f49a7efb7so1248778wmc.1 for <libabigail@sourceware.org>; Thu, 27 May 2021 01:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=GzWOogOQFLAq2f4/whnSk7mUG2s1sdcWXhsHnUkdpOs=; b=Ie0QIDvxaAbb/VKNF6srQYDrmtgChnY6o5KgUrfQa84/SVaaYh3iZRUEZVgkbmszHe cldp0c6bzT4ql9m4DFyd5HZ7ucQdTMmera/BWDBNC+ypapRus0aW50r1ARD6wnElkdas dCvMmdXZAkj/awhmMgRdJMvkgdz+KNERvqq3fiIuLtB7zzS1Q+u0A/CxVHGVEYXAGHzY JiDf1MrWAPD/MT+d+IsoZVtOGf4hJ8Z442DeghiSfTb1xviofKfAUrsMUigBXe7LEB+I VX9xRG7zldRAeMD+lbRPspLVL9N0auydWSfrkB3mFh28x0QHo4GVd5sD+6RMtfZfSH6y KFlw== X-Gm-Message-State: AOAM533UVLevuuGd/YDF7uapyu328uAzvUAW6qKKHGetgEEkOffR8LT1 jTLhMaah5OPvkgM9TquCawapMeVGEI5jgYAA99AsOTwEnT1iAmDQ50OsnHJpz/6TAKbPk4XPx03 oPwPXCQnxiVuaWrv+nLr2myQDJycORFz6OaG2lJdl3FAr8EEtBbKxj7/G+6eWrqFSkmoufxg= X-Google-Smtp-Source: ABdhPJw5rWqFDChCyG22RjqQYFpldhrrAbRV7Nt42RqeG7daU+tJ37MPaE7BJ1nonlfKtm0DZtOiJlts7mClkA== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:210:959c:f576:7f09:4ab3]) (user=gprocida job=sendgmr) by 2002:a7b:c154:: with SMTP id z20mr6990119wmi.13.1622105604015; Thu, 27 May 2021 01:53:24 -0700 (PDT) Date: Thu, 27 May 2021 09:53:03 +0100 In-Reply-To: <20210527085305.1400592-1-gprocida@google.com> Message-Id: <20210527085305.1400592-2-gprocida@google.com> Mime-Version: 1.0 References: <20210427112853.1338240-1-gprocida@google.com> <20210527085305.1400592-1-gprocida@google.com> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog Subject: [PATCH v2 1/3] abg-dwarf-reader: create new corpus unconditionally To: libabigail@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-23.2 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: Giuliano Procida via Libabigail <libabigail@sourceware.org> Reply-To: Giuliano Procida <gprocida@google.com> Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" <libabigail-bounces@sourceware.org> |
Series |
always create fresh corpus objects
|
|
Commit Message
Giuliano Procida
May 27, 2021, 8:53 a.m. UTC
The DWARF reader appears to create a new corpus object only if one is
not already present. However, the only case where there can be
multiple corpora is when build_corpus_group_from_kernel_dist_under is
called and this function clears down the reader context, including the
current corpus, between reading ELF objects.
So it's clearer to just create a fresh corpus object unconditionally
in the DWARF reader.
* src/abg-dwarf-reader.cc (read_debug_info_into_corpus):
Create new corpus object unconditionally.
Signed-off-by: Giuliano Procida <gprocida@google.com>
---
src/abg-dwarf-reader.cc | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
Comments
I forgot to add: this addresses bug 27769. On Thu, 27 May 2021, 09:53 Giuliano Procida, <gprocida@google.com> wrote: > The DWARF reader appears to create a new corpus object only if one is > not already present. However, the only case where there can be > multiple corpora is when build_corpus_group_from_kernel_dist_under is > called and this function clears down the reader context, including the > current corpus, between reading ELF objects. > > So it's clearer to just create a fresh corpus object unconditionally > in the DWARF reader. > > * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): > Create new corpus object unconditionally. > > Signed-off-by: Giuliano Procida <gprocida@google.com> > --- > src/abg-dwarf-reader.cc | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc > index a06ca88f..135d33c3 100644 > --- a/src/abg-dwarf-reader.cc > +++ b/src/abg-dwarf-reader.cc > @@ -14243,14 +14243,7 @@ static corpus_sptr > read_debug_info_into_corpus(read_context& ctxt) > { > ctxt.clear_per_corpus_data(); > - > - if (!ctxt.current_corpus()) > - { > - corpus_sptr corp (new corpus(ctxt.env(), ctxt.elf_path())); > - ctxt.current_corpus(corp); > - if (!ctxt.env()) > - ctxt.env(corp->get_environment()); > - } > + ctxt.current_corpus(std::make_shared<corpus>(ctxt.env(), > ctxt.elf_path())); > > // First set some mundane properties of the corpus gathered from > // ELF. > -- > 2.31.1.818.g46aad6cb9e-goog > >
Giuliano Procida <gprocida@google.com> a écrit: > The DWARF reader appears to create a new corpus object only if one is > not already present. However, the only case where there can be > multiple corpora is when build_corpus_group_from_kernel_dist_under is > called and this function clears down the reader context, including the > current corpus, between reading ELF objects. > > So it's clearer to just create a fresh corpus object unconditionally > in the DWARF reader. > > * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): > Create new corpus object unconditionally. > > Signed-off-by: Giuliano Procida <gprocida@google.com> Applied to master, thanks! [...] Cheers,
Giuliano Procida <gprocida@google.com> a écrit: > The DWARF reader appears to create a new corpus object only if one is > not already present. However, the only case where there can be > multiple corpora is when build_corpus_group_from_kernel_dist_under is > called and this function clears down the reader context, including the > current corpus, between reading ELF objects. > > So it's clearer to just create a fresh corpus object unconditionally > in the DWARF reader. > > * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): > Create new corpus object unconditionally. > > Signed-off-by: Giuliano Procida <gprocida@google.com> Applied to master. Thanks! [...] Cheers,
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index a06ca88f..135d33c3 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -14243,14 +14243,7 @@ static corpus_sptr read_debug_info_into_corpus(read_context& ctxt) { ctxt.clear_per_corpus_data(); - - if (!ctxt.current_corpus()) - { - corpus_sptr corp (new corpus(ctxt.env(), ctxt.elf_path())); - ctxt.current_corpus(corp); - if (!ctxt.env()) - ctxt.env(corp->get_environment()); - } + ctxt.current_corpus(std::make_shared<corpus>(ctxt.env(), ctxt.elf_path())); // First set some mundane properties of the corpus gathered from // ELF.