From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ym0zGcFMC2AaNQAAWB0awg (envelope-from ) for ; Fri, 22 Jan 2021 17:08:01 -0500 Received: by simark.ca (Postfix, from userid 112) id 4D0051EF80; Fri, 22 Jan 2021 17:08:01 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 ED7E91E940 for ; Fri, 22 Jan 2021 17:08:00 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C78E382E800; Fri, 22 Jan 2021 22:08:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C78E382E800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611353280; bh=hYLY9uDbqgbWsRpSUAAJD6OJiaEiZxrBCXLy8pfc2l4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Ek/XEeRXHI8fInOEZ6rk8994P8nmzorjLr3W63txSDe448PgTyD7PCr1idyw3c3hN TcWdy/m71i6PzyPivJnvYBpFfhOs+EALK27qp39Nwdq0FjeCEfuAVhCijObDzemtNo ffeW+GA4Z1qHcgbklHILgg2lNAYAXKZxcKyFIh6U= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B0E54386F41D for ; Fri, 22 Jan 2021 22:07:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0E54386F41D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10MM7ni5026784 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Jan 2021 17:07:54 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10MM7ni5026784 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (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 00E5F1E940; Fri, 22 Jan 2021 17:07:48 -0500 (EST) Subject: Re: [PATCH v3 4/5] gdb: generalize commit_resume, avoid commit-resuming when threads have pending statuses To: Simon Marchi , Pedro Alves , gdb-patches@sourceware.org References: <20210108041734.3873826-1-simon.marchi@polymtl.ca> <20210108041734.3873826-5-simon.marchi@polymtl.ca> <93a38356-a5ea-b6e4-d86d-ed8db5f9545e@palves.net> <617137d0-d740-c495-b7c1-9ad400ae617b@efficios.com> Message-ID: <3d43e75e-4dd2-81f3-6b09-09bdd733be32@polymtl.ca> Date: Fri, 22 Jan 2021 17:07:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <617137d0-d740-c495-b7c1-9ad400ae617b@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 22 Jan 2021 22:07:49 +0000 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@sourceware.org Sender: "Gdb-patches" On 2021-01-11 3:28 p.m., Simon Marchi wrote: > On 2021-01-09 3:34 p.m., Pedro Alves wrote: >>> @@ -86,6 +77,35 @@ class process_stratum_target : public target_ops >>> >>> /* The connection number. Visible in "info connections". */ >>> int connection_number = 0; >>> + >>> + /* Whether resumed threads must be committed to the target. >>> + >>> + When true, resumed threads must be committed to the execution target. >>> + >>> + When false, the process stratum target may leave resumed threads stopped >>> + when it's convenient or efficient to do so. When the core requires resumed >>> + threads to be committed again, this is set back to true and calls the >>> + `commit_resumed` method to allow the target to do so. >>> + >>> + To simplify the implementation of process stratum targets, the following >>> + methods are guaranteed to be called with COMMIT_RESUMED_STATE set to >>> + false: >>> + >>> + - resume >>> + - stop >>> + - wait >> >> Should we mention this in the documentation of each of these methods? > > Yeah that would be nice. Would you mention it in both places > or just in those methods' documentation? I just remembered why I put it there and not on the target methods. Since commit-resumed is a concept specific to process targets, I don't think that information belongs in struct target_ops, since it doesn't make sense for other target_ops implementers. Simon