From: Pedro Alves <pedro@palves.net>
To: Simon Farre <simon.farre.cx@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb/Python: Added ThreadExitedEvent
Date: Mon, 18 Apr 2022 17:19:18 +0100 [thread overview]
Message-ID: <b68a6b46-46d4-044b-cd6a-726898184cb6@palves.net> (raw)
In-Reply-To: <20220412090315.1142824-1-simon.farre.cx@gmail.com>
On 2022-04-12 10:03, Simon Farre via Gdb-patches wrote:
>
> +@item events.thread_exited
> +This is emitted when @value{GDBN} notices a thread has exited. The event
> +is of type @code{gdb.ThreadExitedEvent}. This has three attributes:
> +
> +@defvar ThreadExitedEvent.num
> +Global thread number.
> +@end defvar
> +
> +@defvar ThreadExitedEvent.lwp
> +The light weight process ID.
> +@end defvar
> +
> +@defvar ThreadExitedEvent.tid
> +The thread's thread id
> +@end defvar
Do other thread events have these same attributes? It seems odd to print lwp and tid, but not pid.
But why not a ptid object instead? InferiorThread has:
~~~
Variable: InferiorThread.ptid
ID of the thread, as assigned by the operating system. This attribute is a tuple containing three integers.
The first is the Process ID (PID); the second is the Lightweight Process ID (LWPID), and the third is the Thread ID (TID).
Either the LWPID or TID may be 0, which indicates that the operating system does not use that identifier.
~~~
And other events use it too, like:
~~~
Variable: InferiorCallPreEvent.ptid
The thread in which the call will be run.
gdb.InferiorCallPostEvent
Indicates that a function in the inferior has just been called.
Variable: InferiorCallPostEvent.ptid
~~~
I think not using ptid requires a strong justification.
But I also think that it might be useful to contrast the attributes included in the Python event to
what MI events include.
next prev parent reply other threads:[~2022-04-18 16:19 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
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 [this message]
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=b68a6b46-46d4-044b-cd6a-726898184cb6@palves.net \
--to=pedro@palves.net \
--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