This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Add ``set/show serial ...'' framework.
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch] Add ``set/show serial ...'' framework.
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 26 Sep 2001 19:28:53 -0400
Hello,
The attached adds a framework for ``set/show serial ...'' family of
commands. It doesn't add any useful commands. They will quickly follow
though.
Tis committed.
Andrew
2001-09-26 Andrew Cagney <ac131313@redhat.com>
* serial.c (serial_set_cmdlist, serial_show_cmdlist): New
variables.
(serial_set_cmd, serial_show_cmd): New functions.
(_initialize_serial): Add "set/show serial" command.
Index: serial.c
===================================================================
RCS file: /cvs/src/src/gdb/serial.c,v
retrieving revision 1.12
diff -p -r1.12 serial.c
*** serial.c 2001/07/15 20:34:14 1.12
--- serial.c 2001/09/26 23:24:44
*************** connect_command (char *args, int fromtty
*** 651,656 ****
--- 651,675 ----
}
#endif /* 0 */
+ /* Serial set/show framework. */
+
+ static struct cmd_list_element *serial_set_cmdlist;
+ static struct cmd_list_element *serial_show_cmdlist;
+
+ static void
+ serial_set_cmd (char *args, int from_tty)
+ {
+ printf_unfiltered ("\"set serial\" must be followed by the name of a command.\n");
+ help_list (serial_set_cmdlist, "set serial ", -1, gdb_stdout);
+ }
+
+ static void
+ serial_show_cmd (char *args, int from_tty)
+ {
+ cmd_show_list (serial_show_cmdlist, from_tty, "");
+ }
+
+
void
_initialize_serial (void)
{
*************** _initialize_serial (void)
*** 659,664 ****
--- 678,695 ----
"Connect the terminal directly up to the command monitor.\n\
Use <CR>~. or <CR>~^D to break out.");
#endif /* 0 */
+
+ add_prefix_cmd ("serial", class_maintenance, serial_set_cmd, "\
+ Set default serial/parallel port configuration.",
+ &serial_set_cmdlist, "set serial ",
+ 0/*allow-unknown*/,
+ &setlist);
+
+ add_prefix_cmd ("serial", class_maintenance, serial_show_cmd, "\
+ Show default serial/parallel port configuration.",
+ &serial_show_cmdlist, "show serial ",
+ 0/*allow-unknown*/,
+ &showlist);
add_show_from_set
(add_set_cmd ("remotelogfile", no_class,