public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Reorganize Python events documentation Date: Thu, 14 Apr 2022 15:52:59 +0000 (GMT) [thread overview] Message-ID: <20220414155259.E97BF3856DEE@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=77d97a0a19033a45fc7e691078c90718f9f5d5e5 commit 77d97a0a19033a45fc7e691078c90718f9f5d5e5 Author: Tom Tromey <tromey@adacore.com> Date: Fri Feb 25 11:33:32 2022 -0700 Reorganize Python events documentation This slightly reorganizes the Python events documentation. It hoists the "ThreadEvent" text out of the list of events, where it seemed to be misplaced. It tidies the formatting a little bit (adding some vertical space for easier reading in info), fixes a typo, adds some missing commas, and fixes an incorrect reference to NewInferiorEvent. Diff: --- gdb/doc/python.texi | 62 ++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 7c414b01d70..cb5283e03c0 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -3367,56 +3367,58 @@ of type @code{gdb.ExitedEvent}. As you can see in the example the @code{ExitedEvent} object has an attribute which indicates the exit code of the inferior. -The following is a listing of the event registries that are available and -details of the events they emit: - -@table @code - -@item events.cont -Emits @code{gdb.ThreadEvent}. - -Some events can be thread specific when @value{GDBN} is running in non-stop -mode. When represented in Python, these events all extend -@code{gdb.ThreadEvent}. Note, this event is not emitted directly; instead, -events which are emitted by this or other modules might extend this event. -Examples of these events are @code{gdb.BreakpointEvent} and -@code{gdb.ContinueEvent}. +Some events can be thread specific when @value{GDBN} is running in +non-stop mode. When represented in Python, these events all extend +@code{gdb.ThreadEvent}. This event is a base class and is never +emitted directly; instead, events which are emitted by this or other +modules might extend this event. Examples of these events are +@code{gdb.BreakpointEvent} and @code{gdb.ContinueEvent}. +@code{gdb.ThreadEvent} holds the following attributes: @defvar ThreadEvent.inferior_thread In non-stop mode this attribute will be set to the specific thread which was involved in the emitted event. Otherwise, it will be set to @code{None}. @end defvar -Emits @code{gdb.ContinueEvent} which extends @code{gdb.ThreadEvent}. +The following is a listing of the event registries that are available and +details of the events they emit: -This event indicates that the inferior has been continued after a stop. For -inherited attribute refer to @code{gdb.ThreadEvent} above. +@table @code + +@item events.cont +Emits @code{gdb.ContinueEvent}, which extends @code{gdb.ThreadEvent}. +This event indicates that the inferior has been continued after a +stop. For inherited attribute refer to @code{gdb.ThreadEvent} above. @item events.exited -Emits @code{events.ExitedEvent} which indicates that the inferior has exited. -@code{events.ExitedEvent} has two attributes: +Emits @code{events.ExitedEvent}, which indicates that the inferior has +exited. @code{events.ExitedEvent} has two attributes: + @defvar ExitedEvent.exit_code An integer representing the exit code, if available, which the inferior has returned. (The exit code could be unavailable if, for example, @value{GDBN} detaches from the inferior.) If the exit code is unavailable, the attribute does not exist. @end defvar + @defvar ExitedEvent.inferior A reference to the inferior which triggered the @code{exited} event. @end defvar @item events.stop -Emits @code{gdb.StopEvent} which extends @code{gdb.ThreadEvent}. +Emits @code{gdb.StopEvent}, which extends @code{gdb.ThreadEvent}. -Indicates that the inferior has stopped. All events emitted by this registry -extend StopEvent. As a child of @code{gdb.ThreadEvent}, @code{gdb.StopEvent} -will indicate the stopped thread when @value{GDBN} is running in non-stop -mode. Refer to @code{gdb.ThreadEvent} above for more details. +Indicates that the inferior has stopped. All events emitted by this +registry extend @code{gdb.StopEvent}. As a child of +@code{gdb.ThreadEvent}, @code{gdb.StopEvent} will indicate the stopped +thread when @value{GDBN} is running in non-stop mode. Refer to +@code{gdb.ThreadEvent} above for more details. -Emits @code{gdb.SignalEvent} which extends @code{gdb.StopEvent}. +Emits @code{gdb.SignalEvent}, which extends @code{gdb.StopEvent}. -This event indicates that the inferior or one of its threads has received as -signal. @code{gdb.SignalEvent} has the following attributes: +This event indicates that the inferior or one of its threads has +received a signal. @code{gdb.SignalEvent} has the following +attributes: @defvar SignalEvent.stop_signal A string representing the signal received by the inferior. A list of possible @@ -3424,7 +3426,8 @@ signal values can be obtained by running the command @code{info signals} in the @value{GDBN} command prompt. @end defvar -Also emits @code{gdb.BreakpointEvent} which extends @code{gdb.StopEvent}. +Also emits @code{gdb.BreakpointEvent}, which extends +@code{gdb.StopEvent}. @code{gdb.BreakpointEvent} event indicates that one or more breakpoints have been hit, and has the following attributes: @@ -3434,6 +3437,7 @@ A sequence containing references to all the breakpoints (type @code{gdb.Breakpoint}) that were hit. @xref{Breakpoints In Python}, for details of the @code{gdb.Breakpoint} object. @end defvar + @defvar BreakpointEvent.breakpoint A reference to the first breakpoint that was hit. This function is maintained for backward compatibility and is now deprecated @@ -3555,7 +3559,7 @@ is removed, say via @code{remove-inferiors}. The event is of type @code{gdb.InferiorDeletedEvent}. This has a single attribute: -@defvar NewInferiorEvent.inferior +@defvar InferiorDeletedEvent.inferior The inferior that is being removed, a @code{gdb.Inferior} object. @end defvar
reply other threads:[~2022-04-14 15:52 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220414155259.E97BF3856DEE@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@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: linkBe 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).