From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17698 invoked by alias); 9 Jan 2002 18:28:17 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17639 invoked from network); 9 Jan 2002 18:28:13 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 9 Jan 2002 18:28:13 -0000 Received: from redhat.com (reddwarf.cygnus.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA01756; Wed, 9 Jan 2002 10:28:03 -0800 (PST) Message-ID: <3C3C8A83.935060A4@redhat.com> Date: Wed, 09 Jan 2002 10:28:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Fernando Nasser CC: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [RFA] "Help" command and completion References: <3C3C5F45.BFCF545D@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00182.txt.bz2 Fernando Nasser wrote: > > Sorry folks, I just came back from vacations and I still have to catch > up with all the e-mail. I saw this one by chance while searching for > another thing... > > Yes, I agree 100% with you both. > > I suggest that to proper document how we got here, Michael should check > his patch first and then Eli checks his in. Nah, my name's in the changelog enough already. Let's just let Eli check in his superior change. > > Regards to all and Happy New Year. > > Fernando > > Eli Zaretskii wrote: > > > > On Tue, 8 Jan 2002, Michael Snyder wrote: > > > > > Michael Snyder wrote: > > > > > > > > Eli Zaretskii wrote: > > > > > > > > > > How is no completion better than completion on symbols? > > > > > > > > Because the symbols in the program being debugged > > > > can't possibly have anything to do with gdb commands, > > > > and therefore can't possibly be valid arguments for "help". > > > > Not even if you're debugging gdb. > > > > > > OK to commit? > > > > Personally, I'd rather have it complete on commands, like you said it > > should. We already have the function to do that: complete_on_cmdlist, > > so it shouldn't be too hard to make that happen. > > > > In fact, I just took a quick attempt on that; the patch is below. It > > seems to work for me. (The diffs are against stock GDB 5.1, since > > that's what I happen to have on the machine I have here.) > > > > In any case, IIRC completion is Fernando's land, so I guess we need to > > wait for his word. > > > > 2002-01-09 Eli Zaretskii > > > > * completer.c (command_completer): New function. > > > > * completer.h : Add prototype. > > > > * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the > > completer for the "help" command. > > > > --- gdb/completer.c~0 Sun Jul 15 21:17:46 2001 > > +++ gdb/completer.c Wed Jan 9 09:05:48 2002 > > @@ -339,6 +339,14 @@ location_completer (char *text, char *wo > > return list; > > } > > > > +/* Complete on command names. Used by "help". */ > > +char ** > > +command_completer (char *text, char *word) > > +{ > > + return complete_on_cmdlist (cmdlist, text, word); > > +} > > + > > + > > /* Here are some useful test cases for completion. FIXME: These should > > be put in the test suite. They should be tested with both M-? and TAB. > > > > --- gdb/completer.h~0 Sun Jul 15 21:17:46 2001 > > +++ gdb/completer.h Wed Jan 9 08:52:50 2002 > > @@ -29,6 +29,8 @@ > > > > extern char **location_completer (char *, char *); > > > > +extern char **command_completer (char *, char *); > > + > > extern char *get_gdb_completer_word_break_characters (void); > > > > extern char *get_gdb_completer_quote_characters (void); > > --- gdb/cli/cli-cmds.c~0 Mon Jul 16 16:33:46 2001 > > +++ gdb/cli/cli-cmds.c Wed Jan 9 08:58:40 2002 > > @@ -668,7 +668,8 @@ when gdb is started.", &cmdlist); > > c->completer = filename_completer; > > > > add_com ("quit", class_support, quit_command, "Exit gdb."); > > - add_com ("help", class_support, help_command, "Print list of commands."); > > + c = add_com ("help", class_support, help_command, "Print list of commands."); > > + c->completer = command_completer; > > add_com_alias ("q", "quit", class_support, 1); > > add_com_alias ("h", "help", class_support, 1); > > > > -- > Fernando Nasser > Red Hat Canada Ltd. E-Mail: fnasser@redhat.com > 2323 Yonge Street, Suite #300 > Toronto, Ontario M4P 2C9