From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2607:f138:0:13::2]) by sourceware.org (Postfix) with ESMTPS id 5103D385840F for ; Fri, 21 Jan 2022 20:16:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5103D385840F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id A98F91A84C75 for ; Fri, 21 Jan 2022 15:16:39 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v5 04/15] Enable async mode on supported targets in target_resume. Date: Fri, 21 Jan 2022 12:16:20 -0800 Message-Id: <20220121201631.63530-5-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121201631.63530-1-jhb@FreeBSD.org> References: <20220121201631.63530-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Fri, 21 Jan 2022 15:16:39 -0500 (EST) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 21 Jan 2022 20:16:43 -0000 Enabling async mode above the target layer removes duplicate code in ::resume methods of async-capable targets. Commit 5b6d1e4fa4f ("Multi-target support") enabled async mode in do_target_resume after target_resume returns which is a step in this direction. However, other callers of target_resume such as target_continue do not enable async mode. Rather than enabling async mode in each of the callers after target_resume returns, enable async mode at the end of target_resume. --- gdb/infrun.c | 3 --- gdb/target.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 2e7ed15723f..5959c3e6658 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2187,9 +2187,6 @@ do_target_resume (ptid_t resume_ptid, bool step, enum gdb_signal sig) target_pass_signals (signal_pass); target_resume (resume_ptid, step, sig); - - if (target_can_async_p ()) - target_async (1); } /* Resume the inferior. SIG is the signal to give the inferior diff --git a/gdb/target.c b/gdb/target.c index 950f2f08e31..b7033eaa930 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2673,6 +2673,9 @@ target_resume (ptid_t ptid, int step, enum gdb_signal signal) thread's stop_pc as side effect. */ set_executing (curr_target, ptid, true); clear_inline_frame_state (curr_target, ptid); + + if (target_can_async_p ()) + target_async (1); } /* See target.h. */ -- 2.34.1