public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Setting parity for remote serial
@ 2013-07-10 15:18 Yurij Grechishhev
  2013-07-10 18:10 ` Tom Tromey
  0 siblings, 1 reply; 22+ messages in thread
From: Yurij Grechishhev @ 2013-07-10 15:18 UTC (permalink / raw)
  To: gdb-patches

GDB doesn't support command to set parity for serial ports. So there
is a problem to connect target that use "odd" or "even" parity.
The one way is to set parity before launching gdb (stty for Linux or
MODE for Windows), but for Windows gdb sets parity to "none" during
connection.
I suggest using "set remoteparity <odd | even | none>" command for this.

Example:
(gdb) set remoteparity
even  none  odd
(gdb) set remoteparity even
(gdb) show remoteparity
Parity for remote serial I/O is "even".

I hope this will be useful for somebody.

Do you plan to use "class serial" (set serial ...) for serial settings?
"set serial parity <odd | even | none>" is more convenient way.


diff -up ../../../gdb_old/gdb-7.6/gdb/monitor.c gdb/monitor.c
--- ../../../gdb_old/gdb-7.6/gdb/monitor.c    2013-07-10
21:55:33.656750073 +0400
+++ gdb/monitor.c    2013-07-04 23:54:32.472595952 +0400
@@ -768,6 +768,7 @@ monitor_open (char *args, struct monitor
     }
     }

+  serial_setparity (monitor_desc, serial_parity);
   serial_raw (monitor_desc);

   serial_flush_input (monitor_desc);
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/po and gdb/po
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/python and gdb/python
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/regformats and
gdb/regformats
diff -up ../../../gdb_old/gdb-7.6/gdb/remote.c gdb/remote.c
--- ../../../gdb_old/gdb-7.6/gdb/remote.c    2013-07-10 21:55:34.645747970 +0400
+++ gdb/remote.c    2013-07-04 23:50:52.855721644 +0400
@@ -4256,6 +4256,7 @@ remote_open_1 (char *name, int from_tty,
     }
     }

+  serial_setparity(remote_desc, serial_parity);
   serial_raw (remote_desc);

   /* If there is something sitting in the buffer we might take it as a
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-base.c gdb/ser-base.c
--- ../../../gdb_old/gdb-7.6/gdb/ser-base.c    2013-07-10
21:55:24.161873687 +0400
+++ gdb/ser-base.c    2013-07-05 00:28:55.795720278 +0400
@@ -536,6 +536,14 @@ ser_base_setbaudrate (struct serial *scb
   return 0;            /* Never fails!  */
 }

+
+int
+ser_base_setparity (struct serial *scb, int num)
+{
+  return 0;            /* Never fails!  */
+}
+
+
 int
 ser_base_setstopbits (struct serial *scb, int num)
 {
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-base.h gdb/ser-base.h
--- ../../../gdb_old/gdb-7.6/gdb/ser-base.h    2013-07-10
21:55:24.168750025 +0400
+++ gdb/ser-base.h    2013-07-05 00:30:36.017596667 +0400
@@ -43,6 +43,7 @@ extern int ser_base_noflush_set_tty_stat
                        serial_ttystate old_ttystate);
 extern int ser_base_setbaudrate (struct serial *scb, int rate);
 extern int ser_base_setstopbits (struct serial *scb, int rate);
+extern int ser_base_setparity (struct serial *scb, int parity);
 extern int ser_base_drain_output (struct serial *scb);

 extern int ser_base_write (struct serial *scb, const char *str, int len);
diff -up ../../../gdb_old/gdb-7.6/gdb/serial.c gdb/serial.c
--- ../../../gdb_old/gdb-7.6/gdb/serial.c    2013-07-10 21:55:35.224750365 +0400
+++ gdb/serial.c    2013-07-10 20:41:31.899897384 +0400
@@ -26,6 +26,9 @@

 extern void _initialize_serial (void);

+/* Parity for serial port */
+extern int serial_parity;
+
 /* Is serial being debugged?  */

 static unsigned int global_serial_debug_p;
@@ -53,10 +56,29 @@ static const char logbase_ascii[] = "asc
 static const char *const logbase_enums[] =
 {logbase_hex, logbase_octal, logbase_ascii, NULL};
 static const char *serial_logbase = logbase_ascii;
-

 static int serial_current_type = 0;

+/* Parity for serial port */
+static const char parity_none[] = "none";
+static const char parity_odd[] = "odd";
+static const char parity_even[] = "even";
+static const char *const parity_enums[] =
+{parity_none, parity_odd, parity_even,  NULL};
+static const char *parity = parity_none;
+
+static void
+set_parity (char *ignore_args, int from_tty, struct cmd_list_element *c)
+{
+  if (parity == parity_odd)
+    serial_parity = GDBPARITY_ODD;
+  else if (parity == parity_even)
+    serial_parity = GDBPARITY_EVEN;
+  else
+    serial_parity = GDBPARITY_NONE;
+}
+
+
 /* Log char CH of type CHTYPE, with TIMEOUT.  */

 /* Define bogus char to represent a BREAK.  Should be careful to choose a value
@@ -521,6 +543,12 @@ serial_setstopbits (struct serial *scb,
 }

 int
+serial_setparity (struct serial*scb, int parity)
+{
+  return scb->ops->setparity (scb, parity);
+}
+
+int
 serial_can_async_p (struct serial *scb)
 {
   return (scb->ops->async != NULL);
@@ -658,6 +686,15 @@ Show numerical base for remote session l
             NULL, /* FIXME: i18n: */
             &setlist, &showlist);

+  add_setshow_enum_cmd ("remoteparity", no_class, parity_enums,
+                        &parity, _("\
+Set parity for remote serial I/O"), _("\
+Show parity for remote serial I/O"), NULL,
+                        set_parity,
+                        NULL, /* FIXME: i18n: */
+                        &setlist, &showlist);
+
+
   add_setshow_zuinteger_cmd ("serial", class_maintenance,
                  &global_serial_debug_p, _("\
 Set serial debugging."), _("\
diff -up ../../../gdb_old/gdb-7.6/gdb/serial.h gdb/serial.h
--- ../../../gdb_old/gdb-7.6/gdb/serial.h    2013-07-10 21:55:33.445749528 +0400
+++ gdb/serial.h    2013-07-10 20:17:17.705956716 +0400
@@ -177,6 +177,14 @@ extern int serial_noflush_set_tty_state

 extern int serial_setbaudrate (struct serial *scb, int rate);

+/* Set parity for serial port. Return 0 for success, -1 for failure */
+
+#define GDBPARITY_NONE     0
+#define GDBPARITY_ODD      1
+#define GDBPARITY_EVEN     2
+
+extern int serial_setparity (struct serial *scb, int parity);
+
 /* Set the number of stop bits to the value specified.  Returns 0 for
    success, -1 for failure.  */

@@ -272,6 +280,7 @@ struct serial_ops
                   serial_ttystate);
     int (*setbaudrate) (struct serial *, int rate);
     int (*setstopbits) (struct serial *, int num);
+    int (*setparity) (struct serial *, int parity);
     /* Wait for output to drain.  */
     int (*drain_output) (struct serial *);
     /* Change the serial device into/out of asynchronous mode, call
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-mingw.c gdb/ser-mingw.c
--- ../../../gdb_old/gdb-7.6/gdb/ser-mingw.c    2013-07-10
21:55:24.185807109 +0400
+++ gdb/ser-mingw.c    2013-07-10 20:51:20.459749272 +0400
@@ -156,7 +156,6 @@ ser_windows_raw (struct serial *scb)
   if (GetCommState (h, &state) == 0)
     return;

-  state.fParity = FALSE;
   state.fOutxCtsFlow = FALSE;
   state.fOutxDsrFlow = FALSE;
   state.fDtrControl = DTR_CONTROL_ENABLE;
@@ -166,7 +165,6 @@ ser_windows_raw (struct serial *scb)
   state.fNull = FALSE;
   state.fAbortOnError = FALSE;
   state.ByteSize = 8;
-  state.Parity = NOPARITY;

   scb->current_timeout = 0;

@@ -202,6 +200,37 @@ ser_windows_setstopbits (struct serial *
 }

 static int
+ser_windows_setparity (struct serial *scb, int parity)
+{
+  HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
+  DCB state;
+
+  if (GetCommState (h, &state) == 0)
+    return -1;
+
+  switch (parity)
+ {
+    case GDBPARITY_NONE:
+        state.Parity = NOPARITY;
+        state.fParity = FALSE;
+        break;
+    case GDBPARITY_ODD:
+        state.Parity = ODDPARITY;
+        state.fParity = TRUE;
+        break;
+    case GDBPARITY_EVEN:
+        state.Parity = EVENPARITY;
+        state.fParity = TRUE;
+        break;
+    default:
+        return 1;
+
+ }
+
+  return (SetCommState (h, &state) != 0) ? 0 : -1;
+}
+
+static int
 ser_windows_setbaudrate (struct serial *scb, int rate)
 {
   HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
@@ -1250,6 +1279,7 @@ _initialize_ser_windows (void)

   ops->go_raw = ser_windows_raw;
   ops->setbaudrate = ser_windows_setbaudrate;
+  ops->setparity = ser_windows_setparity;
   ops->setstopbits = ser_windows_setstopbits;
   ops->drain_output = ser_windows_drain_output;
   ops->readchar = ser_base_readchar;
@@ -1303,6 +1333,7 @@ _initialize_ser_windows (void)
   ops->print_tty_state = ser_base_print_tty_state;
   ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
   ops->setbaudrate = ser_base_setbaudrate;
+  ops->setparity = ser_base_setparity;
   ops->setstopbits = ser_base_setstopbits;
   ops->drain_output = ser_base_drain_output;
   ops->async = ser_base_async;
@@ -1338,6 +1369,7 @@ _initialize_ser_windows (void)
   ops->print_tty_state = ser_base_print_tty_state;
   ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
   ops->setbaudrate = ser_base_setbaudrate;
+  ops->setparity = ser_base_setparity;
   ops->setstopbits = ser_base_setstopbits;
   ops->drain_output = ser_base_drain_output;
   ops->async = ser_base_async;
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-pipe.c gdb/ser-pipe.c
--- ../../../gdb_old/gdb-7.6/gdb/ser-pipe.c    2013-07-10
21:55:24.185807109 +0400
+++ gdb/ser-pipe.c    2013-07-10 20:58:32.921749511 +0400
@@ -233,6 +233,7 @@ _initialize_ser_pipe (void)
   ops->print_tty_state = ser_base_print_tty_state;
   ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
   ops->setbaudrate = ser_base_setbaudrate;
+  ops->setparity = ser_base_setparity;
   ops->setstopbits = ser_base_setstopbits;
   ops->drain_output = ser_base_drain_output;
   ops->async = ser_base_async;
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-tcp.c gdb/ser-tcp.c
--- ../../../gdb_old/gdb-7.6/gdb/ser-tcp.c    2013-07-10
21:55:24.200748354 +0400
+++ gdb/ser-tcp.c    2013-07-05 00:33:53.026598227 +0400
@@ -396,6 +396,7 @@ _initialize_ser_tcp (void)
   ops->print_tty_state = ser_base_print_tty_state;
   ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
   ops->setbaudrate = ser_base_setbaudrate;
+  ops->setparity = ser_base_setparity;
   ops->setstopbits = ser_base_setstopbits;
   ops->drain_output = ser_base_drain_output;
   ops->async = ser_base_async;
diff -up ../../../gdb_old/gdb-7.6/gdb/ser-unix.c gdb/ser-unix.c
--- ../../../gdb_old/gdb-7.6/gdb/ser-unix.c    2013-07-10
21:55:24.229751815 +0400
+++ gdb/ser-unix.c    2013-07-10 20:45:43.995750064 +0400
@@ -99,6 +99,7 @@ static int hardwire_flush_output (struct
 static int hardwire_flush_input (struct serial *);
 static int hardwire_send_break (struct serial *);
 static int hardwire_setstopbits (struct serial *, int);
+static int hardwire_setparity (struct serial *, int);

 void _initialize_ser_hardwire (void);

@@ -893,6 +894,47 @@ hardwire_setstopbits (struct serial *scb
   return set_tty_state (scb, &state);
 }

+static int
+hardwire_setparity (struct serial *scb, int parity)
+{
+  struct hardwire_ttystate state;
+  int newparity = 0;
+
+  if (get_tty_state (scb, &state))
+    return -1;
+
+  switch (parity)
+    {
+    case GDBPARITY_NONE:
+          newparity = 0;
+    break;
+    case GDBPARITY_ODD:
+    newparity = PARENB | PARODD;
+    break;
+    case GDBPARITY_EVEN:
+          newparity = PARENB;
+      break;
+    default:
+      return 1;
+    }
+
+#ifdef HAVE_TERMIOS
+    state.termios.c_cflag |= newparity;
+#endif
+
+#ifdef HAVE_TERMIO
+    state.termio.c_cflag |= newparity;
+#endif
+
+#ifdef HAVE_SGTTY
+  return 0;            /* sgtty doesn't support this */
+#endif
+
+  return set_tty_state (scb, &state);
+
+}
+
+
 static void
 hardwire_close (struct serial *scb)
 {
@@ -929,6 +971,7 @@ _initialize_ser_hardwire (void)
   ops->print_tty_state = hardwire_print_tty_state;
   ops->noflush_set_tty_state = hardwire_noflush_set_tty_state;
   ops->setbaudrate = hardwire_setbaudrate;
+  ops->setparity = hardwire_setparity;
   ops->setstopbits = hardwire_setstopbits;
   ops->drain_output = hardwire_drain_output;
   ops->async = ser_base_async;
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/stubs and gdb/stubs
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/syscalls and gdb/syscalls
diff -up ../../../gdb_old/gdb-7.6/gdb/target.h gdb/target.h
--- ../../../gdb_old/gdb-7.6/gdb/target.h    2013-07-10 21:55:36.818749395 +0400
+++ gdb/target.h    2013-07-05 00:36:15.025597655 +0400
@@ -1961,6 +1961,10 @@ extern int remote_debug;

 /* Speed in bits per second, or -1 which means don't mess with the speed.  */
 extern int baud_rate;
+
+/* Parity for serial port */
+extern int serial_parity;
+
 /* Timeout limit for response from target.  */
 extern int remote_timeout;

Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/testsuite and gdb/testsuite
diff -up ../../../gdb_old/gdb-7.6/gdb/top.c gdb/top.c
--- ../../../gdb_old/gdb-7.6/gdb/top.c    2013-07-10 21:55:32.033750880 +0400
+++ gdb/top.c    2013-07-10 20:55:06.711827223 +0400
@@ -159,6 +159,9 @@ int server_command;

 int baud_rate = -1;

+/* Parity for serial port */
+int serial_parity = GDBPARITY_NONE;
+
 /* Timeout limit for response from target.  */

 /* The default value has been changed many times over the years.  It
Common subdirectories: ../../../gdb_old/gdb-7.6/gdb/tui and gdb/tui



--
With best regards!
____________________________

Yurij Grechishhev
Bauman State Technical University,
Department of Computer Systems and Networks

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Setting parity for remote serial
  2013-07-10 15:18 Setting parity for remote serial Yurij Grechishhev
@ 2013-07-10 18:10 ` Tom Tromey
  2013-10-04 14:12   ` Pedro Alves
  0 siblings, 1 reply; 22+ messages in thread
From: Tom Tromey @ 2013-07-10 18:10 UTC (permalink / raw)
  To: Yurij Grechishhev; +Cc: gdb-patches

>>>>> "Yurij" == Yurij Grechishhev <yurij.grechishhev@gmail.com> writes:

Yurij> GDB doesn't support command to set parity for serial ports. So there
Yurij> is a problem to connect target that use "odd" or "even" parity.
Yurij> The one way is to set parity before launching gdb (stty for Linux or
Yurij> MODE for Windows), but for Windows gdb sets parity to "none" during
Yurij> connection.
Yurij> I suggest using "set remoteparity <odd | even | none>" command for this.

It looks reasonable to me.
There are some formatting issues, but nothing too serious.

Do you have a copyright assignment in place?
If not, contact me off list and I will get you started on that.

This would need at least a ChangeLog entry, documentation patch, and
NEWS patch to be complete.  A test case would be nice as well, though I
can see how it would be hard to make it actually do anything :)

Yurij> Do you plan to use "class serial" (set serial ...) for serial settings?
Yurij> "set serial parity <odd | even | none>" is more convenient way.

I didn't even know about "set serial".
It seems like dead code; but I'd have to dig into the history there to
find out.

Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Setting parity for remote serial
  2013-07-10 18:10 ` Tom Tromey
