From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4C0F43858D35 for ; Mon, 3 Aug 2020 00:08:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4C0F43858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5D6B41E111; Sun, 2 Aug 2020 20:08:55 -0400 (EDT) Subject: Re: [PATCH 02/23] Don't rely on inferior_ptid in record_full_wait To: Tom Tromey Cc: Pedro Alves , gdb-patches@sourceware.org References: <20190906232807.6191-1-palves@redhat.com> <20190906232807.6191-3-palves@redhat.com> <87h7tope4d.fsf@tromey.com> <9d4243a6-3b43-802b-b1d6-4cd0497205af@simark.ca> <87d04ap01b.fsf@tromey.com> <874kplorzp.fsf@tromey.com> From: Simon Marchi Message-ID: Date: Sun, 2 Aug 2020 20:08:48 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <874kplorzp.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 03 Aug 2020 00:08:57 -0000 On 2020-08-02 1:52 p.m., Tom Tromey wrote: > No, I didn't notice that the wait_as function sets the kind at the > start. So some minus_one_ptid returns seem to use > TARGET_WAITKIND_IGNORE. That's fine. But FWIW, I think it's not right to see the ptid as the "main" thing the wait methods return. They primarily return a "waitkind", and depending on that waitkind's kind, there may be a payload attached to it. If you return TARGET_WAITKIND_IGNORE, there's no payload attached to it. If you return TARGET_WAITKIND_EXITED, then there must be a ptid (in ecs->ptid) as well as an exit code (in ecs->ws.value.integer). If you return TARGET_WAITKIND_STOPPED, then there must be a ptid (in ecs->ptid) as well as a signal number (in ecs->ws.value.sig). And so on. I think that the fact that the wait methods return a ptid is an historical quirk, but my intuition is that it's not that important, and not the central piece of what "wait" returns. Simon