[PATCH] Add gdb.events.tui_status

Keith Seitz keiths@redhat.com
Mon Oct 7 18:33:58 GMT 2024


On 9/27/24 12:47 PM, Tom Tromey wrote:
> This adds a new event source so that Python scripts can track whether
> or not the TUI is presently enabled.

Hi,

This patch LGTM, but I have just have one tiny comment, which I am
hesitant to mention, BUT...

> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
> index 22f0e6c6d0a..507c2c8a332 100644
> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -4081,6 +4081,16 @@ The @code{gdb.Progspace} that is about to be removed from
>   @value{GDBN}.
>   @end defvar
>   
> +@item events.tui_status
> +This is emitted when the TUI is enabled or disabled.  The event is of
> +type @code{gdb.TuiStatusEvent}, which has a single read-only
> +attribute:
> +
> +@defvar TuiStatusEvent.status
> +If the TUI has just been enabled, this is @code{True}; otherwise it is
> +@code{False}.
> +@end defvar
> +
>   @end table
>   
>   @node Threads In Python

"tui_status" seems as if it could be trivially more explicit. Unless we
plan to add more statuses in the future, wouldn't "tui_enabled" or
"tui_enabled_status" (and similar changes throughout) be more explicit
without being overly verbose?

In any case, that's almost too nitpicky (even for me), so I leave that
to your discretion. The feature is, after all, well-documented.

Reviewed-by: Keith Seitz <keiths@redhat.com>

Keith



More information about the Gdb-patches mailing list