@ 2013-10-04 14:12   ` Pedro Alves
  2013-10-07 18:33     ` Yurij Grechishhev
  0 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-10-04 14:12 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Yurij Grechishhev, gdb-patches

On 07/10/2013 07:09 PM, Tom Tromey wrote:

> Yurij> Do you plan to use "class serial" (set serial ...) for serial settings?
> Yurij> "set serial parity <odd | even | none>" is more convenient way.
> 
> I didn't even know about "set serial".
> It seems like dead code; but I'd have to dig into the history there to
> find out.

Yeah, I don't know the history either, but it'd be totally fine with me
to start making use of it.  These "set remotefoo" commands with no space
in them look really oddly named.  However, adding "set serial parity" without
aliasing "set serial baud" to the old "set remotebaud" (and deprecating
that) wouldn't be desirable.  IOW, IMO, if we add "set serial parity",
we should also alias "set remotebaud" to "set serial baud", and whatever
other commands would make sense (which should be really simple to do).

Thanks,
-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Setting parity for remote serial
  2013-10-04 14:12   ` Pedro Alves
@ 2013-10-07 18:33     ` Yurij Grechishhev
  2013-10-08  3:56       ` Joel Brobecker
  0 siblings, 1 reply; 22+ messages in thread
From: Yurij Grechishhev @ 2013-10-07 18:33 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> IOW, IMO, if we add "set serial parity",
> we should also alias "set remotebaud" to "set serial baud", and whatever
> other commands would make sense (which should be really simple to do).

That would be great. But it's more comprehensive patch that I have done.
Can we add all "set remotefoo" commands and then alias them
to "set serial foo" at once?
Related discussion:
https://sourceware.org/ml/gdb-patches/2001-09/msg00358.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Setting parity for remote serial
  2013-10-07 18:33     ` Yurij Grechishhev
