From 3d0b35641081d0f57d32583093f3297ff39b7379 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 14 May 2021 15:38:49 -0400 Subject: gdb: add cmd_list_element::is_prefix Same idea as the previous patch, but for prefix instead of alias. gdb/ChangeLog: * cli/cli-decode.h (cmd_list_element) : New, use it. Change-Id: I76a9d2e82fc8d7429904424674d99ce6f9880e2b --- gdb/python/py-cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index c2c0df5..4f01fc0 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -111,7 +111,7 @@ cmdpy_function (struct cmd_list_element *command, error (_("Invalid invocation of Python command object.")); if (! PyObject_HasAttr ((PyObject *) obj, invoke_cst)) { - if (obj->command->subcommands != nullptr) + if (obj->command->is_prefix ()) { /* A prefix command does not need an invoke method. */ return; @@ -393,7 +393,7 @@ gdbpy_parse_command_name (const char *name, return NULL; } - if (elt->subcommands) + if (elt->is_prefix ()) { *base_list = elt->subcommands; return result; -- cgit v1.1