From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2O5tAs8Ijl9yRwAAWB0awg (envelope-from ) for ; Mon, 19 Oct 2020 17:44:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 084DE1EFC3; Mon, 19 Oct 2020 17:44:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AAC6A1EFBB for ; Mon, 19 Oct 2020 17:44:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D679381DCE9; Mon, 19 Oct 2020 21:44:39 +0000 (GMT) Received: from gateway20.websitewelcome.com (gateway20.websitewelcome.com [192.185.50.28]) by sourceware.org (Postfix) with ESMTPS id 78D913850409 for ; Mon, 19 Oct 2020 21:44:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 78D913850409 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 cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id CC9A0400C4F0B for ; Mon, 19 Oct 2020 16:42:54 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id UcxHkSRUSPiqfUcxHkYhS1; Mon, 19 Oct 2020 16:44:35 -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=wUZQlvKp1zqWdTw4wermRSbwJFIvecZDMNDRAzdgfS4=; b=d95cICO8zglJYDiN0uRmySwBJw tk2lLVnRiOywL6BSwYg8z3cznBdhk1Jd5lhEomTsjs+pgwsCxg6TYvvtr/Xa4AXYVlcjorjPkqPbl dnJKyb9sFXVFnxIQBydNAV6+3; Received: from 75-166-102-113.hlrn.qwest.net ([75.166.102.113]:45712 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 1kUcxG-004Oci-SR; Mon, 19 Oct 2020 15:44:34 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH v2 10/16] Change clear_program_space_solib_cache to method on program_space Date: Mon, 19 Oct 2020 15:44:23 -0600 Message-Id: <20201019214429.13815-11-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20201019214429.13815-1-tom@tromey.com> References: <20201019214429.13815-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: 75.166.102.113 X-Source-L: No X-Exim-ID: 1kUcxG-004Oci-SR X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-102-113.hlrn.qwest.net (bapiya.Home) [75.166.102.113]:45712 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This changes clear_program_space_solib_cache to be a method on program_space. Also, it removes a call to this function from the program_space destructor, as that is not necessary. gdb/ChangeLog 2020-10-19 Tom Tromey * progspace.c (program_space::~program_space): Don't call clear_program_space_solib_cache. (program_space::clear_solib_cache): Rename from clear_solib_cache. * solib.c (handle_solib_event): Update. * progspace.h (struct program_space) : New method. (clear_program_space_solib_cache): Don't declare. --- gdb/ChangeLog | 11 +++++++++++ gdb/progspace.c | 7 +++---- gdb/progspace.h | 10 +++++----- gdb/solib.c | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gdb/progspace.c b/gdb/progspace.c index 52482ca8f64..84baaeab292 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -154,7 +154,6 @@ program_space::~program_space () clear_symtab_users (SYMFILE_DEFER_BP_RESET); if (!gdbarch_has_shared_address_space (target_gdbarch ())) free_address_space (this->aspace); - clear_program_space_solib_cache (this); /* Discard any data modules have associated with the PSPACE. */ program_space_free_data (this); } @@ -448,10 +447,10 @@ update_address_spaces (void) /* See progspace.h. */ void -clear_program_space_solib_cache (struct program_space *pspace) +program_space::clear_solib_cache () { - pspace->added_solibs.clear (); - pspace->deleted_solibs.clear (); + added_solibs.clear (); + deleted_solibs.clear (); } diff --git a/gdb/progspace.h b/gdb/progspace.h index e719cee57d0..22805d74f37 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -288,6 +288,11 @@ struct program_space ebfd = std::move (abfd); } + /* Reset saved solib data at the start of an solib event. This lets + us properly collect the data when calling solib_add, so it can then + later be printed. */ + void clear_solib_cache (); + /* Unique ID number. */ int num = 0; @@ -435,11 +440,6 @@ extern int address_space_num (struct address_space *aspace); mappings. */ extern void update_address_spaces (void); -/* Reset saved solib data at the start of an solib event. This lets - us properly collect the data when calling solib_add, so it can then - later be printed. */ -extern void clear_program_space_solib_cache (struct program_space *); - /* Keep a registry of per-pspace data-pointers required by other GDB modules. */ diff --git a/gdb/solib.c b/gdb/solib.c index 9df4eca888a..baa1801635b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1252,7 +1252,7 @@ handle_solib_event (void) if (ops->handle_event != NULL) ops->handle_event (); - clear_program_space_solib_cache (current_inferior ()->pspace); + current_inferior ()->pspace->clear_solib_cache (); /* Check for any newly added shared libraries if we're supposed to be adding them automatically. Switch terminal for any messages -- 2.17.2