From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12149 invoked by alias); 22 Jun 2003 21:33:47 -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 2577 invoked from network); 22 Jun 2003 21:28:45 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 22 Jun 2003 21:28:45 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CA31A2B5F; Sun, 22 Jun 2003 17:28:10 -0400 (EDT) Message-ID: <3EF61F6A.4050007@redhat.com> Date: Sun, 22 Jun 2003 21:33:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: "set logging" References: <20030622205322.GA14138@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00715.txt.bz2 > set logging on [FILE] > set logging off > set logging overwrite [I changed the default to append] This is boolean? As in add_setshow_boolean_cmd? BTW, the usage has "append". > set logging redirect same? > set logging file you mean: set logging file FILE > show logging Yea. For the code. > + add_cmd ("logging", no_class, set_logging_command, > + "Set logging options", &setlist); > + add_cmd ("logging", no_class, show_logging_command, > + "Show logging options", &showlist); See remote.c's 'set remote' for how to implement multi-level tab completion commands. > +static struct ui_file *saved_stdout; > +static struct ui_file *saved_stderr; > +static struct ui_file *saved_stdlog; > +static struct ui_file *saved_stdtarg; Suggest grouping these into a struct. My things to do one day is to also group the globals into a structure. > +static void > +set_logging_help () > +{ > + printf_unfiltered ("Usage: set logging on [FILENAME]\n"); > + printf_unfiltered (" set logging off\n"); > + printf_unfiltered (" set logging FILENAME\n"); this one is wrong > + printf_unfiltered (" set logging overwrite [on|off]\n"); > + printf_unfiltered (" set logging append [on|off]\n"); > +} I did't realise GDB had `Usage:' style messages so went looking. It has a few. It should include a brief overview of what the command is doing. > The above set commands, and also: > log file CMD > "log" will obey "set logging append" and "set logging redirect". yes both: log CMD and redirect CMD are both plausable. I think the CLI part deserves a new cli/cli-logging.[ch] file. Think about it for 6 later this week :-) Andrew