From patchwork Tue Oct 10 20:40:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 77462 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 910773856967 for ; Tue, 10 Oct 2023 20:47:03 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 92D623858C30 for ; Tue, 10 Oct 2023 20:46:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92D623858C30 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8F3BD1E1A8; Tue, 10 Oct 2023 16:46:19 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 22/24] gdb: don't call so_list::clear in free_so Date: Tue, 10 Oct 2023 16:40:17 -0400 Message-ID: <20231010204213.111285-23-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231010204213.111285-1-simon.marchi@efficios.com> References: <20231010204213.111285-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3496.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I think this `so.clear ()` call is not useful. - so_list::clear deletes some things that now get automatically deleted when the so_list gets deleted right after in free_so. - so_list::clear resets some scalar fields of so_list, which we don't really care about since the so_list gets deleted right after. - so_list::clear calls target_so_ops::clear_so, of which there is a single implementation, svr4_clear_so. That implementation just resets a field in lm_info_svr4, which we don't care about, as it will get deleted when the so_list gets deleted right after. Change-Id: Ie4d72f2a04a4129e55c460bb5c69bc0af0d12b32 --- gdb/solib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gdb/solib.c b/gdb/solib.c index 9c10340ff583..2e4881798339 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -664,7 +664,6 @@ lm_info::~lm_info () = default; void free_so (so_list &so) { - so.clear (); delete &so; }