This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Add ``set/show serial ...'' framework.


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,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]