Revert 'Remove unused struct serial::name field'
authorPedro Alves <palves@redhat.com>
Fri, 10 Jan 2020 20:06:11 +0000 (20:06 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 10 Jan 2020 20:06:11 +0000 (20:06 +0000)
This commit reverts:

 commit 5f5219fc34f7557296272230123a3837960a6f09
 Author:     Pedro Alves <palves@redhat.com>
 AuthorDate: Tue Apr 12 16:49:30 2016 +0100

     Remove unused struct serial::name field

The following patches will add uses for the field.

gdb/ChangeLog:
2020-01-10  Pedro Alves  <palves@redhat.com>

Revert:
2016-04-12  Pedro Alves  <palves@redhat.com>
* serial.c (serial_open, serial_fdopen_ops, do_serial_close):
Remove references to name.
* serial.h (struct serial) <name>: Delete.

gdb/ChangeLog
gdb/serial.c
gdb/serial.h

index d6769667dceb29834e3398395403d1b63bf16612..7d15993f92e6f6ce060878eae86c1cc67b65b061 100644 (file)
@@ -1,3 +1,11 @@
+2020-01-10  Pedro Alves  <palves@redhat.com>
+
+       Revert:
+       2016-04-12  Pedro Alves  <palves@redhat.com>
+       * serial.c (serial_open, serial_fdopen_ops, do_serial_close):
+       Remove references to name.
+       * serial.h (struct serial) <name>: Delete.
+
 2020-01-10  Pedro Alves  <palves@redhat.com>
 
        * gdbarch-selftests.c (register_to_value_test): Remove "target
index 804ef1826764b2344c5e8b58809090331d90abaa..a1c3b91c7c2fb89c7ee8765a0d77c316875e5408 100644 (file)
@@ -247,6 +247,7 @@ serial_open_ops_1 (const struct serial_ops *ops, const char *open_name)
       return NULL;
     }
 
+  scb->name = open_name != NULL ? xstrdup (open_name) : NULL;
   scb->next = scb_base;
   scb_base = scb;
 
@@ -291,6 +292,7 @@ serial_fdopen_ops (const int fd, const struct serial_ops *ops)
 
   scb = new_serial (ops);
 
+  scb->name = NULL;
   scb->next = scb_base;
   scb_base = scb;
 
@@ -330,6 +332,8 @@ do_serial_close (struct serial *scb, int really_close)
   if (really_close)
     scb->ops->close (scb);
 
+  xfree (scb->name);
+
   /* For serial_is_open.  */
   scb->bufp = NULL;
 
index 446b896345ff06ea7df1d24e529aae652212f7c2..8d67c4bf537a94e46d0dc2267baf0682d1980add 100644 (file)
@@ -240,6 +240,7 @@ struct serial
                                   buffer.  -ve for sticky errors.  */
     unsigned char *bufp;       /* Current byte */
     unsigned char buf[BUFSIZ]; /* Da buffer itself */
+    char *name;                        /* The name of the device or host */
     struct serial *next;       /* Pointer to the next `struct serial *' */
     int debug_p;               /* Trace this serial devices operation.  */
     int async_state;           /* Async internal state.  */
This page took 0.025316 seconds and 4 git commands to generate.