Replace free() with xfree().
[deliverable/binutils-gdb.git] / gdb / serial.c
index 7fde64eeaca6d4446d3ae4688e257cf6b9b84ac8..01c15c6da892e5f910c86fd923604f1fa08e6022 100644 (file)
@@ -50,12 +50,12 @@ static struct ui_file *serial_logfp = NULL;
 
 static struct serial_ops *serial_interface_lookup (char *);
 static void serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout);
-static char logbase_hex[] = "hex";
-static char logbase_octal[] = "octal";
-static char logbase_ascii[] = "ascii";
-static char *logbase_enums[] =
+static const char logbase_hex[] = "hex";
+static const char logbase_octal[] = "octal";
+static const char logbase_ascii[] = "ascii";
+static const char *logbase_enums[] =
 {logbase_hex, logbase_octal, logbase_ascii, NULL};
-static char *serial_logbase = logbase_ascii;
+static const char *serial_logbase = logbase_ascii;
 \f
 
 
@@ -209,7 +209,7 @@ serial_open (const char *name)
 
   if (scb->ops->open (scb, open_name))
     {
-      free (scb);
+      xfree (scb);
       return NULL;
     }
 
@@ -310,7 +310,7 @@ do_serial_close (serial_t scb, int really_close)
     scb->ops->close (scb);
 
   if (scb->name)
-    free (scb->name);
+    xfree (scb->name);
 
   if (scb_base == scb)
     scb_base = scb_base->next;
@@ -324,7 +324,7 @@ do_serial_close (serial_t scb, int really_close)
        break;
       }
 
-  free (scb);
+  xfree (scb);
 }
 
 void
@@ -397,7 +397,7 @@ serial_printf (serial_t desc, const char *format,...)
   vasprintf (&buf, format, args);
   SERIAL_WRITE (desc, buf, strlen (buf));
 
-  free (buf);
+  xfree (buf);
   va_end (args);
 }
 
@@ -551,7 +551,7 @@ cleanup_tty (serial_ttystate ttystate)
 {
   printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
   SERIAL_SET_TTY_STATE (tty_desc, ttystate);
-  free (ttystate);
+  xfree (ttystate);
   SERIAL_CLOSE (tty_desc);
 }
 
@@ -667,16 +667,16 @@ by gdbserver.",
 
   add_show_from_set
     (add_set_enum_cmd ("remotelogbase", no_class,
-                      logbase_enums, (char *) &serial_logbase,
+                      logbase_enums, &serial_logbase,
                       "Set numerical base for remote session logging",
                       &setlist),
      &showlist);
 
-  add_show_from_set (add_set_cmd ("serialdebug",
+  add_show_from_set (add_set_cmd ("serial",
                                  class_maintenance,
                                  var_zinteger,
                                  (char *)&global_serial_debug_p,
                                  "Set serial debugging.\n\
-When non-zero, serial port debugging is enabled.", &setlist),
-                    &showlist);
+When non-zero, serial port debugging is enabled.", &setdebuglist),
+                    &showdebuglist);
 }
This page took 0.024047 seconds and 4 git commands to generate.