diff options
author | John Gilmore <gnu@cygnus> | 1991-09-10 08:56:09 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-09-10 08:56:09 +0000 |
commit | 81066208879cefefce3b900b852483a77ed23c2a (patch) | |
tree | 1297f375636d5d218cff99ebbef36f86d6470870 /gdb/command.c | |
parent | ae07c044c3bf2e107226e9b719d9595a92e7af3e (diff) | |
download | gdb-81066208879cefefce3b900b852483a77ed23c2a.zip gdb-81066208879cefefce3b900b852483a77ed23c2a.tar.gz gdb-81066208879cefefce3b900b852483a77ed23c2a.tar.bz2 |
* utils.c (error): if error_pre_print is set, print the string
first.
* main.c (main, print_gnu_advertisement, print_gdb_version):
Reformat legalese so it always prints, but acts as an "I'm here"
message while symbols are being read. If any errors occur,
print a few newlines to set off the message and start it at the
left margin. Remove mention of "help" command, and don't yak about
symbol reading.
(catch_errors): Error string is now printed first in case of
error, not last.
* command.c (undef_cmd_error, lookup_cmd): On undefined command,
suggest the "help" command.
* Makefile.in (VERSION): Set to 4.0.2.
Diffstat (limited to 'gdb/command.c')
-rw-r--r-- | gdb/command.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/command.c b/gdb/command.c index 15d4297..3c05e6c 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -585,6 +585,20 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes) } } +/* All this hair to move the space to the front of cmdtype */ + +void +undef_cmd_error (cmdtype, q) + char *cmdtype, *q; +{ + error ("Undefined %scommand: \"%s\". Try \"help%s%.*s\".", + cmdtype, + q, + *cmdtype? " ": "", + strlen(cmdtype)-1, + cmdtype); +} + /* Look up the contents of *LINE as a command in the command list LIST. LIST is a chain of struct cmd_list_element's. If it is found, return the struct cmd_list_element for that command @@ -633,8 +647,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes) q = (char *) alloca (p - *line + 1); strncpy (q, *line, p - *line); q[p-*line] = '\0'; - - error ("Undefined %scommand: \"%s\".", cmdtype, q); + undef_cmd_error (cmdtype, q); } } else @@ -698,7 +711,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes) (*line)++; if (c->prefixlist && **line && !c->allow_unknown) - error ("Undefined %scommand: \"%s\".", c->prefixname, *line); + undef_cmd_error (c->prefixname, *line); /* Seems to be what he wants. Return it. */ return c; |