public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/Python: Added ThreadExitedEvent
Date: Fri, 15 Apr 2022 12:06:57 -0600	[thread overview]
Message-ID: <87bkx2z0e6.fsf@tromey.com> (raw)
In-Reply-To: <20220412090315.1142824-1-simon.farre.cx@gmail.com> (Simon Farre via Gdb-patches's message of "Tue, 12 Apr 2022 11:03:15 +0200")

>>>>> "Simon" == Simon Farre via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> Currently no event is emitted for a thread exit.
Simon> This adds this functionality by emitting a new gdb.ThreadExitedEvent.

Simon> It currently provides three attributes, the LWP id, the TID and
Simon> the GLOBAL NUM. A case could be made to also add the per-inferior
Simon> number, but, I wasn't sure if it is actually any useful.

Simon> Added info to docs & the NEWS file as well.

Eli will have to review the docs, unless he already has.

Simon> +  if (!evregpy_no_listeners_p (gdb_py_events.thread_exited))
Simon> +    {
Simon> +      ptid_t ptid = tmp->thread_obj->thread->ptid;
Simon> +      int global_num = tmp->thread_obj->thread->global_num;
Simon> +      if (emit_thread_exit_event (ptid, global_num) < 0)
Simon> +	gdbpy_print_stack();

Space before open paren here.

Simon> +emit_thread_exit_event (ptid_t ptid, int global_num)
Simon> +{
Simon> +  gdbpy_ref<> thread_event_obj = create_event_object (&thread_exited_event_object_type);
Simon> +  if (thread_event_obj == NULL)

We're using 'nullptr' in new code.

I'm curious why the event has various attributes of the thread object
but not a reference to the thread object itself.  That seems a little
odd.

Simon> +    append GDBFLAGS " -ex \"set non-stop on\""

Is this really needed?

Otherwise, this patch looks good.  Thank you for doing this.

Tom

  reply	other threads:[~2022-04-15 18:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  9:03 Simon Farre
2022-04-15 18:06 ` Tom Tromey [this message]
2022-04-18 10:30   ` Simon Farre
2022-04-18 13:57     ` Tom Tromey
2022-04-15 19:46 ` Eli Zaretskii
2022-04-18  9:38   ` Simon Farre
2022-04-18  9:41     ` Eli Zaretskii
2022-04-18 13:58     ` Tom Tromey
2022-04-18 16:19 ` Pedro Alves
2022-04-19 11:42   ` Simon Farre

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=87bkx2z0e6.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).