diff options
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-decode.c | 17 | ||||
-rw-r--r-- | gdb/cli/cli-decode.h | 16 |
2 files changed, 19 insertions, 14 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 32edb52..a3b153f 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -160,6 +160,23 @@ set_cmd_completer_handle_brkchars (struct cmd_list_element *cmd, cmd->completer_handle_brkchars = func; } +std::string +cmd_list_element::prefixname () const +{ + if (this->prefixlist == nullptr) + /* Not a prefix command. */ + return ""; + + std::string prefixname; + if (this->prefix != nullptr) + prefixname = this->prefix->prefixname (); + + prefixname += this->name; + prefixname += " "; + + return prefixname; +} + /* Add element named NAME. Space for NAME and DOC must be allocated by the caller. CLASS is the top level category into which commands are broken down diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index da6013a..e6d6f32 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -76,20 +76,8 @@ struct cmd_list_element space. It is used before the word "command" in describing the commands reached through this prefix. - For non-prefix commands, an empty string is returned. */ - std::string prefixname () - { - if (prefixlist == nullptr) - /* Not a prefix command. */ - return ""; - - std::string prefixname; - if (prefix != nullptr) - prefixname = prefix->prefixname (); - prefixname += name; - prefixname += " "; - return prefixname; - } + For non-prefix commands, return an empty string. */ + std::string prefixname () const; /* Points to next command in this list. */ struct cmd_list_element *next = nullptr; |