Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Farre <simon.farre.cx@gmail.com>
Cc: gdb-patches@sourceware.org,  tromey@adacore.com
Subject: Re: [PATCH v1] [gdb/python]: Add StepEndedEvent (simplifies DAP)
Date: Mon, 16 Oct 2023 12:36:55 -0600	[thread overview]
Message-ID: <878r82s9bs.fsf@tromey.com> (raw)
In-Reply-To: <20231016115026.133574-1-simon.farre.cx@gmail.com> (Simon Farre's message of "Mon, 16 Oct 2023 13:50:26 +0200")

>>>>> "Simon" == Simon Farre <simon.farre.cx@gmail.com> 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

  parent reply	other threads:[~2023-10-16 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 11:50 Simon Farre
2023-10-16 12:11 ` Eli Zaretskii
2023-10-16 15:01 ` Andrew Burgess
2023-10-16 16:09   ` Simon Farre
2023-10-16 18:36 ` Tom Tromey [this message]
2023-11-14 18:43 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r82s9bs.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.farre.cx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox