From patchwork Mon Jul 15 18:40:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93947 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 6028E3864847 for ; Mon, 15 Jul 2024 18:41:23 +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 5E8963858435 for ; Mon, 15 Jul 2024 18:41:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E8963858435 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5E8963858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721068862; cv=none; b=fhOah2szuKj8Ib5oDy/X4lDPdBCFVwQE9S3J6wy6HUoCQZRo8KYCfEQQGYOVOGP9oy7W5cCUdJO1pew9NRTsaUd3/owZ9FfpI+7uP7erbBzPTChUaBDE9wjYVm3O6+eCZLc0APU57NrT3lM1/CYcaWGBL+Rbu8UwK/T/w98S4Ig= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721068862; c=relaxed/simple; bh=WhwbVL+0NbQd2p9e1YAB96rhOUWtVAkp9+BQ4+zyDLY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ivZ/EDUCfbMYpXrm/IYDf49t3hFdrsAmbBt2UJS5iyzqeZQclOvc8t0UBSa+04c8mtZVIF0s2iqej6fwNQLnNYl2FYpyUuDH+K59NEedfRjkrMSUtkWGlgKLSMp72hj163uYAhUP/OquPyUJaJwq2ijpqAKY6Ccs2YSBanaH34Q= ARC-Authentication-Results: i=1; server2.sourceware.org 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 A9B331E097; Mon, 15 Jul 2024 14:40:59 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdb: pass program space to overlay_invalidate_all Date: Mon, 15 Jul 2024 14:40:57 -0400 Message-ID: <20240715184059.80535-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3496.3 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 Make the current program space bubble up one level. Change-Id: I5ac1e3290ad266730465cd60aa3672d45ffa6475 --- gdb/symfile.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) base-commit: 8991986e2413e2da383bef41855a7295ce323c9c diff --git a/gdb/symfile.c b/gdb/symfile.c index 2526998649e0..06c7faf2bbe1 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -91,8 +91,6 @@ static void symbol_file_add_main_1 (const char *args, symfile_add_flags add_flag static const struct sym_fns *find_sym_fns (bfd *); -static void overlay_invalidate_all (void); - static void simple_free_overlay_table (void); static void read_target_long_array (CORE_ADDR, unsigned int *, int, int, @@ -2972,13 +2970,13 @@ section_is_overlay (struct obj_section *section) return 0; } -/* Function: overlay_invalidate_all (void) - Invalidate the mapped state of all overlay sections (mark it as stale). */ +/* Invalidate the mapped state of all overlay sections (mark it as stale) in + PSPACE. */ static void -overlay_invalidate_all (void) +overlay_invalidate_all (program_space *pspace) { - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile *objfile : pspace->objfiles ()) for (obj_section *sect : objfile->sections ()) if (section_is_overlay (sect)) sect->ovly_mapped = -1; @@ -3014,7 +3012,7 @@ section_is_mapped (struct obj_section *osect) { if (overlay_cache_invalid) { - overlay_invalidate_all (); + overlay_invalidate_all (current_program_space); overlay_cache_invalid = 0; } if (osect->ovly_mapped == -1)