aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-04-28 08:54:17 -0600
committerTom Tromey <tromey@adacore.com>2020-04-28 08:54:17 -0600
commit2b2fbab8eff221506975a7c8d00ea92d47de915e (patch)
treeee6b1dae3368d5eb330f5e80507ccb7e08b0cc15 /gdb/python
parenta65189c980ccd5370bc2d020220f66d1dd327190 (diff)
downloadfsf-binutils-gdb-2b2fbab8eff221506975a7c8d00ea92d47de915e.zip
fsf-binutils-gdb-2b2fbab8eff221506975a7c8d00ea92d47de915e.tar.gz
fsf-binutils-gdb-2b2fbab8eff221506975a7c8d00ea92d47de915e.tar.bz2
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.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-cmd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index b822c14..3c1c566 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)