This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: "set logging"
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 22 Jun 2003 17:28:10 -0400
- Subject: Re: RFC: "set logging"
- References: <20030622205322.GA14138@nevyn.them.org>
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