[RFA,1/3] Add new_inferior, inferior_deleted, and new_thread events

Message ID 87k216gr0w.fsf@bapiya
State New, archived
Headers

Commit Message

Tom Tromey Sept. 10, 2017, 9:52 p.m. UTC
  >>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> "This emitted".  I also noticed that for other events you used "This
Simon> is notified".  Perhaps it would be better to stick with "This is
Simon> emitted" everywhere to be consistent.

How's this then?

Tom
  

Comments

Simon Marchi Sept. 11, 2017, 11:54 a.m. UTC | #1
On 2017-09-10 23:52, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> "This emitted".  I also noticed that for other events you used 
> "This
> Simon> is notified".  Perhaps it would be better to stick with "This is
> Simon> emitted" everywhere to be consistent.
> 
> How's this then?
> 
> Tom
> 
> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
> index 32d7939..39def2a 100644
> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -2989,6 +2989,39 @@ invalid state; that is, the @code{is_valid}
> method will return
>  This event carries no payload.  It is emitted each time @value{GDBN}
>  presents a prompt to the user.
> 
> +@item events.new_inferior
> +This is emitted when a new inferior is created.  Note that the
> +inferior is not necessarily running; in fact, it may not even have an
> +associated executable.
> +
> +The event is of type @code{gdb.NewInferiorEvent}.  This has a single
> +attribute:
> +
> +@defvar NewInferiorEvent.inferior
> +The new inferior, a @code{gdb.Inferior} object.
> +@end defvar
> +
> +@item events.inferior_deleted
> +This is emitted when an inferior has been deleted.  Note that this is
> +not the same as process exit; it is notified when the inferior itself
> +is removed, say via @code{remove-inferiors}.
> +
> +The event is of type @code{gdb.InferiorDeletedEvent}.  This has a 
> single
> +attribute:
> +
> +@defvar NewInferiorEvent.inferior
> +The inferior that is being removed, a @code{gdb.Inferior} object.
> +@end defvar
> +
> +@item events.new_thread
> +This is emitted when @value{GDBN} notices a new thread.  The event is 
> of
> +type @code{gdb.NewThreadEvent}, which extends @code{gdb.ThreadEvent}.
> +This has a single attribute:
> +
> +@defvar NewThreadEvent.inferior_thread
> +The new thread.
> +@end defvar
> +
>  @end table
> 
>  @node Threads In Python

LGTM, but please give Eli time to comment.

SImon
  
Eli Zaretskii Sept. 11, 2017, 2:28 p.m. UTC | #2
> Date: Mon, 11 Sep 2017 13:54:33 +0200
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
> 
> LGTM, but please give Eli time to comment.

I'm okay with this version, thanks.
  

Patch

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 32d7939..39def2a 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -2989,6 +2989,39 @@  invalid state; that is, the @code{is_valid} method will return
 This event carries no payload.  It is emitted each time @value{GDBN}
 presents a prompt to the user.
 
+@item events.new_inferior
+This is emitted when a new inferior is created.  Note that the
+inferior is not necessarily running; in fact, it may not even have an
+associated executable.
+
+The event is of type @code{gdb.NewInferiorEvent}.  This has a single
+attribute:
+
+@defvar NewInferiorEvent.inferior
+The new inferior, a @code{gdb.Inferior} object.
+@end defvar
+
+@item events.inferior_deleted
+This is emitted when an inferior has been deleted.  Note that this is
+not the same as process exit; it is notified when the inferior itself
+is removed, say via @code{remove-inferiors}.
+
+The event is of type @code{gdb.InferiorDeletedEvent}.  This has a single
+attribute:
+
+@defvar NewInferiorEvent.inferior
+The inferior that is being removed, a @code{gdb.Inferior} object.
+@end defvar
+
+@item events.new_thread
+This is emitted when @value{GDBN} notices a new thread.  The event is of
+type @code{gdb.NewThreadEvent}, which extends @code{gdb.ThreadEvent}.
+This has a single attribute:
+
+@defvar NewThreadEvent.inferior_thread
+The new thread.
+@end defvar
+
 @end table
 
 @node Threads In Python