* elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
[deliverable/binutils-gdb.git] / gdb / serial.c
index 3442a4bd79fca587d649f23e68e95cc5056f5950..ada5631dce939fc0bb2e5f2c40215716afc68660 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic serial interface routines
 
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -58,9 +58,6 @@ static const char logbase_ascii[] = "ascii";
 static const char *logbase_enums[] =
 {logbase_hex, logbase_octal, logbase_ascii, NULL};
 static const char *serial_logbase = logbase_ascii;
-
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 \f
 
 static int serial_current_type = 0;
@@ -185,9 +182,7 @@ serial_open (const char *name)
        return scb;
       }
 
-  if (strcmp (name, "ocd") == 0)
-    ops = serial_interface_lookup ("ocd");
-  else if (strcmp (name, "pc") == 0)
+  if (strcmp (name, "pc") == 0)
     ops = serial_interface_lookup ("pc");
   else if (strchr (name, ':'))
     ops = serial_interface_lookup ("tcp");
@@ -651,6 +646,25 @@ connect_command (char *args, int fromtty)
 }
 #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)
 {
@@ -660,6 +674,18 @@ _initialize_serial (void)
 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,
                  var_filename, (char *) &serial_logfile,
This page took 0.024288 seconds and 4 git commands to generate.