From 81066208879cefefce3b900b852483a77ed23c2a Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Tue, 10 Sep 1991 08:56:09 +0000 Subject: * 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. --- gdb/command.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gdb/command.c') 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; -- cgit v1.1