From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YvsBCRjAe2O8EBsAWB0awg (envelope-from ) for ; Mon, 21 Nov 2022 13:14:48 -0500 Received: by simark.ca (Postfix, from userid 112) id 17EE31E124; Mon, 21 Nov 2022 13:14:48 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=IKwnte8W; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 BEB041E0D3 for ; Mon, 21 Nov 2022 13:14:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76C84384F4AA for ; Mon, 21 Nov 2022 18:14:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76C84384F4AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669054486; bh=g9lAiosCEQh/73C3SSCrybCc2nVEaH3vlqfBibbvLJM=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IKwnte8WuIHu67l0WsYdleL888VkCcDgHX9WRYvPwAPMWEKEWfWiYH0mWkiUcNvU0 DD7Nl1jyql3/a12FKj7gg4p7Tds9b7nRbI/P/JQAebf+rku133nq2VgC+Le5vzrsOr ka7fstF9Z/Sw9Wq1U1l1FvA9eyBpqfB6PjzvLRoQ= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 241A6384F6E5 for ; Mon, 21 Nov 2022 18:14:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 241A6384F6E5 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D726F1E0D3; Mon, 21 Nov 2022 13:14:19 -0500 (EST) Message-ID: <102b6335-e33d-ffc0-b7a5-fd79d4cf26af@simark.ca> Date: Mon, 21 Nov 2022 13:14:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] Remove reset_ecs Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20221121175830.3585569-1-tom@tromey.com> In-Reply-To: <20221121175830.3585569-1-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 11/21/22 12:58, Tom Tromey wrote: > I noticed that execution_control_state has a 'reset' method, and > there's also a 'reset_ecs' function that calls it. This patch cleans > this area up a little by adding a parameter to the constructor and the > reset method. Some extraneous variables are also removed, like here: > > - struct execution_control_state ecss; > - struct execution_control_state *ecs = &ecss; > > Here 'ecs' is never changed, so this patch removes it entirely in > favor of just using the object everywhere. I think we could get rid of the reset method as well, it's not used outside of the constructor. Like this: struct execution_control_state { explicit execution_control_state (thread_info *thr = nullptr) : ptid (thr != nullptr ? thr->ptid : null_ptid), event_thread (thr) {} process_stratum_target *target = nullptr; ptid_t ptid; /* The thread that got the event, if this was a thread event; NULL otherwise. */ struct thread_info *event_thread; target_waitstatus ws; int stop_func_filled_in = 0; CORE_ADDR stop_func_start = 0; CORE_ADDR stop_func_end = 0; const char *stop_func_name = nullptr; int wait_some_more = 0; /* True if the event thread hit the single-step breakpoint of another thread. Thus the event doesn't cause a stop, the thread needs to be single-stepped past the single-step breakpoint before we can switch back to the original stepping thread. */ int hit_singlestep_breakpoint = 0; }; Simon