@ 2013-10-08  3:56       ` Joel Brobecker
  2013-10-08 12:03         ` Pedro Alves
  0 siblings, 1 reply; 22+ messages in thread
From: Joel Brobecker @ 2013-10-08  3:56 UTC (permalink / raw)
  To: Yurij Grechishhev; +Cc: Pedro Alves, gdb-patches

> > IOW, IMO, if we add "set serial parity",
> > we should also alias "set remotebaud" to "set serial baud", and whatever
> > other commands would make sense (which should be really simple to do).
> 
> That would be great. But it's more comprehensive patch that I have done.
> Can we add all "set remotefoo" commands and then alias them
> to "set serial foo" at once?
> Related discussion:
> https://sourceware.org/ml/gdb-patches/2001-09/msg00358.html

I'd rather we do it right the first time. If we're a go with
the "set serial baud" command, I don't mind taking care of
that part. As Pedro hints, it's a fairly easy change to make.

Pedro, should we go ahead? It's only been a day or two, but we haven't
had any objection so far.

-- 
Joel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Setting parity for remote serial
  2013-10-08  3:56       ` Joel Brobecker
@ 2013-10-08 12:03         ` Pedro Alves
  2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
  0 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-10-08 12:03 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Yurij Grechishhev, gdb-patches

[tweaking subject to draw others' attention]

On 10/08/2013 04:56 AM, Joel Brobecker wrote:
>>> IOW, IMO, if we add "set serial parity",
>>> we should also alias "set remotebaud" to "set serial baud", and whatever
>>> other commands would make sense (which should be really simple to do).
>>
>> That would be great. But it's more comprehensive patch that I have done.
>> Can we add all "set remotefoo" commands and then alias them
>> to "set serial foo" at once?
>> Related discussion:
>> https://sourceware.org/ml/gdb-patches/2001-09/msg00358.html
> 
> I'd rather we do it right the first time. If we're a go with
> the "set serial baud" command, I don't mind taking care of
> that part. As Pedro hints, it's a fairly easy change to make.
> 
> Pedro, should we go ahead? It's only been a day or two, but we haven't
> had any objection so far.

Yeah, I think so.

Thanks,
-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial")
  2013-10-08 12:03         ` Pedro Alves
@ 2013-10-08 14:16           ` Joel Brobecker
  2013-10-08 14:34             ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
                               ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Joel Brobecker @ 2013-10-08 14:16 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Yurij Grechishhev, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

> > I'd rather we do it right the first time. If we're a go with
> > the "set serial baud" command, I don't mind taking care of
> > that part. As Pedro hints, it's a fairly easy change to make.
> > 
> > Pedro, should we go ahead? It's only been a day or two, but we haven't
> > had any objection so far.
> 
> Yeah, I think so.

Attached is a patch that implements that.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

Tested on x86_64-linux, with no regression (I almost expected one,
as we used to test thhe output "help set", or soemthing like that).

OK to commit?

Thanks,
-- 
Joel

[-- Attachment #2: 0001-Rename-set-show-remotebaud-command-into-set-show-ser.patch --]
[-- Type: text/x-diff, Size: 5872 bytes --]

From 94708a66478aadeb7e0bff57e6f83339e2b13bdd Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Tue, 8 Oct 2013 17:55:02 +0400
Subject: [PATCH] Rename "set/show remotebaud" command into "set/show serial
 baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old command names via command aliases.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".
---
 gdb/NEWS           |  5 +++++
 gdb/cli/cli-cmds.c | 19 -------------------
 gdb/serial.c       | 30 ++++++++++++++++++++++++++++++
 gdb/top.c          |  7 -------
 4 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 8114fb1..4e627b0 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -200,6 +200,11 @@ qXfer:libraries-svr4:read's annex
 
 * GDB can now use Windows x64 unwinding data.
 
+* The "set remotebaud" command has been replaced by "set serial baud".
+  Similarly, "show remotebaud" has been replaced by "show serial baud".
+  The "set remotebaud" and "show remotebaud" commands are still available
+  to provide backward compatibility with older versions of GDB.
+
 *** Changes in GDB 7.6
 
 * Target record has been renamed to record-full.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 886ba7a..460b719 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1582,14 +1582,6 @@ show_history_expansion_p (struct ui_file *file, int from_tty,
 }
 
 static void
-show_baud_rate (struct ui_file *file, int from_tty,
-		struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
-		    value);
-}
-
-static void
 show_remote_debug (struct ui_file *file, int from_tty,
 		   struct cmd_list_element *c, const char *value)
 {
@@ -1748,17 +1740,6 @@ the previous command number shown."),
   add_cmd ("configuration", no_set_class, show_configuration,
 	   _("Show how GDB was configured at build time."), &showlist);
 
-  /* If target is open when baud changes, it doesn't take effect until
-     the next open (I think, not sure).  */
-  add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
-Set baud rate for remote serial I/O."), _("\
-Show baud rate for remote serial I/O."), _("\
-This value is used to set the speed of the serial port when debugging\n\
-using remote targets."),
-			    NULL,
-			    show_baud_rate,
-			    &setlist, &showlist);
-
   add_setshow_zinteger_cmd ("remote", no_class, &remote_debug, _("\
 Set debugging of remote protocol."), _("\
 Show debugging of remote protocol."), _("\
diff --git a/gdb/serial.c b/gdb/serial.c
index ee3f1ea..434cde4 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -621,6 +621,20 @@ serial_show_cmd (char *args, int from_tty)
   cmd_show_list (serial_show_cmdlist, from_tty, "");
 }
 
+/* Baud rate specified for talking to serial target systems.  Default
+   is left as -1, so targets can choose their own defaults.  */
+/* FIXME: This means that "show remotebaud" and gr_files_info can
+   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
+
+int baud_rate = -1;
+
+static void
+serial_baud_show_cmd (struct ui_file *file, int from_tty,
+		      struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
+		    value);
+}
 
 void
 _initialize_serial (void)
@@ -643,6 +657,22 @@ Show default serial/parallel port configuration."),
 		  0/*allow-unknown*/,
 		  &showlist);
 
+  /* If target is open when baud changes, it doesn't take effect until
+     the next open (I think, not sure).  */
+  add_setshow_zinteger_cmd ("baud", no_class, &baud_rate, _("\
+Set baud rate for remote serial I/O."), _("\
+Show baud rate for remote serial I/O."), _("\
+This value is used to set the speed of the serial port when debugging\n\
+using remote targets."),
+			    NULL,
+			    serial_baud_show_cmd,
+			    &serial_set_cmdlist, &serial_show_cmdlist);
+
+  /* The commands "set/show serial baud" used to have a different name.
+     Add aliases to those names to facilitate the transition.  */
+  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &setlist);
+  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &showlist);
+
   add_setshow_filename_cmd ("remotelogfile", no_class, &serial_logfile, _("\
 Set filename for remote session recording."), _("\
 Show filename for remote session recording."), _("\
diff --git a/gdb/top.c b/gdb/top.c
index d9128a3..c473d8c 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -144,13 +144,6 @@ int saved_command_line_size = 100;
    is issuing commands too.  */
 int server_command;
 
-/* Baud rate specified for talking to serial target systems.  Default
-   is left as -1, so targets can choose their own defaults.  */
-/* FIXME: This means that "show remotebaud" and gr_files_info can
-   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
-
-int baud_rate = -1;
-
 /* Timeout limit for response from target.  */
 
 /* The default value has been changed many times over the years.  It 
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command
  2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
@ 2013-10-08 14:34             ` Pedro Alves
  2013-10-08 15:00               ` Joel Brobecker
  2013-10-08 15:12             ` Tom Tromey
                               ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-10-08 14:34 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Yurij Grechishhev, gdb-patches

On 10/08/2013 03:16 PM, Joel Brobecker wrote:
>>> I'd rather we do it right the first time. If we're a go with
>>> the "set serial baud" command, I don't mind taking care of
>>> that part. As Pedro hints, it's a fairly easy change to make.
>>>
>>> Pedro, should we go ahead? It's only been a day or two, but we haven't
>>> had any objection so far.
>>
>> Yeah, I think so.
> 
> Attached is a patch that implements that.
> 

Thanks, looks good to me, though, don't we need to update the manual?

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command
  2013-10-08 14:34             ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
@ 2013-10-08 15:00               ` Joel Brobecker
  0 siblings, 0 replies; 22+ messages in thread
From: Joel Brobecker @ 2013-10-08 15:00 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Yurij Grechishhev, gdb-patches

> Thanks, looks good to me, though, don't we need to update the manual?

Argh. Yes, thanks! I completely zapped that part. I will take care of that
tomorrow.

-- 
Joel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command
  2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
  2013-10-08 14:34             ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
@ 2013-10-08 15:12             ` Tom Tromey
  2013-10-09 11:23               ` [RFA v2/code+DOCO+NEWS] " Joel Brobecker
  2013-10-08 15:24             ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Eli Zaretskii
  2013-10-09  2:05             ` Doug Evans
  3 siblings, 1 reply; 22+ messages in thread
From: Tom Tromey @ 2013-10-08 15:12 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Pedro Alves, Yurij Grechishhev, gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> +  /* The commands "set/show serial baud" used to have a different name.
Joel> +     Add aliases to those names to facilitate the transition.  */
Joel> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &setlist);
Joel> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &showlist);

