public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Allow Python commands to be in class_tui
@ 2020-05-11 15:36 gdb-buildbot
  2020-05-11 15:36 ` Failures on Fedora-i686, branch master gdb-buildbot
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gdb-buildbot @ 2020-05-11 15:36 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 2b2fbab8eff221506975a7c8d00ea92d47de915e ***

commit 2b2fbab8eff221506975a7c8d00ea92d47de915e
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Tue Apr 28 08:54:17 2020 -0600
Commit:     Tom Tromey <tromey@adacore.com>
CommitDate: Tue Apr 28 08:54:17 2020 -0600

    Allow Python commands to be in class_tui
    
    Now that Python code can create TUI windows, it seemed appropriate to
    allow Python commands to appear in the "TUI" help class.  This patch
    adds this capability.
    
    gdb/ChangeLog
    2020-04-28  Tom Tromey  <tom@tromey.com>
    
            * NEWS: Update.
            * python/py-cmd.c (gdbpy_initialize_commands): Add COMMAND_TUI.
            (cmdpy_init): Allow class_tui.
    
    gdb/doc/ChangeLog
    2020-04-28  Tom Tromey  <tom@tromey.com>
    
            * python.texi (Commands In Python): Document gdb.COMMAND_TUI.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 26ebc7373c..bd2c9b030a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-28  Tom Tromey  <tom@tromey.com>
+
+	* NEWS: Update.
+	* python/py-cmd.c (gdbpy_initialize_commands): Add COMMAND_TUI.
+	(cmdpy_init): Allow class_tui.
+
 2020-04-28 Mark Williams <mark@myosotissp.com>
 
 	PR gdb/24480
diff --git a/gdb/NEWS b/gdb/NEWS
index 01e73c9e5e..5b9eabe746 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -73,6 +73,9 @@ GNU/Linux/RISC-V (gdbserver)	riscv*-*-linux*
      field of a dynamic type may have None for its "bitpos" attribute
      as well.
 
+  ** Commands written in Python can be in the "TUI" help class by
+     registering with the new constant gdb.COMMAND_TUI.
+
 *** Changes in GDB 9
 
 * 'thread-exited' event is now available in the annotations interface.
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 305f2d5b64..6af7bce86b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-28  Tom Tromey  <tom@tromey.com>
+
+	* python.texi (Commands In Python): Document gdb.COMMAND_TUI.
+
 2020-04-27  Tom Tromey  <tromey@adacore.com>
 
 	* python.texi (Types In Python): Mention missing fields.  Add
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 3b1ccb4177..a38f1dab42 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -3829,6 +3829,13 @@ The command has to do with tracepoints.  For example, @code{trace},
 @kbd{help tracepoints} at the @value{GDBN} prompt to see a list of
 commands in this category.
 
+@findex COMMAND_TUI
+@findex gdb.COMMAND_TUI
+@item gdb.COMMAND_TUI
+The command has to do with the text user interface (@pxref{TUI}).
+Type @kbd{help tui} at the @value{GDBN} prompt to see a list of
+commands in this category.
+
 @findex COMMAND_USER
 @findex gdb.COMMAND_USER
 @item gdb.COMMAND_USER
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index b822c14004..3c1c566b0a 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -465,7 +465,8 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
       && cmdtype != class_files && cmdtype != class_support
       && cmdtype != class_info && cmdtype != class_breakpoint
       && cmdtype != class_trace && cmdtype != class_obscure
-      && cmdtype != class_maintenance && cmdtype != class_user)
+      && cmdtype != class_maintenance && cmdtype != class_user
+      && cmdtype != class_tui)
     {
       PyErr_Format (PyExc_RuntimeError, _("Invalid command class argument."));
       return -1;
@@ -593,8 +594,7 @@ gdbpy_initialize_commands (void)
   if (PyType_Ready (&cmdpy_object_type) < 0)
     return -1;
 
-  /* Note: alias and user are special; pseudo appears to be unused,
-     and there is no reason to expose tui, I think.  */
+  /* Note: alias and user are special.  */
   if (PyModule_AddIntConstant (gdb_module, "COMMAND_NONE", no_class) < 0
       || PyModule_AddIntConstant (gdb_module, "COMMAND_RUNNING", class_run) < 0
       || PyModule_AddIntConstant (gdb_module, "COMMAND_DATA", class_vars) < 0
@@ -611,7 +611,8 @@ gdbpy_initialize_commands (void)
 				  class_obscure) < 0
       || PyModule_AddIntConstant (gdb_module, "COMMAND_MAINTENANCE",
 				  class_maintenance) < 0
-      || PyModule_AddIntConstant (gdb_module, "COMMAND_USER", class_user) < 0)
+      || PyModule_AddIntConstant (gdb_module, "COMMAND_USER", class_user) < 0
+      || PyModule_AddIntConstant (gdb_module, "COMMAND_TUI", class_tui) < 0)
     return -1;
 
   for (i = 0; i < N_COMPLETERS; ++i)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-18  2:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 15:36 [binutils-gdb] Allow Python commands to be in class_tui gdb-buildbot
2020-05-11 15:36 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-11 16:00 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-11 16:09 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-11 16:34 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-11 17:17 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-12 20:10 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-14  8:06 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-05-18  2:21 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " gdb-buildbot

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).