Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/Python: Added ThreadExitedEvent
Date: Mon, 18 Apr 2022 12:30:22 +0200	[thread overview]
Message-ID: <CACx6OkxQx16yomL9XDi8TvbLGM_4yY5+A43kvpf2UwMYkcWB7w@mail.gmail.com> (raw)
In-Reply-To: <87bkx2z0e6.fsf@tromey.com>

Tom> Space before open paren here.
I'll go over and fix white spacing and formatting in the next patch version
(finally getting
the hang of it more or less).

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

So my reasoning for this was; since the thread is exiting it is dying, and
from
a Python perspective I thought it proper not to hold on to any resources
that
GDB otherwise would dispose of. I'm open to suggestions for whether or not
this logic is sound. So if we are to return the thread object itself,
I would probably have to change the function from where the event is
emitted, or perhaps
some other change.

It's currently emitted inside `delete_thread_object` which is a function
that is attached
to the observer `gdb::observers::thread_exit` in py-inferior.c. So if we
are to return
a reference to the thread object, the function attached here should
probably be removed
entirely and replaced with just emitting the newly introduced "thread exit
event" (and handle
the de-allocation of the thread object inside the thread exit event type
tp_dealloc function).

Thanks for taking your time to review!
Simon F.

  reply	other threads:[~2022-04-18 10:30 UTC|newest]

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

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=CACx6OkxQx16yomL9XDi8TvbLGM_4yY5+A43kvpf2UwMYkcWB7w@mail.gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=simon.farre.cx@gmail.com \
    --cc=tom@tromey.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