From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YJ6lM9oIjl9yRwAAWB0awg (envelope-from ) for ; Mon, 19 Oct 2020 17:44:58 -0400 Received: by simark.ca (Postfix, from userid 112) id D13331EFC3; Mon, 19 Oct 2020 17:44:58 -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=unavailable 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 4E0891E58E for ; Mon, 19 Oct 2020 17:44:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06D0B3894C25; Mon, 19 Oct 2020 21:44:43 +0000 (GMT) Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.197.25]) by sourceware.org (Postfix) with ESMTPS id D871B3844013 for ; Mon, 19 Oct 2020 21:44:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D871B3844013 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 cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 7D031D104 for ; Mon, 19 Oct 2020 16:44:36 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id UcxIkILN3CjCVUcxIkaznv; Mon, 19 Oct 2020 16:44:36 -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=T14Dm7FaXnhn5Hgi8JSBkQRLjK/nxPcsOlIpqUc4F2E=; b=r2CfCQSxaKA7JzjCbFZwd6839p 5G22S27pHRmOjh7bKCBFbFmA4OPtYu6qV+/r4ieOUZK8j917VFvY7BP8OetFflBQeqp5Sq1BtK2Ec qVLLBJ/9HpEBrUsFDwHA1f7aY; 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 1kUcxI-004Oci-7z; Mon, 19 Oct 2020 15:44:36 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH v2 15/16] Don't change current program space in exec_target::close Date: Mon, 19 Oct 2020 15:44:28 -0600 Message-Id: <20201019214429.13815-16-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: 1kUcxI-004Oci-7z 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: 16 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" Now that we've removed the macros and moved various functions to be methods on program_space (removing uses of current_program_space), it's clear that exec_target::close can operate on program spaces without changing the current program space. gdb/ChangeLog 2020-10-19 Tom Tromey * exec.c (exec_target::close): Don't change current program space. --- gdb/ChangeLog | 5 +++++ gdb/exec.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/exec.c b/gdb/exec.c index 3736c3c9e67..3092e8fc3a6 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -154,11 +154,8 @@ exec_target_open (const char *args, int from_tty) void exec_target::close () { - scoped_restore_current_program_space restore_pspace; - for (struct program_space *ss : program_spaces) { - set_current_program_space (ss); ss->target_sections.clear (); ss->exec_close (); } -- 2.17.2