I think it's best to also deprecate these aliases.

Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial")
  2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
  2013-10-08 14:34             ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
  2013-10-08 15:12             ` Tom Tromey
@ 2013-10-08 15:24             ` Eli Zaretskii
  2013-10-09  2:05             ` Doug Evans
  3 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2013-10-08 15:24 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: palves, yurij.grechishhev, gdb-patches

> Date: Tue, 8 Oct 2013 18:16:39 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Yurij Grechishhev <yurij.grechishhev@gmail.com>,	gdb-patches@sourceware.org
> 
> Attached is a patch that implements that.
> 
> gdb/ChangeLog:
> 
>         * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
>         serial_baud_show_cmd.
>         (_initialize_cli_cmds): Delete the code creating the
>         "set/show remotebaud" commands.
>         * serial.c (baud_rate): Move here from top.c.
>         (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
>         (_initialize_serial): Create "set/show serial baud" commands.
>         Add "set/show remotebaud" command aliases.
>         * top.c (baud_rate): Moved to serial.c.
>         * NEWS: Document the new "set/show serial baud" commands,
>         replacing "set/show remotebaud".
> 
> Tested on x86_64-linux, with no regression (I almost expected one,
> as we used to test thhe output "help set", or soemthing like that).
> 
> OK to commit?

OK for the documentation parts.  Thanks.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial")
  2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
                               ` (2 preceding siblings ...)
  2013-10-08 15:24             ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Eli Zaretskii
@ 2013-10-09  2:05             ` Doug Evans
  2013-10-09  3:57               ` Joel Brobecker
  3 siblings, 1 reply; 22+ messages in thread
From: Doug Evans @ 2013-10-09  2:05 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Pedro Alves, Yurij Grechishhev, gdb-patches

On Tue, Oct 8, 2013 at 7:16 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > I'd rather we do it right the first time. If we're a go with
>> > the "set serial baud" command, I don't mind taking care of
>> > that part. As Pedro hints, it's a fairly easy change to make.
>> >
>> > Pedro, should we go ahead? It's only been a day or two, but we haven't
>> > had any objection so far.
>>
>> Yeah, I think so.
>
> Attached is a patch that implements that.
>
> gdb/ChangeLog:
>
>         * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
>         serial_baud_show_cmd.
>         (_initialize_cli_cmds): Delete the code creating the
>         "set/show remotebaud" commands.
>         * serial.c (baud_rate): Move here from top.c.
>         (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
>         (_initialize_serial): Create "set/show serial baud" commands.
>         Add "set/show remotebaud" command aliases.
>         * top.c (baud_rate): Moved to serial.c.
>         * NEWS: Document the new "set/show serial baud" commands,
>         replacing "set/show remotebaud".
>
> Tested on x86_64-linux, with no regression (I almost expected one,
> as we used to test thhe output "help set", or soemthing like that).
>
> OK to commit?
>
> Thanks,
> --
> Joel

+  /* The commands "set/show serial baud" used to have a different name.
+     Add aliases to those names to facilitate the transition.  */
+  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &setlist);
+  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &showlist);

Does the mark-as-deprecated machinery work here?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial")
  2013-10-09  2:05             ` Doug Evans
@ 2013-10-09  3:57               ` Joel Brobecker
  2013-10-09  8:31                 ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
  0 siblings, 1 reply; 22+ messages in thread
From: Joel Brobecker @ 2013-10-09  3:57 UTC (permalink / raw)
  To: Doug Evans; +Cc: Pedro Alves, Yurij Grechishhev, gdb-patches

