From 76367d23146136b457b1494285b807437a9fec60 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 25 Sep 2024 08:27:51 -0600 Subject: Add gdb.events.tui_enabled This adds a new event source so that Python scripts can track whether or not the TUI is presently enabled. v2 of the patch renames "status" -> "enabled". Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32162 Reviewed-By: Eli Zaretskii Reviewed-by: Keith Seitz --- gdb/tui/tui.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/tui') diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index bc96cd8..59aa1bc 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -40,6 +40,7 @@ #include "terminal.h" #include "top.h" #include "ui.h" +#include "observable.h" #include @@ -509,6 +510,8 @@ tui_enable (void) /* Update gdb's knowledge of its terminal. */ gdb_save_tty_state (); tui_update_gdb_sizes (); + + gdb::observers::tui_enabled.notify (true); } /* Leave the tui mode. @@ -547,6 +550,8 @@ tui_disable (void) tui_active = false; tui_update_gdb_sizes (); + + gdb::observers::tui_enabled.notify (false); } /* Command wrapper for enabling tui mode. */ -- cgit v1.1