aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-07-10 17:22:35 +0000
committerFred Fish <fnf@specifix.com>1992-07-10 17:22:35 +0000
commit311592ff5030d6442968059e46a8d2ffc1e9ff05 (patch)
tree08f7c9151b566dce279d8cbb2b8b358465dd137a /gdb/command.c
parent5c5b5d4b0e4dd49699a6a88dd58f5816f6c14386 (diff)
downloadgdb-311592ff5030d6442968059e46a8d2ffc1e9ff05.zip
gdb-311592ff5030d6442968059e46a8d2ffc1e9ff05.tar.gz
gdb-311592ff5030d6442968059e46a8d2ffc1e9ff05.tar.bz2
* command.c (lookup_cmd_1): Clarify descriptive comments.
* gdbcmd.h (maintenanceprintlist): Add declaration. * main.c (maintenanceprintlist): Add definition. * main.c (gdb_completer_command_word_break_characters): Add. * main.c (symbol_completion_function): Switch completer word break character sets dynamically, based on whether completion is being done on commands or on something else. * main.c (initialize_cmd_lists): Init maintenanceprintlist. * maint.c: Include demangle.h. * maint.c (maintenance_demangle): New function. * maint.c (maintenance_print_command): New function. * maint.c (_initialize_maint_cmds): Reorganize some commands under new maintenance print subcommand.
Diffstat (limited to 'gdb/command.c')
-rw-r--r--gdb/command.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/gdb/command.c b/gdb/command.c
index 7640210..5327a4c 100644
--- a/gdb/command.c
+++ b/gdb/command.c
@@ -471,36 +471,35 @@ help_cmd_list (list, class, prefix, recurse, stream)
}
}
-/* This routine takes a line of TEXT and a CLIST in which to
- start the lookup. When it returns it will have incremented the text
- pointer past the section of text it matched, set *RESULT_LIST to
- the list in which the last word was matched, and will return the
- cmd list element which the text matches. It will return 0 if no
- match at all was possible. It will return -1 if ambigous matches are
- possible; in this case *RESULT_LIST will be set to the list in which
- there are ambiguous choices (and text will be set to the ambiguous
- text string).
+/* This routine takes a line of TEXT and a CLIST in which to start the
+ lookup. When it returns it will have incremented the text pointer past
+ the section of text it matched, set *RESULT_LIST to point to the list in
+ which the last word was matched, and will return a pointer to the cmd
+ list element which the text matches. It will return NULL if no match at
+ all was possible. It will return -1 (cast appropriately, ick) if ambigous
+ matches are possible; in this case *RESULT_LIST will be set to point to
+ the list in which there are ambiguous choices (and *TEXT will be set to
+ the ambiguous text string).
It does no error reporting whatsoever; control will always return
to the superior routine.
- In the case of an ambiguous return (-1), *RESULT_LIST will be set to
- point at the prefix_command (ie. the best match) *or* (special
- case) will be 0 if no prefix command was ever found. For example,
- in the case of "info a", "info" matches without ambiguity, but "a"
- could be "args" or "address", so *RESULT_LIST is set to
- the cmd_list_element for "info". So in this case
- result list should not be interpeted as a pointer to the beginning
- of a list; it simply points to a specific command.
+ In the case of an ambiguous return (-1), *RESULT_LIST will be set to point
+ at the prefix_command (ie. the best match) *or* (special case) will be NULL
+ if no prefix command was ever found. For example, in the case of "info a",
+ "info" matches without ambiguity, but "a" could be "args" or "address", so
+ *RESULT_LIST is set to the cmd_list_element for "info". So in this case
+ RESULT_LIST should not be interpeted as a pointer to the beginning of a
+ list; it simply points to a specific command.
If RESULT_LIST is NULL, don't set *RESULT_LIST (but don't otherwise
affect the operation).
This routine does *not* modify the text pointed to by TEXT.
- If IGNORE_HELP_CLASSES is nonzero, ignore any command list
- elements which are actually help classes rather than commands (i.e.
- the function field of the struct cmd_list_element is 0). */
+ If IGNORE_HELP_CLASSES is nonzero, ignore any command list elements which
+ are actually help classes rather than commands (i.e. the function field of
+ the struct cmd_list_element is NULL). */
struct cmd_list_element *
lookup_cmd_1 (text, clist, result_list, ignore_help_classes)