> +  /* The commands "set/show serial baud" used to have a different name.
> +     Add aliases to those names to facilitate the transition.  */
> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &setlist);
> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &showlist);
> 
> Does the mark-as-deprecated machinery work here?

It should. I just wasn't sure at the time I wrote the patch that
we actually wanted to deprecate the commands. Since Tom proposed it
as well, if there are no objection from others, I will do so, and
update the NEWS entry accordingly (as well as add this entry for
post 7.6 branch).

-- 
Joel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA/code+NEWS] new "set/show serial baud" command
  2013-10-09  3:57               ` Joel Brobecker
@ 2013-10-09  8:31                 ` Pedro Alves
  0 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-10-09  8:31 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Yurij Grechishhev, gdb-patches

On 10/09/2013 04:57 AM, Joel Brobecker wrote:
>> +  /* The commands "set/show serial baud" used to have a different name.
>> +     Add aliases to those names to facilitate the transition.  */
>> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &setlist);
>> +  add_alias_cmd ("remotebaud", "serial baud", no_class, 0, &showlist);
>>
>> Does the mark-as-deprecated machinery work here?
> 
> It should. I just wasn't sure at the time I wrote the patch that
> we actually wanted to deprecate the commands. Since Tom proposed it
> as well, if there are no objection from others, I will do so, and
> update the NEWS entry accordingly (as well as add this entry for
> post 7.6 branch).

I also think the old ones should be marked deprecated.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-08 15:12             ` Tom Tromey
@ 2013-10-09 11:23               ` Joel Brobecker
  2013-10-09 16:17                 ` Pedro Alves
  2013-10-09 16:44                 ` Eli Zaretskii
  0 siblings, 2 replies; 22+ messages in thread
From: Joel Brobecker @ 2013-10-09 11:23 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2459 bytes --]

> I think it's best to also deprecate these aliases.

Unfortunately, I hit a limitation when trying to deprecate the alias,
and my guess is because the command is prefixed. I had a quick look,
and basically, I think "lookup_cmd_1" recurses into himself by first
finding the prefixed command, then does the recursion by trying to
find the rest of the command within that prefix. It finds the command
and notices the fact that it is deprecated, and even tries to warn
the user by calling deprecated_cmd_warning.  But this function only
takes the deprecated command names, and the name it passes is lacking
the prefix (due to the recursion). As a result, deprecated_cmd_warning
fails to find the aliased command and returns immediately:

  if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
    /* Return if text doesn't evaluate to a command.  */
    return;

Lifting that limitation would take a little bit more time than I have,
so I went with the sort of trick as the one used in remote.c, which
is to duplicate the command. Not pretty, but as the FIXME says, it's
temporary (I've already added a TODO item in the GDB 7.8 release
management wiki page).

This patch implements that change, as well as updates the GDB Manual.
For now, it's a straight search-and-replace, as there was no real
section where the option could go.  Eventually, I think we will want
to dissociate the options relative to the remote protocol, from the
options specific to serial line handling. I think other option names
might need to be renamed as well, but this I've already far exceeded
the amount of time I could spend on this.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.

I hope it's a sufficient improvement in itself. OK to apply?

-- 
Joel

[-- Attachment #2: 0001-Rename-set-show-remotebaud-command-into-set-show-ser.patch --]
[-- Type: text/x-diff, Size: 8306 bytes --]

From 7bb83681c2813a3f2cfb0afcd43284f931691bc7 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Tue, 8 Oct 2013 17:55:02 +0400
Subject: [PATCH] Rename "set/show remotebaud" command into "set/show serial
 baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old commands, and marks them as deprecated
to alert the users of the change.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.
---
 gdb/NEWS            |  5 +++++
 gdb/cli/cli-cmds.c  | 19 ------------------
 gdb/doc/gdb.texinfo |  8 ++++----
 gdb/serial.c        | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/top.c           |  7 -------
 5 files changed, 64 insertions(+), 30 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 8114fb1..4e627b0 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -200,6 +200,11 @@ qXfer:libraries-svr4:read's annex
 
 * GDB can now use Windows x64 unwinding data.
 
+* The "set remotebaud" command has been replaced by "set serial baud".
+  Similarly, "show remotebaud" has been replaced by "show serial baud".
+  The "set remotebaud" and "show remotebaud" commands are still available
+  to provide backward compatibility with older versions of GDB.
+
 *** Changes in GDB 7.6
 
 * Target record has been renamed to record-full.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 886ba7a..460b719 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1582,14 +1582,6 @@ show_history_expansion_p (struct ui_file *file, int from_tty,
 }
 
 static void
-show_baud_rate (struct ui_file *file, int from_tty,
-		struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
-		    value);
-}
-
-static void
 show_remote_debug (struct ui_file *file, int from_tty,
 		   struct cmd_list_element *c, const char *value)
 {
@@ -1748,17 +1740,6 @@ the previous command number shown."),
   add_cmd ("configuration", no_set_class, show_configuration,
 	   _("Show how GDB was configured at build time."), &showlist);
 
-  /* If target is open when baud changes, it doesn't take effect until
-     the next open (I think, not sure).  */
-  add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
-Set baud rate for remote serial I/O."), _("\
-Show baud rate for remote serial I/O."), _("\
-This value is used to set the speed of the serial port when debugging\n\
-using remote targets."),
-			    NULL,
-			    show_baud_rate,
-			    &setlist, &showlist);
-
   add_setshow_zinteger_cmd ("remote", no_class, &remote_debug, _("\
 Set debugging of remote protocol."), _("\
 Show debugging of remote protocol."), _("\
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e196658..bda2e7b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18024,8 +18024,8 @@ target remote /dev/ttyb
 @end smallexample
 
 If you're using a serial line, you may want to give @value{GDBN} the
-@w{@samp{--baud}} option, or use the @code{set remotebaud} command
-(@pxref{Remote Configuration, set remotebaud}) before the
+@w{@samp{--baud}} option, or use the @code{set serial baud} command
+(@pxref{Remote Configuration, set serial baud}) before the
 @code{target} command.
 
 @item target remote @code{@var{host}:@var{port}}
@@ -18567,13 +18567,13 @@ default value is the number of bits in the target's address.
 @item show remoteaddresssize
 Show the current value of remote address size in bits.
 
-@item set remotebaud @var{n}
+@item set serial baud @var{n}
 @cindex baud rate for remote targets
 Set the baud rate for the remote serial I/O to @var{n} baud.  The
 value is used to set the speed of the serial port used for debugging
 remote targets.
 
-@item show remotebaud
+@item show serial baud
 Show the current speed of the remote connection.
 
 @item set remotebreak
diff --git a/gdb/serial.c b/gdb/serial.c
index ee3f1ea..3233e1b 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -621,6 +621,20 @@ serial_show_cmd (char *args, int from_tty)
   cmd_show_list (serial_show_cmdlist, from_tty, "");
 }
 
+/* Baud rate specified for talking to serial target systems.  Default
+   is left as -1, so targets can choose their own defaults.  */
+/* FIXME: This means that "show serial baud" and gr_files_info can
+   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
+
+int baud_rate = -1;
+
+static void
+serial_baud_show_cmd (struct ui_file *file, int from_tty,
+		      struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
+		    value);
+}
 
 void
 _initialize_serial (void)
@@ -643,6 +657,47 @@ Show default serial/parallel port configuration."),
 		  0/*allow-unknown*/,
 		  &showlist);
 
