aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-09-25 08:27:51 -0600
committerTom Tromey <tromey@adacore.com>2024-11-01 11:06:47 -0600
commit76367d23146136b457b1494285b807437a9fec60 (patch)
tree29cec25266e8d522ba7a135659699542885af03d /gdb/tui/tui.c
parent893e4fd6231922495175b701a6c44b665e91cd7e (diff)
downloadgdb-76367d23146136b457b1494285b807437a9fec60.zip
gdb-76367d23146136b457b1494285b807437a9fec60.tar.gz
gdb-76367d23146136b457b1494285b807437a9fec60.tar.bz2
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 <eliz@gnu.org> Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/tui/tui.c')
-rw-r--r--gdb/tui/tui.c5
1 files changed, 5 insertions, 0 deletions
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 <fcntl.h>
@@ -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. */