From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.152.11]) by sourceware.org (Postfix) with ESMTPS id 773E23947C0D for ; Fri, 28 Aug 2020 16:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 773E23947C0D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 6E79D7003 for ; Fri, 28 Aug 2020 11:23:53 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id BhAPkyAIKn9FWBhAPkWboh; Fri, 28 Aug 2020 11:23:53 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S07bZiwPGxEcSgE1Tzy4i2TCoR2uMSitPtm9JnBe9kQ=; b=hSUbmj9B88tO0yxay1z9dVvzSP MeEXTO+RAtr7Gqq+pLrmY8B376YOT+2wUcQ1h08XQKp1DuggVr/QWCObs7hM4Ns6l8X1Uu5ar5XE1 dGqgTtHhGFR5SA81+3z3Q5Hhe; Received: from 71-218-12-75.hlrn.qwest.net ([71.218.12.75]:33904 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kBhAP-002WJo-5y; Fri, 28 Aug 2020 10:23:53 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 03/13] Use gdb_bfd_sections in gdb_bfd_close_or_warn Date: Fri, 28 Aug 2020 10:23:39 -0600 Message-Id: <20200828162349.987-4-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200828162349.987-1-tom@tromey.com> References: <20200828162349.987-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.218.12.75 X-Source-L: No X-Exim-ID: 1kBhAP-002WJo-5y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-218-12-75.hlrn.qwest.net (bapiya.Home) [71.218.12.75]:33904 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3033.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NEUTRAL, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 16:23:55 -0000 This changes gdb_bfd_close_or_warn to avoid bfd_map_over_sections, in favor of iteration. gdb/ChangeLog 2020-08-28 Tom Tromey * gdb_bfd.c (free_one_bfd_section): Remove 'abfd' and 'ignore' parameters. (gdb_bfd_close_or_warn): Use foreach. --- gdb/ChangeLog | 6 ++++++ gdb/gdb_bfd.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index 25e0178a8b8..43b576f12a0 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -484,7 +484,7 @@ gdb_bfd_open (const char *name, const char *target, int fd, BFD. */ static void -free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) +free_one_bfd_section (asection *sectp) { struct gdb_bfd_section_data *sect = (struct gdb_bfd_section_data *) bfd_section_userdata (sectp); @@ -513,7 +513,8 @@ gdb_bfd_close_or_warn (struct bfd *abfd) int ret; const char *name = bfd_get_filename (abfd); - bfd_map_over_sections (abfd, free_one_bfd_section, NULL); + for (asection *sect : gdb_bfd_sections (abfd)) + free_one_bfd_section (sect); ret = bfd_close (abfd); -- 2.17.2