diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-14 15:38:49 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-17 14:01:26 -0400 |
commit | 3d0b35641081d0f57d32583093f3297ff39b7379 (patch) | |
tree | fc6be36e7ce048ed74ce4597e0d365b1be4623d3 /gdb/python | |
parent | 1be99b11f8d1a8fd4049fee1c0eeaef73b3e6d1d (diff) | |
download | binutils-3d0b35641081d0f57d32583093f3297ff39b7379.zip binutils-3d0b35641081d0f57d32583093f3297ff39b7379.tar.gz binutils-3d0b35641081d0f57d32583093f3297ff39b7379.tar.bz2 |
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) <is_prefix>: New, use it.
Change-Id: I76a9d2e82fc8d7429904424674d99ce6f9880e2b
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |