From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id DA9983858C54 for ; Mon, 16 Oct 2023 18:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA9983858C54 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 DA9983858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697481419; cv=none; b=cuCDc8cJEkgMnYNwf8ifhyWQSmAXQh4A2ox0MbeMbtBCik1BGRjOS5HhSP1vfY9b0egi11TiATJvZ/c7SSFfNPro3p4rKNCMEoyvwYtsN6aufukLOGhrQAL8GNiPhZKI1w26Rg8R1g4Ev1lZkbSx6NJQhXqHw134IwjmNtcDalg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697481419; c=relaxed/simple; bh=OQJP+wcPv1l7+ueqg3WNngHddRAD3Ht25aT/xlWVWZU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vHAQptaNonFXYzMHVsyH95dLxcHMtbDHcf+DtkH9+ZuAGPy782w/gtIbwz10J6ZxoKEk0cDCXHdm7sPpwe2vuik7SX3UvpTxs51y+fL9RxTlqVFYckVoNE6Ftj9n6Hxo5QbUOMsmAKaZ8aiT8BPnSnqeouVyq/JhqphIdA9TXz4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-79f8e4108c3so211521139f.3 for ; Mon, 16 Oct 2023 11:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1697481417; x=1698086217; darn=sourceware.org; h=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=G3HrzKNeFH2Z5QOFe2fx6BajoZ5EemCtrvdOd7RqrUw=; b=e1Wfcn9N/yY7R6yOsu2bIAfyIJhXyHm1BVMrk4Y2YyQXWciyhMwPCI75hYwf/ze+nZ qfBBNM3PbC3tMmf8CIuhEE6t5yQG2ds4RvJpGdInIJjOEY2VNDqiyWQ21vFVvr5/6seg SJsgXAicTKYYMq3N87V5kJCnWlvwT38UAoTJGMh1J2WxjfId/eqJ4xKJO7J5VEen4d/R PoyjSLjNNBtK0F5goIHXT7LdKbleEA5VOJ8kjrl1S1MAAg9Wpiv+PfVNvHYs/2g+JifF R+aOn6hN8MV2xynKyZwvbgzC4ICVn2pwza4ag+QREyyQnAz4a/gdlebFFqTXvH25Oxmi NMbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697481417; x=1698086217; h=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=G3HrzKNeFH2Z5QOFe2fx6BajoZ5EemCtrvdOd7RqrUw=; b=iOK0kIoW94gbLpg0I5vxOxcuoeFtuVRBNyX0lHXMvQBeFrcpauquTnEbc+re01AUZR h1IaHfM4ZE3ELyMkuCfwa6Aore0gM5PdzO1iPYxMz2g/qpCnHGlHW6MudJnxwr6mnyop yEHeH+S5R0qMP4WOKRd6P+av+x0toQNuK+eRDkAvZ8DXODBgJ9kMyggpSGpHqGHpVGK5 A5hgmwE3cuUmoPHVXkFl2bDZqW+L+i3SbO6+OoIqvxqiHgeFiwm6cywkCPjmNihyseNO IW3YlfkOui29eDaWmXNRaPxSZ/f0oruEE5Gc0Mhv5InPsOoRQl8u1lJBxpHdQ1tu5nUl P1nA== X-Gm-Message-State: AOJu0Yx4oVk5ZFujg0+4Swn4CWvfcpQCj+4avIfNG5ODnGl6LccBcxYC qfVi227TdsiobuWYYcdTo2rCMQ== X-Google-Smtp-Source: AGHT+IHvOU6Xuz2QN7s1pdCBybPZWjZv59mtwDBdpqAWyFz1+pwNEoohuy1ZtqCLBSu16NLTE0p8WQ== X-Received: by 2002:a05:6602:2e88:b0:787:1d0a:ce81 with SMTP id m8-20020a0566022e8800b007871d0ace81mr2467iow.13.1697481417098; Mon, 16 Oct 2023 11:36:57 -0700 (PDT) Received: from murgatroyd (71-211-130-31.hlrn.qwest.net. [71.211.130.31]) by smtp.gmail.com with ESMTPSA id m31-20020a056638271f00b0042b09bde126sm425493jav.165.2023.10.16.11.36.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 11:36:56 -0700 (PDT) From: Tom Tromey To: Simon Farre Cc: gdb-patches@sourceware.org, tromey@adacore.com Subject: Re: [PATCH v1] [gdb/python]: Add StepEndedEvent (simplifies DAP) References: <20231016115026.133574-1-simon.farre.cx@gmail.com> X-Attribution: Tom Date: Mon, 16 Oct 2023 12:36:55 -0600 In-Reply-To: <20231016115026.133574-1-simon.farre.cx@gmail.com> (Simon Farre's message of "Mon, 16 Oct 2023 13:50:26 +0200") Message-ID: <878r82s9bs.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.4 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Simon" == Simon Farre writes: Simon> Adds the StepEndedEvent which signals that one of the thread Simon> finite state machines finished. Matches the behavior of what is Simon> generated by MI; the "end stepping range". Simon> This should simplify some of the DAP code, where "expected stop Simon> reason" is being tracked. This logic should be handled by the Simon> Python interpreter to begin with, instead. If possible it would be better to go all the way and add the stop reason to the stop event all the time. This has been wanted for a long time, see https://sourceware.org/bugzilla/show_bug.cgi?id=13587 Simon> +#include "mi/mi-common.h" I think this isn't needed in the current patch, but I guess would be needed if this called async_reason_lookup. Simon> +static gdbpy_ref<> maybe_create_step_ended () Simon> +{ Simon> + const auto tp = inferior_thread(); Simon> + const auto fsm = tp != nullptr ? tp->thread_fsm() : nullptr; Simon> + if (fsm != nullptr && fsm->finished_p () && Simon> + fsm->async_reply_reason () == EXEC_ASYNC_END_STEPPING_RANGE) The stop reason idea is basically -- why single out one kind of stop reason when we could do something more generic. We wouldn't need a subclass, I guess, we could just stick the extra info into the current event. Not sure though. This area is kind of messy due to some unfortunate choices early on. Tom