diff options
author | Michael Snyder <msnyder@specifix.com> | 2011-03-12 22:59:23 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@specifix.com> | 2011-03-12 22:59:23 +0000 |
commit | 7938ea98e7dfc9f097ddca2a00995bb63b9d3c0a (patch) | |
tree | b3e7aedd71d6903f4960dc66d6e2b05ed583706e /gdb/cli | |
parent | d95e9d653e9cb1b8f28a51d2c013ed1e51e6b6cd (diff) | |
download | gdb-7938ea98e7dfc9f097ddca2a00995bb63b9d3c0a.tar.gz |
2011-03-11 Michael Snyder <msnyder@vmware.com>
* cli/cli-decode.h (CMD_LIST_AMBIGUOUS): Define.
* cli/cli-decode.c (lookup_cmd_1): Use CMD_LIST_AMBIGUOUS.
(lookup_cmd): Test for CMD_LIST_AMBIGUOUS.
* completer.c (complete_line_internal): Use CMD_LIST_AMBIGUOUS.
* top.c (set_verbose): Use CMD_LIST_AMBIGUOUS.
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-decode.c | 8 | ||||
-rw-r--r-- | gdb/cli/cli-decode.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 4c1b4121587..093fec03558 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1228,7 +1228,7 @@ lookup_cmd_1 (char **text, struct cmd_list_element *clist, /* Will be modified in calling routine if we know what the prefix command is. */ *result_list = 0; - return (struct cmd_list_element *) -1; /* Ambiguous. */ + return CMD_LIST_AMBIGUOUS; /* Ambiguous. */ } /* We've matched something on this list. Move text pointer forward. */ @@ -1261,7 +1261,7 @@ lookup_cmd_1 (char **text, struct cmd_list_element *clist, *result_list = clist; return found; } - else if (c == (struct cmd_list_element *) -1) + else if (c == CMD_LIST_AMBIGUOUS) { /* We've gotten this far properly, but the next step is ambiguous. We need to set the result list to the best @@ -1346,7 +1346,7 @@ lookup_cmd (char **line, struct cmd_list_element *list, char *cmdtype, else return 0; } - else if (c == (struct cmd_list_element *) -1) + else if (c == CMD_LIST_AMBIGUOUS) { /* Ambigous. Local values should be off prefixlist or called values. */ @@ -1569,7 +1569,7 @@ lookup_cmd_composition (char *text, *cmd = find_cmd (command, len, cur_list, 1, &nfound); } - if (*cmd == (struct cmd_list_element *) -1) + if (*cmd == CMD_LIST_AMBIGUOUS) { return 0; /* ambiguous */ } diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index 095b33dede1..e9749681cbe 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -210,6 +210,9 @@ struct cmd_list_element struct cmd_list_element *alias_chain; }; +/* Flag for an ambiguous cmd_list result. */ +#define CMD_LIST_AMBIGUOUS ((struct cmd_list_element *) -1) + /* API to the manipulation of command lists. */ extern struct cmd_list_element *add_cmd (char *, enum command_class, |