+  /* If target is open when baud changes, it doesn't take effect until
+     the next open (I think, not sure).  */
+  add_setshow_zinteger_cmd ("baud", no_class, &baud_rate, _("\
+Set baud rate for remote serial I/O."), _("\
+Show baud rate for remote serial I/O."), _("\
+This value is used to set the speed of the serial port when debugging\n\
+using remote targets."),
+			    NULL,
+			    serial_baud_show_cmd,
+			    &serial_set_cmdlist, &serial_show_cmdlist);
+
+  /* The commands "set/show serial baud" used to have a different name.
+     Add aliases to those names to facilitate the transition, and mark
+     them as deprecated, in order to make users aware of the fact that
+     the command names have been changed.  */
+    {
+      const char *cmd_name;
+      struct cmd_list_element *cmd;
+
+      /* FIXME: There is a limitation in the deprecation mechanism,
+	 and the warning ends up not being displayed for prefixed
+	 aliases.  So use a real command instead of an alias.
+	 This is temporary code anyway, so should go away soon
+	 after the next release cycle starts.  */
+      add_setshow_zinteger_cmd ("remotebaud", class_alias, &baud_rate, _("\
+Set baud rate for remote serial I/O."), _("\
+Show baud rate for remote serial I/O."), _("\
+This value is used to set the speed of the serial port when debugging\n\
+using remote targets."),
+				NULL,
+				serial_baud_show_cmd,
+				&setlist, &showlist);
+      cmd_name = "remotebaud";
+      cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1);
+      deprecate_cmd (cmd, "set serial baud");
+      cmd_name
+	= "remotebaud"; /* needed because lookup_cmd updates the pointer */
+      cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1);
+      deprecate_cmd (cmd, "show serial baud");
+    }
+
   add_setshow_filename_cmd ("remotelogfile", no_class, &serial_logfile, _("\
 Set filename for remote session recording."), _("\
 Show filename for remote session recording."), _("\
diff --git a/gdb/top.c b/gdb/top.c
index d9128a3..c473d8c 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -144,13 +144,6 @@ int saved_command_line_size = 100;
    is issuing commands too.  */
 int server_command;
 
-/* Baud rate specified for talking to serial target systems.  Default
-   is left as -1, so targets can choose their own defaults.  */
-/* FIXME: This means that "show remotebaud" and gr_files_info can
-   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
-
-int baud_rate = -1;
-
 /* Timeout limit for response from target.  */
 
 /* The default value has been changed many times over the years.  It 
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-09 11:23               ` [RFA v2/code+DOCO+NEWS] " Joel Brobecker
@ 2013-10-09 16:17                 ` Pedro Alves
  2013-10-10  5:55                   ` checked in: " Joel Brobecker
  2013-10-09 16:44                 ` Eli Zaretskii
  1 sibling, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-10-09 16:17 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On 10/09/2013 12:23 PM, Joel Brobecker wrote:
> Unfortunately, I hit a limitation when trying to deprecate the alias,
> and my guess is because the command is prefixed. I had a quick look,
> and basically, I think "lookup_cmd_1" recurses into himself by first
> finding the prefixed command, then does the recursion by trying to
> find the rest of the command within that prefix. It finds the command
> and notices the fact that it is deprecated, and even tries to warn
> the user by calling deprecated_cmd_warning.  But this function only
> takes the deprecated command names, and the name it passes is lacking
> the prefix (due to the recursion). As a result, deprecated_cmd_warning
> fails to find the aliased command and returns immediately:
> 
>   if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
>     /* Return if text doesn't evaluate to a command.  */
>     return;
> 

Bummer.


> Lifting that limitation would take a little bit more time than I have,
> so I went with the sort of trick as the one used in remote.c, which
> is to duplicate the command. 

Oh well.  That's fine with me.

> Not pretty, but as the FIXME says, it's
> temporary (I've already added a TODO item in the GDB 7.8 release
> management wiki page).

...

> +      /* FIXME: There is a limitation in the deprecation mechanism,
> +	 and the warning ends up not being displayed for prefixed
> +	 aliases.  So use a real command instead of an alias.
> +	 This is temporary code anyway, so should go away soon
> +	 after the next release cycle starts.  */

I actually think that "temporary anyway" comment should be removed.  We
don't really have a habit of removing deprecated commands.  Marking a
command deprecated already makes it less visible.  E.g., it removes the
command from completion suggestions.  As long as the old command doesn't
get in the way, there's really no pressing need to remove it.
"soon after the next release" has itself a tendency to get
old and outdated :-)

> This patch implements that change, as well as updates the GDB Manual.
> For now, it's a straight search-and-replace, as there was no real
> section where the option could go.  Eventually, I think we will want
> to dissociate the options relative to the remote protocol, from the
> options specific to serial line handling. I think other option names
> might need to be renamed as well, but this I've already far exceeded
> the amount of time I could spend on this.
> 
> gdb/ChangeLog:
> 
>         * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
>         serial_baud_show_cmd.
>         (_initialize_cli_cmds): Delete the code creating the
>         "set/show remotebaud" commands.
>         * serial.c (baud_rate): Move here from top.c.
>         (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
>         (_initialize_serial): Create "set/show serial baud" commands.
>         Add "set/show remotebaud" command aliases.
>         * top.c (baud_rate): Moved to serial.c.
>         * NEWS: Document the new "set/show serial baud" commands,
>         replacing "set/show remotebaud".
> 
> gdb/doc/ChangeLog:
> 
>         * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
>         by "set serial baud" and "show serial baud" (resp) throughout.
> 
> I hope it's a sufficient improvement in itself. OK to apply?

This is fine with me.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-09 11:23               ` [RFA v2/code+DOCO+NEWS] " Joel Brobecker
  2013-10-09 16:17                 ` Pedro Alves
@ 2013-10-09 16:44                 ` Eli Zaretskii
  2013-10-10  5:59                   ` Joel Brobecker
  1 sibling, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2013-10-09 16:44 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: palves, gdb-patches

> Date: Wed, 9 Oct 2013 15:23:34 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
> 
> gdb/doc/ChangeLog:
> 
>         * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
>         by "set serial baud" and "show serial baud" (resp) throughout.

You didn't mention the node name in the log entry.

> diff --git a/gdb/NEWS b/gdb/NEWS
> index 8114fb1..4e627b0 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -200,6 +200,11 @@ qXfer:libraries-svr4:read's annex
>  
>  * GDB can now use Windows x64 unwinding data.
>  
> +* The "set remotebaud" command has been replaced by "set serial baud".
> +  Similarly, "show remotebaud" has been replaced by "show serial baud".
> +  The "set remotebaud" and "show remotebaud" commands are still available
> +  to provide backward compatibility with older versions of GDB.
> +

This is OK.

>  If you're using a serial line, you may want to give @value{GDBN} the
> -@w{@samp{--baud}} option, or use the @code{set remotebaud} command
> -(@pxref{Remote Configuration, set remotebaud}) before the
> +@w{@samp{--baud}} option, or use the @code{set serial baud} command

Is @w really needed here?  You have only one word there anyway.

Otherwise, OK for the documentation parts.

Thanks.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* checked in: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-09 16:17                 ` Pedro Alves
@ 2013-10-10  5:55                   ` Joel Brobecker
  0 siblings, 0 replies; 22+ messages in thread
From: Joel Brobecker @ 2013-10-10  5:55 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2573 bytes --]

> > +      /* FIXME: There is a limitation in the deprecation mechanism,
> > +	 and the warning ends up not being displayed for prefixed
> > +	 aliases.  So use a real command instead of an alias.
> > +	 This is temporary code anyway, so should go away soon
> > +	 after the next release cycle starts.  */
> 
> I actually think that "temporary anyway" comment should be removed.  We
> don't really have a habit of removing deprecated commands.  Marking a
> command deprecated already makes it less visible.  E.g., it removes the
> command from completion suggestions.  As long as the old command doesn't
> get in the way, there's really no pressing need to remove it.
> "soon after the next release" has itself a tendency to get
> old and outdated :-)
> 
> > This patch implements that change, as well as updates the GDB Manual.
> > For now, it's a straight search-and-replace, as there was no real
> > section where the option could go.  Eventually, I think we will want
> > to dissociate the options relative to the remote protocol, from the
> > options specific to serial line handling. I think other option names
> > might need to be renamed as well, but this I've already far exceeded
> > the amount of time I could spend on this.

