From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dnrIJcFDTmXZBAMAWB0awg (envelope-from ) for ; Fri, 10 Nov 2023 09:52:49 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ghK1Wgb9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8FF991E0D2; Fri, 10 Nov 2023 09:52:49 -0500 (EST) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1954A1E098 for ; Fri, 10 Nov 2023 09:52:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 847D2385276D for ; Fri, 10 Nov 2023 14:52:46 +0000 (GMT) Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id AD3543858C36 for ; Fri, 10 Nov 2023 14:52:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD3543858C36 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD3543858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699627956; cv=none; b=q+u0AGvwP9nGJGu1xfFyNPyIoJn2mTvyiFKL3Rnn6jpUc5q7x8h8gAnWQZjVfmg0e4jMDd8iPOr2t7dp+ZMi6eJwrKSkIYpbkr4oFy9m0Sh7jxxM/wqqpdmdZTHSayls4oZkhDaPURb9K0NadscOFf07vw9024sH4m9SmsydXpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699627956; c=relaxed/simple; bh=5ByNe84oC1Y1JwIOB35doRQ5sShpJ0AbjCa1P7UB1T0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=P6LlH5/e7O41l3zVehIrEhXq3xCir7wsxenQWSQnliYsGSGhXkhDqzjG9yWSGLx3BnE7caD8Hw2izNUnYrrIy7/Tp3BFmqhlM83g1ZPiHhmmfqvJsbmk8+jgC3uU4H1g1T4vhDLJj83BpykmEv6Ky3lREOTHLQGerH/qgpzp1ps= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7ad501764f4so82334139f.3 for ; Fri, 10 Nov 2023 06:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699627953; x=1700232753; darn=sourceware.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Fx4uAMweJetGFPxoXXPWo2Us44kA/U0qr4cu/JFlW/c=; b=ghK1Wgb9jOGlZFoXr3y01pyG+dSmeUErlxF9aP6bPSiMh7A2WwtjVjsSFb1zv395ll vb00OkYLG8YHiQO+Eb6kztlCVVs3NeeZpIgbI7/n+V87sneDdPP+JDl+pf9lEKa4XRz0 VIzoqz+b5/yhzB/ppWHDBP6/ft3fimpdievX1Um++YDbfgNEui5lkZqcD5YlJOp2aokI 9qXiS5FcnFiKAS1Eog02w2rcJ3aB8Db7GajbuoNR25PF3fxgrKs0AhkbJZA3KSUSezvx fy8QT47gjs5IdkpQp3QDDiTZ8h+uehOBPn6y0epjzP2fVA47pPgAJkp5nWTum18qdRr4 ejuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699627953; x=1700232753; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Fx4uAMweJetGFPxoXXPWo2Us44kA/U0qr4cu/JFlW/c=; b=TcJlYjKRLIm5IxsuRhFMYycjVxHVMuas1P/zr8ZuhA5WLeHYrl6eYfh4xUgEO1DkMQ 975wMJNVe+186j5FAzW3lkHLBVgQFruAz+s8OgA8ZrBhz0eKSqnynGJphW+6QYrfml3M iAfbfunv8hCXlvqm58thKU55BKYmr6HbU6qiYQFxDTGvoDRd0vwQmGM62uQLv6Yo5pXQ BIxD76BmPqHfmstOxrtxHY+3eHnE0kWzf9lckvLz/E1iVewBjoO+mcD3PfGE5yyEuySP j22Gg4yq47pIlja6hinHWpPMthIUrJhYbBpbBB+E72nTi5PuteHgY8v6acwzuQa5Nfr1 Ga/g== X-Gm-Message-State: AOJu0Ywb+3SL84ONB9HGPr0ARXuKLDlgqW5M9Ncpv1SJbR2ijoL1BdHQ Lk4hWKaQIJCpL75A41ew9iSAi/8qT4MaZ9c28uymlQ== X-Google-Smtp-Source: AGHT+IGTEBdaDS5KIcY4KP/ytwgwyXfxlF3jOnvIJRDvOW8+EKW399Mp2mgfpHUBf0Yff4wOxLRCdQ== X-Received: by 2002:a5d:878c:0:b0:7a9:571c:5694 with SMTP id f12-20020a5d878c000000b007a9571c5694mr5570055ion.10.1699627953656; Fri, 10 Nov 2023 06:52:33 -0800 (PST) Received: from murgatroyd (97-122-77-73.hlrn.qwest.net. [97.122.77.73]) by smtp.gmail.com with ESMTPSA id x11-20020a056638160b00b0042b3dcb1106sm290959jas.47.2023.11.10.06.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 06:52:33 -0800 (PST) From: Tom Tromey To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] Implement the notStopped DAP response References: <20231107-dap-not-stopped-v1-0-3d91c935255d@adacore.com> <20231107-dap-not-stopped-v1-3-3d91c935255d@adacore.com> <878r78bqlk.fsf@adacore.com> X-Attribution: Tom Date: Fri, 10 Nov 2023 07:52:32 -0700 In-Reply-To: <878r78bqlk.fsf@adacore.com> (=?utf-8?Q?=22K=C3=A9vin?= Le Gouguec"'s message of "Wed, 08 Nov 2023 09:23:51 +0100") Message-ID: <87a5rlvexb.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org >>>>> "K=C3=A9vin" =3D=3D K=C3=A9vin Le Gouguec wri= tes: >> +# True when the inferior is thought to be running, False otherwise. >> +# This may be accessed from any thread, which can be racy. However, >> +# this unimportant because this global is only used for the >> +# 'notStopped' response, which itself is inherently racy. >> +inferior_running =3D False K=C3=A9vin> Out of curiosity, could `inferior_thread ()->state` have helped= here? K=C3=A9vin> (Exposing it as a gdb.Inferior method perhaps?) K=C3=A9vin> Not necessarily with the "racy" part; thinking more of the "kee= p a K=C3=A9vin> single source of truth" part (i.e. dispense with relying on eve= nt K=C3=A9vin> notifications). Possibly, but it couldn't be called from a non-gdb thread, so we'd have to send a message to the gdb thread and then a message back. >> + # Import this as late as possible. FIXME. >> + from .events import inferior_running K=C3=A9vin> Assuming this is what the FIXME is about (apologies if not): an K=C3=A9vin> alternative could be doing a bare `import .events`, then lookup K=C3=A9vin> `.events.inferior_running` in check(). Or defining an accessor= function K=C3=A9vin> in .events and importing that instead of this global. The problem is a circular import, as events imports from server. I may just remove this comment? Not sure. Originally here I was thinking of putting more event listeners in server.py, but it seemed strange not to just reuse the existing ones. Tom