OK, I removed the end of the comment entirely, even thought I've added
an AI for the 7.8 release to remove the "alias". Naturally, I'm fine
leaving it in for a while longer, if people prefer.

> > gdb/ChangeLog:
> > 
> >         * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
> >         serial_baud_show_cmd.
> >         (_initialize_cli_cmds): Delete the code creating the
> >         "set/show remotebaud" commands.
> >         * serial.c (baud_rate): Move here from top.c.
> >         (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
> >         (_initialize_serial): Create "set/show serial baud" commands.
> >         Add "set/show remotebaud" command aliases.
> >         * top.c (baud_rate): Moved to serial.c.
> >         * NEWS: Document the new "set/show serial baud" commands,
> >         replacing "set/show remotebaud".
> > 
> > gdb/doc/ChangeLog:
> > 
> >         * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
> >         by "set serial baud" and "show serial baud" (resp) throughout.
> > 
> > I hope it's a sufficient improvement in itself. OK to apply?
> 
> This is fine with me.

Great, thanks! Attached is what I ended up checking in. The only
difference is the change in the comment.

For Eli's comment about @w, I am about to send a followup-patch,
with an explanation why.

-- 
Joel

[-- Attachment #2: 0001-Rename-set-show-remotebaud-command-into-set-show-ser.patch --]
[-- Type: text/x-diff, Size: 9509 bytes --]

From 59d587ee110e04e286cd6718abdbb6c113ff058e Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Tue, 8 Oct 2013 17:55:02 +0400
Subject: [PATCH] Rename "set/show remotebaud" command into "set/show serial
 baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old commands, and marks them as deprecated
to alert the users of the change.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.
---
 gdb/ChangeLog       | 14 ++++++++++++++
 gdb/NEWS            |  5 +++++
 gdb/cli/cli-cmds.c  | 19 -------------------
 gdb/doc/ChangeLog   |  5 +++++
 gdb/doc/gdb.texinfo |  8 ++++----
 gdb/serial.c        | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/top.c           |  7 -------
 7 files changed, 81 insertions(+), 30 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 21bc3fe..4372579 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,17 @@
+2013-10-10  Joel Brobecker  <brobecker@adacore.com>
+
+	* cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
+	serial_baud_show_cmd.
+	(_initialize_cli_cmds): Delete the code creating the
+	"set/show remotebaud" commands.
+	* serial.c (baud_rate): Move here from top.c.
+	(serial_baud_show_cmd): Move here from cli/cli-cmds.c.
+	(_initialize_serial): Create "set/show serial baud" commands.
+	Add "set/show remotebaud" command aliases.
+	* top.c (baud_rate): Moved to serial.c.
+	* NEWS: Document the new "set/show serial baud" commands,
+	replacing "set/show remotebaud".
+
 2013-10-09  Pedro Alves  <palves@redhat.com>
 
 	* breakpoint.c (insert_bp_location): Use memory_error_message to
diff --git a/gdb/NEWS b/gdb/NEWS
index 8114fb1..4e627b0 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -200,6 +200,11 @@ qXfer:libraries-svr4:read's annex
 
 * GDB can now use Windows x64 unwinding data.
 
+* The "set remotebaud" command has been replaced by "set serial baud".
+  Similarly, "show remotebaud" has been replaced by "show serial baud".
+  The "set remotebaud" and "show remotebaud" commands are still available
+  to provide backward compatibility with older versions of GDB.
+
 *** Changes in GDB 7.6
 
 * Target record has been renamed to record-full.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 886ba7a..460b719 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1582,14 +1582,6 @@ show_history_expansion_p (struct ui_file *file, int from_tty,
 }
 
 static void
-show_baud_rate (struct ui_file *file, int from_tty,
-		struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
-		    value);
-}
-
-static void
 show_remote_debug (struct ui_file *file, int from_tty,
 		   struct cmd_list_element *c, const char *value)
 {
@@ -1748,17 +1740,6 @@ the previous command number shown."),
   add_cmd ("configuration", no_set_class, show_configuration,
 	   _("Show how GDB was configured at build time."), &showlist);
 
-  /* If target is open when baud changes, it doesn't take effect until
-     the next open (I think, not sure).  */
-  add_setshow_zinteger_cmd ("remotebaud", no_class, &baud_rate, _("\
-Set baud rate for remote serial I/O."), _("\
-Show baud rate for remote serial I/O."), _("\
-This value is used to set the speed of the serial port when debugging\n\
-using remote targets."),
-			    NULL,
-			    show_baud_rate,
-			    &setlist, &showlist);
-
   add_setshow_zinteger_cmd ("remote", no_class, &remote_debug, _("\
 Set debugging of remote protocol."), _("\
 Show debugging of remote protocol."), _("\
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 5141b3c..21b2a28 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-10  Joel Brobecker  <brobecker@adacore.com>
+
+	* gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
+	by "set serial baud" and "show serial baud" (resp) throughout.
+
 2013-10-07  Pedro Alves  <palves@redhat.com>
 
 	PR breakpoints/11568
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e196658..bda2e7b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18024,8 +18024,8 @@ target remote /dev/ttyb
 @end smallexample
 
 If you're using a serial line, you may want to give @value{GDBN} the
-@w{@samp{--baud}} option, or use the @code{set remotebaud} command
-(@pxref{Remote Configuration, set remotebaud}) before the
+@w{@samp{--baud}} option, or use the @code{set serial baud} command
+(@pxref{Remote Configuration, set serial baud}) before the
 @code{target} command.
 
 @item target remote @code{@var{host}:@var{port}}
@@ -18567,13 +18567,13 @@ default value is the number of bits in the target's address.
 @item show remoteaddresssize
 Show the current value of remote address size in bits.
 
-@item set remotebaud @var{n}
+@item set serial baud @var{n}
 @cindex baud rate for remote targets
 Set the baud rate for the remote serial I/O to @var{n} baud.  The
 value is used to set the speed of the serial port used for debugging
 remote targets.
 
-@item show remotebaud
+@item show serial baud
 Show the current speed of the remote connection.
 
 @item set remotebreak
diff --git a/gdb/serial.c b/gdb/serial.c
index ee3f1ea..f2a9648 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -621,6 +621,20 @@ serial_show_cmd (char *args, int from_tty)
   cmd_show_list (serial_show_cmdlist, from_tty, "");
 }
 
+/* Baud rate specified for talking to serial target systems.  Default
+   is left as -1, so targets can choose their own defaults.  */
+/* FIXME: This means that "show serial baud" and gr_files_info can
+   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
+
+int baud_rate = -1;
+
+static void
+serial_baud_show_cmd (struct ui_file *file, int from_tty,
+		      struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Baud rate for remote serial I/O is %s.\n"),
+		    value);
+}
 
 void
 _initialize_serial (void)
@@ -643,6 +657,45 @@ Show default serial/parallel port configuration."),
 		  0/*allow-unknown*/,
 		  &showlist);
 
+  /* If target is open when baud changes, it doesn't take effect until
+     the next open (I think, not sure).  */
+  add_setshow_zinteger_cmd ("baud", no_class, &baud_rate, _("\
+Set baud rate for remote serial I/O."), _("\
+Show baud rate for remote serial I/O."), _("\
+This value is used to set the speed of the serial port when debugging\n\
+using remote targets."),
+			    NULL,
+			    serial_baud_show_cmd,
+			    &serial_set_cmdlist, &serial_show_cmdlist);
+
+  /* The commands "set/show serial baud" used to have a different name.
+     Add aliases to those names to facilitate the transition, and mark
+     them as deprecated, in order to make users aware of the fact that
+     the command names have been changed.  */
+    {
+      const char *cmd_name;
+      struct cmd_list_element *cmd;
+
+      /* FIXME: There is a limitation in the deprecation mechanism,
+	 and the warning ends up not being displayed for prefixed
+	 aliases.  So use a real command instead of an alias.  */
+      add_setshow_zinteger_cmd ("remotebaud", class_alias, &baud_rate, _("\
+Set baud rate for remote serial I/O."), _("\
+Show baud rate for remote serial I/O."), _("\
+This value is used to set the speed of the serial port when debugging\n\
+using remote targets."),
+				NULL,
+				serial_baud_show_cmd,
+				&setlist, &showlist);
+      cmd_name = "remotebaud";
+      cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1);
+      deprecate_cmd (cmd, "set serial baud");
+      cmd_name
+	= "remotebaud"; /* needed because lookup_cmd updates the pointer */
+      cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1);
+      deprecate_cmd (cmd, "show serial baud");
+    }
+
   add_setshow_filename_cmd ("remotelogfile", no_class, &serial_logfile, _("\
 Set filename for remote session recording."), _("\
 Show filename for remote session recording."), _("\
diff --git a/gdb/top.c b/gdb/top.c
index d9128a3..c473d8c 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -144,13 +144,6 @@ int saved_command_line_size = 100;
    is issuing commands too.  */
 int server_command;
 
-/* Baud rate specified for talking to serial target systems.  Default
-   is left as -1, so targets can choose their own defaults.  */
-/* FIXME: This means that "show remotebaud" and gr_files_info can
-   print -1 or (unsigned int)-1.  This is a Bad User Interface.  */
-
-int baud_rate = -1;
-
 /* Timeout limit for response from target.  */
 
 /* The default value has been changed many times over the years.  It 
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-09 16:44                 ` Eli Zaretskii
@ 2013-10-10  5:59                   ` Joel Brobecker
  2013-10-10 16:06                     ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Joel Brobecker @ 2013-10-10  5:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: palves, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

> > gdb/doc/ChangeLog:
> > 
> >         * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
> >         by "set serial baud" and "show serial baud" (resp) throughout.
> 
> You didn't mention the node name in the log entry.

That was intentional, because it's a global search and replace.
It's allowed by the GCS, but if you still prefer I repeat the node
names, let me know, and I will dig them out.

> >  If you're using a serial line, you may want to give @value{GDBN} the
> > -@w{@samp{--baud}} option, or use the @code{set remotebaud} command
> > -(@pxref{Remote Configuration, set remotebaud}) before the
> > +@w{@samp{--baud}} option, or use the @code{set serial baud} command
> 
> Is @w really needed here?  You have only one word there anyway.
> 
> Otherwise, OK for the documentation parts.

Thanks! For @w, now that I know what it means :-), I agree it does
seem useless. But it was there before, so in the spirit of not
mixing independent changes in the same patch, here is a second one
that removes it.

gdb/doc/ChangeLog:

        * gdb.texinfo (Connecting): Remove unnecessary @w{}.

I will check it in as pre-approved/obvious.  Tested on x86_64-linux.

Thank you!
-- 
Joel

[-- Attachment #2: 0001-Remove-unnecessary-w-in-gdb.texinfo.patch --]
[-- Type: text/x-diff, Size: 881 bytes --]

From 03e74b48b0c1a50bae671083f1530b1fe155e709 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Thu, 10 Oct 2013 09:51:02 +0400
Subject: [PATCH] Remove unnecessary @w{} in gdb.texinfo

gdb/doc/ChangeLog:

        * gdb.texinfo (Connecting): Remove unnecessary @w{}.
---
 gdb/doc/gdb.texinfo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index bda2e7b..24773ea 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18024,7 +18024,7 @@ target remote /dev/ttyb
 @end smallexample
 
 If you're using a serial line, you may want to give @value{GDBN} the
-@w{@samp{--baud}} option, or use the @code{set serial baud} command
+@samp{--baud} option, or use the @code{set serial baud} command
 (@pxref{Remote Configuration, set serial baud}) before the
 @code{target} command.
 
-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-10  5:59                   ` Joel Brobecker
@ 2013-10-10 16:06                     ` Eli Zaretskii
  2013-10-11  4:51                       ` Joel Brobecker
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2013-10-10 16:06 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: palves, gdb-patches

> Date: Thu, 10 Oct 2013 09:59:28 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: palves@redhat.com, gdb-patches@sourceware.org
> 
> > > gdb/doc/ChangeLog:
> > > 
> > >         * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
> > >         by "set serial baud" and "show serial baud" (resp) throughout.
> > 
> > You didn't mention the node name in the log entry.
> 
> That was intentional, because it's a global search and replace.
> It's allowed by the GCS, but if you still prefer I repeat the node
> names, let me know, and I will dig them out.

Yes, I do prefer naming the nodes.  This makes it easier to search for
changes that modified a given node.

> > >  If you're using a serial line, you may want to give @value{GDBN} the
> > > -@w{@samp{--baud}} option, or use the @code{set remotebaud} command
> > > -(@pxref{Remote Configuration, set remotebaud}) before the
> > > +@w{@samp{--baud}} option, or use the @code{set serial baud} command
> > 
> > Is @w really needed here?  You have only one word there anyway.
> > 
> > Otherwise, OK for the documentation parts.
> 
> Thanks! For @w, now that I know what it means :-), I agree it does
> seem useless. But it was there before, so in the spirit of not
> mixing independent changes in the same patch, here is a second one
> that removes it.

Great, thanks.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-10 16:06                     ` Eli Zaretskii
@ 2013-10-11  4:51                       ` Joel Brobecker
  2013-10-11  7:02                         ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Joel Brobecker @ 2013-10-11  4:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

> Yes, I do prefer naming the nodes.  This makes it easier to search for
> changes that modified a given node.

OK, that's fair enough, especially for a change of this (small) size.
Here is the new ChangeLog entry I just checked in:

        * gdb.texinfo (Connecting): Replace "set remotebaud" by "set
        serial baud".
        (Remote Configuration): Replace "set remotebaud" by "set serial
        baud".  Replace "show remotebaud" by "show serial baud".

-- 
Joel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
  2013-10-11  4:51                       ` Joel Brobecker
@ 2013-10-11  7:02                         ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2013-10-11  7:02 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

> Date: Fri, 11 Oct 2013 08:51:55 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
> 
> Here is the new ChangeLog entry I just checked in:
> 
>         * gdb.texinfo (Connecting): Replace "set remotebaud" by "set
>         serial baud".
>         (Remote Configuration): Replace "set remotebaud" by "set serial
>         baud".  Replace "show remotebaud" by "show serial baud".

Thank you.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-10-11  7:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10 15:18 Setting parity for remote serial Yurij Grechishhev
2013-07-10 18:10 ` Tom Tromey
2013-10-04 14:12   ` Pedro Alves
2013-10-07 18:33     ` Yurij Grechishhev
2013-10-08  3:56       ` Joel Brobecker
2013-10-08 12:03         ` Pedro Alves
2013-10-08 14:16           ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
2013-10-08 14:34             ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
2013-10-08 15:00               ` Joel Brobecker
2013-10-08 15:12             ` Tom Tromey
2013-10-09 11:23               ` [RFA v2/code+DOCO+NEWS] " Joel Brobecker
2013-10-09 16:17                 ` Pedro Alves
2013-10-10  5:55                   ` checked in: " Joel Brobecker
2013-10-09 16:44                 ` Eli Zaretskii
2013-10-10  5:59                   ` Joel Brobecker
2013-10-10 16:06                     ` Eli Zaretskii
2013-10-11  4:51                       ` Joel Brobecker
2013-10-11  7:02                         ` Eli Zaretskii
2013-10-08 15:24             ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Eli Zaretskii
2013-10-09  2:05             ` Doug Evans
2013-10-09  3:57               ` Joel Brobecker
2013-10-09  8:31                 ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).