* set/show remotestopbits
@ 2001-09-26 5:35 Mark Salter
0 siblings, 0 replies; 18+ messages in thread
From: Mark Salter @ 2001-09-26 5:35 UTC (permalink / raw)
To: gdb-patches
(Once more with ChangeLog)
I have a target board with a stub and a serial port that is fixed
at 2 stopbits, so I need a way to tell gdb to use something other
than the default 1.
--Mark
2001-09-26 Mark Salter <msalter@redhat.com>
* cli/cli-cmds.c: Add support for set/show remotestopbits.
* top.c: Add stop_bits declaration.
* target.h: Add extern declaration for stop_bits.
* remote.c: Set serial stopbits as necessary.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.62
diff -u -p -5 -r1.62 remote.c
--- remote.c 2001/08/10 09:59:32 1.62
+++ remote.c 2001/09/26 12:14:55
@@ -2159,10 +2159,13 @@ serial device is attached to the remote
serial_close (remote_desc);
perror_with_name (name);
}
}
+ if (stop_bits != -1)
+ serial_setstopbits (remote_desc, stop_bits);
+
serial_raw (remote_desc);
/* If there is something sitting in the buffer we might take it as a
response to a command, which would be bad. */
serial_flush_input (remote_desc);
@@ -2255,10 +2258,13 @@ serial device is attached to the remote
{
serial_close (remote_desc);
perror_with_name (name);
}
}
+
+ if (stop_bits != -1)
+ serial_setstopbits (remote_desc, stop_bits);
serial_raw (remote_desc);
/* If there is something sitting in the buffer we might take it as a
response to a command, which would be bad. */
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.20
diff -u -p -5 -r1.20 target.h
--- target.h 2001/08/11 00:59:29 1.20
+++ target.h 2001/09/26 12:14:57
@@ -1209,10 +1209,13 @@ extern void remove_target_sections (bfd
information (higher values, more information). */
extern int remote_debug;
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
+/* Number of stop bits (as defined in serial.h), or -1 which means don't
+ mess with the stopbits. */
+extern int stop_bits;
/* Timeout limit for response from target. */
extern int remote_timeout;
\f
/* Functions for helping to write a native target. */
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.45
diff -u -p -5 -r1.45 top.c
--- top.c 2001/09/07 21:33:08 1.45
+++ top.c 2001/09/26 12:14:57
@@ -133,10 +133,14 @@ int server_command;
/* 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;
+/* Stop bits for talking to serial target systems. Default
+ is left as -1, so targets can choose their own defaults. */
+int stop_bits = -1;
+
/* Timeout limit for response from target. */
/* The default value has been changed many times over the years. It
was originally 5 seconds. But that was thought to be a long time
to sit and wait, so it was changed to 2 seconds. That was thought
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.10
diff -u -p -5 -r1.10 cli-cmds.c
--- cli-cmds.c 2001/09/01 21:38:05 1.10
+++ cli-cmds.c 2001/09/26 12:14:57
@@ -22,10 +22,11 @@
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
#include "gdb_wait.h" /* For shell escape implementation */
#include "gdb_regex.h" /* Used by apropos_command */
#include "filenames.h" /* for DOSish file names */
+#include "serial.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
@@ -78,10 +79,12 @@ static void show_user (char *, int);
static void make_command (char *, int);
static void shell_escape (char *, int);
void apropos_command (char *, int);
+
+static void set_stopbits_command (char *, int);
\f
/* Define all cmd_list_elements. */
/* Chain containing all defined commands. */
@@ -160,10 +163,17 @@ struct cmd_list_element *setdebuglist;
struct cmd_list_element *showdebuglist;
struct cmd_list_element *setchecklist;
struct cmd_list_element *showchecklist;
+
+/* The "set remotestopbits" command put stuff in this buffer.
+ This is to make it work as set/show commands. The user's
+ string is copied here, then the set_* commands look at it
+ and update it to something that looks nice when it is
+ printed out. */
+static char *stop_bits_str;
\f
/* Utility used everywhere when at least one argument is needed and
none is supplied. */
void
@@ -554,10 +564,46 @@ apropos_command (char *searchstr, int fr
regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
error("Error in regular expression:%s",errorbuffer);
}
xfree (pattern_fastmap);
}
+
+/* Set command. Change the setting for type checking. */
+static void
+set_stopbits_command (char *ignore, int from_tty)
+{
+ if (STREQ (stop_bits_str, "1"))
+ stop_bits = SERIAL_1_STOPBITS;
+ else if (STREQ (stop_bits_str, "1.5"))
+ stop_bits = SERIAL_1_AND_A_HALF_STOPBITS;
+ else if (STREQ (stop_bits_str, "2"))
+ stop_bits = SERIAL_2_STOPBITS;
+ else if (STREQ (stop_bits_str, "default"))
+ stop_bits = -1;
+ else
+ {
+ warning ("Unrecognized stopbits value: \"%s\"", stop_bits_str);
+ /* change stop_bits_str to match previous value. */
+ xfree (stop_bits_str);
+ switch (stop_bits)
+ {
+ case SERIAL_1_STOPBITS:
+ stop_bits_str = xstrdup ("1");
+ break;
+ case SERIAL_1_AND_A_HALF_STOPBITS:
+ stop_bits_str = xstrdup ("1.5");
+ break;
+ case SERIAL_2_STOPBITS:
+ stop_bits_str = xstrdup ("2");
+ break;
+ default:
+ stop_bits = -1;
+ stop_bits_str = xstrdup ("default");
+ break;
+ }
+ }
+}
\f
static void
set_debug (char *arg, int from_tty)
{
printf_unfiltered ("\"set debug\" must be followed by the name of a print subcommand.\n");
@@ -734,10 +780,18 @@ is used, the same rules apply to its nes
var_zinteger, (char *) &baud_rate,
"Set baud rate for remote serial I/O.\n\
This value is used to set the speed of the serial port when debugging\n\
using remote targets.", &setlist),
&showlist);
+
+ c = add_set_cmd ("remotestopbits", no_class, var_string_noescape,
+ (char *) &stop_bits_str,
+ "Set number of stopbits for remote serial I/O.\n\
+Valid values are 1, 1.5, and 2.", &setlist);
+ c->function.cfunc = set_stopbits_command;
+ add_show_from_set (c, &showlist);
+ stop_bits_str = xstrdup ("default");
c = add_set_cmd ("remotedebug", no_class, var_zinteger,
(char *) &remote_debug,
"Set debugging of remote protocol.\n\
When enabled, each packet sent or received with the remote target\n\
^ permalink raw reply [flat|nested] 18+ messages in thread* set/show remotestopbits
@ 2001-09-26 5:27 Mark Salter
2001-09-26 7:35 ` Fernando Nasser
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Mark Salter @ 2001-09-26 5:27 UTC (permalink / raw)
To: gdb-patches
I have a target board with a stub and a serial port that is fixed
at 2 stopbits, so I need a way to tell gdb to use something other
than the default 1.
--Mark
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.62
diff -u -p -5 -r1.62 remote.c
--- remote.c 2001/08/10 09:59:32 1.62
+++ remote.c 2001/09/26 12:14:55
@@ -2159,10 +2159,13 @@ serial device is attached to the remote
serial_close (remote_desc);
perror_with_name (name);
}
}
+ if (stop_bits != -1)
+ serial_setstopbits (remote_desc, stop_bits);
+
serial_raw (remote_desc);
/* If there is something sitting in the buffer we might take it as a
response to a command, which would be bad. */
serial_flush_input (remote_desc);
@@ -2255,10 +2258,13 @@ serial device is attached to the remote
{
serial_close (remote_desc);
perror_with_name (name);
}
}
+
+ if (stop_bits != -1)
+ serial_setstopbits (remote_desc, stop_bits);
serial_raw (remote_desc);
/* If there is something sitting in the buffer we might take it as a
response to a command, which would be bad. */
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.20
diff -u -p -5 -r1.20 target.h
--- target.h 2001/08/11 00:59:29 1.20
+++ target.h 2001/09/26 12:14:57
@@ -1209,10 +1209,13 @@ extern void remove_target_sections (bfd
information (higher values, more information). */
extern int remote_debug;
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
+/* Number of stop bits (as defined in serial.h), or -1 which means don't
+ mess with the stopbits. */
+extern int stop_bits;
/* Timeout limit for response from target. */
extern int remote_timeout;
\f
/* Functions for helping to write a native target. */
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.45
diff -u -p -5 -r1.45 top.c
--- top.c 2001/09/07 21:33:08 1.45
+++ top.c 2001/09/26 12:14:57
@@ -133,10 +133,14 @@ int server_command;
/* 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;
+/* Stop bits for talking to serial target systems. Default
+ is left as -1, so targets can choose their own defaults. */
+int stop_bits = -1;
+
/* Timeout limit for response from target. */
/* The default value has been changed many times over the years. It
was originally 5 seconds. But that was thought to be a long time
to sit and wait, so it was changed to 2 seconds. That was thought
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.10
diff -u -p -5 -r1.10 cli-cmds.c
--- cli-cmds.c 2001/09/01 21:38:05 1.10
+++ cli-cmds.c 2001/09/26 12:14:57
@@ -22,10 +22,11 @@
#include "completer.h"
#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
#include "gdb_wait.h" /* For shell escape implementation */
#include "gdb_regex.h" /* Used by apropos_command */
#include "filenames.h" /* for DOSish file names */
+#include "serial.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
@@ -78,10 +79,12 @@ static void show_user (char *, int);
static void make_command (char *, int);
static void shell_escape (char *, int);
void apropos_command (char *, int);
+
+static void set_stopbits_command (char *, int);
\f
/* Define all cmd_list_elements. */
/* Chain containing all defined commands. */
@@ -160,10 +163,17 @@ struct cmd_list_element *setdebuglist;
struct cmd_list_element *showdebuglist;
struct cmd_list_element *setchecklist;
struct cmd_list_element *showchecklist;
+
+/* The "set remotestopbits" command put stuff in this buffer.
+ This is to make it work as set/show commands. The user's
+ string is copied here, then the set_* commands look at it
+ and update it to something that looks nice when it is
+ printed out. */
+static char *stop_bits_str;
\f
/* Utility used everywhere when at least one argument is needed and
none is supplied. */
void
@@ -554,10 +564,46 @@ apropos_command (char *searchstr, int fr
regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
error("Error in regular expression:%s",errorbuffer);
}
xfree (pattern_fastmap);
}
+
+/* Set command. Change the setting for type checking. */
+static void
+set_stopbits_command (char *ignore, int from_tty)
+{
+ if (STREQ (stop_bits_str, "1"))
+ stop_bits = SERIAL_1_STOPBITS;
+ else if (STREQ (stop_bits_str, "1.5"))
+ stop_bits = SERIAL_1_AND_A_HALF_STOPBITS;
+ else if (STREQ (stop_bits_str, "2"))
+ stop_bits = SERIAL_2_STOPBITS;
+ else if (STREQ (stop_bits_str, "default"))
+ stop_bits = -1;
+ else
+ {
+ warning ("Unrecognized stopbits value: \"%s\"", stop_bits_str);
+ /* change stop_bits_str to match previous value. */
+ xfree (stop_bits_str);
+ switch (stop_bits)
+ {
+ case SERIAL_1_STOPBITS:
+ stop_bits_str = xstrdup ("1");
+ break;
+ case SERIAL_1_AND_A_HALF_STOPBITS:
+ stop_bits_str = xstrdup ("1.5");
+ break;
+ case SERIAL_2_STOPBITS:
+ stop_bits_str = xstrdup ("2");
+ break;
+ default:
+ stop_bits = -1;
+ stop_bits_str = xstrdup ("default");
+ break;
+ }
+ }
+}
\f
static void
set_debug (char *arg, int from_tty)
{
printf_unfiltered ("\"set debug\" must be followed by the name of a print subcommand.\n");
@@ -734,10 +780,18 @@ is used, the same rules apply to its nes
var_zinteger, (char *) &baud_rate,
"Set baud rate for remote serial I/O.\n\
This value is used to set the speed of the serial port when debugging\n\
using remote targets.", &setlist),
&showlist);
+
+ c = add_set_cmd ("remotestopbits", no_class, var_string_noescape,
+ (char *) &stop_bits_str,
+ "Set number of stopbits for remote serial I/O.\n\
+Valid values are 1, 1.5, and 2.", &setlist);
+ c->function.cfunc = set_stopbits_command;
+ add_show_from_set (c, &showlist);
+ stop_bits_str = xstrdup ("default");
c = add_set_cmd ("remotedebug", no_class, var_zinteger,
(char *) &remote_debug,
"Set debugging of remote protocol.\n\
When enabled, each packet sent or received with the remote target\n\
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: set/show remotestopbits
2001-09-26 5:27 Mark Salter
@ 2001-09-26 7:35 ` Fernando Nasser
2001-09-26 7:42 ` Eli Zaretskii
2001-09-26 11:17 ` Andrew Cagney
2 siblings, 0 replies; 18+ messages in thread
From: Fernando Nasser @ 2001-09-26 7:35 UTC (permalink / raw)
To: Mark Salter; +Cc: gdb-patches
Mark Salter wrote:
>
> I have a target board with a stub and a serial port that is fixed
> at 2 stopbits, so I need a way to tell gdb to use something other
> than the default 1.
>
> --Mark
>
Oh yes! This is a good one. However, I believe you've used the
deprecated way. The commands to set remote protocol things are
now all grouped together:
set remote XXXXXX VVVVVVV
So, it should be
set remote stopbits 2
for instance.
(P.S.: It is not under my maintainership so I cannot approve it
myself, but I recommend it -- after the syntax update)
Regards,
Fernando
> Index: remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote.c,v
> retrieving revision 1.62
> diff -u -p -5 -r1.62 remote.c
> --- remote.c 2001/08/10 09:59:32 1.62
> +++ remote.c 2001/09/26 12:14:55
> @@ -2159,10 +2159,13 @@ serial device is attached to the remote
> serial_close (remote_desc);
> perror_with_name (name);
> }
> }
>
> + if (stop_bits != -1)
> + serial_setstopbits (remote_desc, stop_bits);
> +
> serial_raw (remote_desc);
>
> /* If there is something sitting in the buffer we might take it as a
> response to a command, which would be bad. */
> serial_flush_input (remote_desc);
> @@ -2255,10 +2258,13 @@ serial device is attached to the remote
> {
> serial_close (remote_desc);
> perror_with_name (name);
> }
> }
> +
> + if (stop_bits != -1)
> + serial_setstopbits (remote_desc, stop_bits);
>
> serial_raw (remote_desc);
>
> /* If there is something sitting in the buffer we might take it as a
> response to a command, which would be bad. */
> Index: target.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/target.h,v
> retrieving revision 1.20
> diff -u -p -5 -r1.20 target.h
> --- target.h 2001/08/11 00:59:29 1.20
> +++ target.h 2001/09/26 12:14:57
> @@ -1209,10 +1209,13 @@ extern void remove_target_sections (bfd
> information (higher values, more information). */
> extern int remote_debug;
>
> /* Speed in bits per second, or -1 which means don't mess with the speed. */
> extern int baud_rate;
> +/* Number of stop bits (as defined in serial.h), or -1 which means don't
> + mess with the stopbits. */
> +extern int stop_bits;
> /* Timeout limit for response from target. */
> extern int remote_timeout;
>
>
> /* Functions for helping to write a native target. */
> Index: top.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/top.c,v
> retrieving revision 1.45
> diff -u -p -5 -r1.45 top.c
> --- top.c 2001/09/07 21:33:08 1.45
> +++ top.c 2001/09/26 12:14:57
> @@ -133,10 +133,14 @@ int server_command;
> /* 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;
>
> +/* Stop bits for talking to serial target systems. Default
> + is left as -1, so targets can choose their own defaults. */
> +int stop_bits = -1;
> +
> /* Timeout limit for response from target. */
>
> /* The default value has been changed many times over the years. It
> was originally 5 seconds. But that was thought to be a long time
> to sit and wait, so it was changed to 2 seconds. That was thought
> Index: cli/cli-cmds.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
> retrieving revision 1.10
> diff -u -p -5 -r1.10 cli-cmds.c
> --- cli-cmds.c 2001/09/01 21:38:05 1.10
> +++ cli-cmds.c 2001/09/26 12:14:57
> @@ -22,10 +22,11 @@
> #include "completer.h"
> #include "target.h" /* For baud_rate, remote_debug and remote_timeout */
> #include "gdb_wait.h" /* For shell escape implementation */
> #include "gdb_regex.h" /* Used by apropos_command */
> #include "filenames.h" /* for DOSish file names */
> +#include "serial.h"
>
> #ifdef UI_OUT
> #include "ui-out.h"
> #endif
>
> @@ -78,10 +79,12 @@ static void show_user (char *, int);
> static void make_command (char *, int);
>
> static void shell_escape (char *, int);
>
> void apropos_command (char *, int);
> +
> +static void set_stopbits_command (char *, int);
>
> /* Define all cmd_list_elements. */
>
> /* Chain containing all defined commands. */
>
> @@ -160,10 +163,17 @@ struct cmd_list_element *setdebuglist;
> struct cmd_list_element *showdebuglist;
>
> struct cmd_list_element *setchecklist;
>
> struct cmd_list_element *showchecklist;
> +
> +/* The "set remotestopbits" command put stuff in this buffer.
> + This is to make it work as set/show commands. The user's
> + string is copied here, then the set_* commands look at it
> + and update it to something that looks nice when it is
> + printed out. */
> +static char *stop_bits_str;
>
> /* Utility used everywhere when at least one argument is needed and
> none is supplied. */
>
> void
> @@ -554,10 +564,46 @@ apropos_command (char *searchstr, int fr
> regerror(regcomp(&pattern,searchstr,REG_ICASE),NULL,errorbuffer,512);
> error("Error in regular expression:%s",errorbuffer);
> }
> xfree (pattern_fastmap);
> }
> +
> +/* Set command. Change the setting for type checking. */
> +static void
> +set_stopbits_command (char *ignore, int from_tty)
> +{
> + if (STREQ (stop_bits_str, "1"))
> + stop_bits = SERIAL_1_STOPBITS;
> + else if (STREQ (stop_bits_str, "1.5"))
> + stop_bits = SERIAL_1_AND_A_HALF_STOPBITS;
> + else if (STREQ (stop_bits_str, "2"))
> + stop_bits = SERIAL_2_STOPBITS;
> + else if (STREQ (stop_bits_str, "default"))
> + stop_bits = -1;
> + else
> + {
> + warning ("Unrecognized stopbits value: \"%s\"", stop_bits_str);
> + /* change stop_bits_str to match previous value. */
> + xfree (stop_bits_str);
> + switch (stop_bits)
> + {
> + case SERIAL_1_STOPBITS:
> + stop_bits_str = xstrdup ("1");
> + break;
> + case SERIAL_1_AND_A_HALF_STOPBITS:
> + stop_bits_str = xstrdup ("1.5");
> + break;
> + case SERIAL_2_STOPBITS:
> + stop_bits_str = xstrdup ("2");
> + break;
> + default:
> + stop_bits = -1;
> + stop_bits_str = xstrdup ("default");
> + break;
> + }
> + }
> +}
>
> static void
> set_debug (char *arg, int from_tty)
> {
> printf_unfiltered ("\"set debug\" must be followed by the name of a print subcommand.\n");
> @@ -734,10 +780,18 @@ is used, the same rules apply to its nes
> var_zinteger, (char *) &baud_rate,
> "Set baud rate for remote serial I/O.\n\
> This value is used to set the speed of the serial port when debugging\n\
> using remote targets.", &setlist),
> &showlist);
> +
> + c = add_set_cmd ("remotestopbits", no_class, var_string_noescape,
> + (char *) &stop_bits_str,
> + "Set number of stopbits for remote serial I/O.\n\
> +Valid values are 1, 1.5, and 2.", &setlist);
> + c->function.cfunc = set_stopbits_command;
> + add_show_from_set (c, &showlist);
> + stop_bits_str = xstrdup ("default");
>
> c = add_set_cmd ("remotedebug", no_class, var_zinteger,
> (char *) &remote_debug,
> "Set debugging of remote protocol.\n\
> When enabled, each packet sent or received with the remote target\n\
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: set/show remotestopbits
2001-09-26 5:27 Mark Salter
2001-09-26 7:35 ` Fernando Nasser
@ 2001-09-26 7:42 ` Eli Zaretskii
2001-09-26 8:02 ` Mark Salter
2001-09-26 11:17 ` Andrew Cagney
2 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2001-09-26 7:42 UTC (permalink / raw)
To: msalter; +Cc: gdb-patches
> Date: Wed, 26 Sep 2001 08:27:45 -0400
> From: Mark Salter <msalter@redhat.com>
>
> I have a target board with a stub and a serial port that is fixed
> at 2 stopbits, so I need a way to tell gdb to use something other
> than the default 1.
Unless I'm missing something, this command will not auto-complete on
possible values. More accurately, it will use the default completion
function, which tries to complete on symbols. Is it possible to add
support for completion?
In any case, please also send something for gdb.texinfo to document
the new command.
TIA
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 7:42 ` Eli Zaretskii
@ 2001-09-26 8:02 ` Mark Salter
2001-09-26 10:02 ` Andrew Cagney
2001-09-26 11:01 ` Eli Zaretskii
0 siblings, 2 replies; 18+ messages in thread
From: Mark Salter @ 2001-09-26 8:02 UTC (permalink / raw)
To: eliz; +Cc: gdb-patches
>>>>> Eli Zaretskii writes:
>> Date: Wed, 26 Sep 2001 08:27:45 -0400
>> From: Mark Salter <msalter@redhat.com>
>>
>> I have a target board with a stub and a serial port that is fixed
>> at 2 stopbits, so I need a way to tell gdb to use something other
>> than the default 1.
> Unless I'm missing something, this command will not auto-complete on
> possible values. More accurately, it will use the default completion
> function, which tries to complete on symbols. Is it possible to add
> support for completion?
I'm going to take up Fernando's suggestion for the syntax. I'll look
at completion then.
> In any case, please also send something for gdb.texinfo to document
> the new command.
Most (if not all) of the "set/show remote foo" commands seem to be
undocumented in the manual. Seemed like standard practice...
--Mark
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 8:02 ` Mark Salter
@ 2001-09-26 10:02 ` Andrew Cagney
2001-09-26 10:20 ` Mark Salter
2001-09-26 10:42 ` Michael Snyder
2001-09-26 11:01 ` Eli Zaretskii
1 sibling, 2 replies; 18+ messages in thread
From: Andrew Cagney @ 2001-09-26 10:02 UTC (permalink / raw)
To: Mark Salter; +Cc: eliz, gdb-patches
>>>>>> Eli Zaretskii writes:
>
>
>>> Date: Wed, 26 Sep 2001 08:27:45 -0400
>>> From: Mark Salter <msalter@redhat.com>
>>>
>>> I have a target board with a stub and a serial port that is fixed
>>> at 2 stopbits, so I need a way to tell gdb to use something other
>>> than the default 1.
>
>
>> Unless I'm missing something, this command will not auto-complete on
>> possible values. More accurately, it will use the default completion
>> function, which tries to complete on symbols. Is it possible to add
>> support for completion?
>
>
> I'm going to take up Fernando's suggestion for the syntax. I'll look
> at completion then.
>
>
>> In any case, please also send something for gdb.texinfo to document
>> the new command.
Mark, can you old off a second - I don't what to have what happened to
Don, happening again :-) I'm not sure but the command might belong
somewhere else entirely - where does the commands setting baud rate live
for instance?
With regard to completion, yes Eli is correct, I noticed the same thing.
At present you need to use add_enum_cmd(). However, I should warn
you, add_enum_cmd() has one of the most obscure programmer interfaces
I've ever seen.
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 10:02 ` Andrew Cagney
@ 2001-09-26 10:20 ` Mark Salter
2001-09-26 11:09 ` Andrew Cagney
2001-09-26 10:42 ` Michael Snyder
1 sibling, 1 reply; 18+ messages in thread
From: Mark Salter @ 2001-09-26 10:20 UTC (permalink / raw)
To: ac131313; +Cc: eliz, gdb-patches
>>>>> Andrew Cagney writes:
> Mark, can you old off a second - I don't what to have what happened to
> Don, happening again :-) I'm not sure but the command might belong
> somewhere else entirely - where does the commands setting baud rate live
> for instance?
I don't know what happened to Don, but I trust I don't want it to happen
to me.
I put it in cli-cmds.c because that is where set/show remotebaud lives.
> With regard to completion, yes Eli is correct, I noticed the same thing.
> At present you need to use add_enum_cmd(). However, I should warn
> you, add_enum_cmd() has one of the most obscure programmer interfaces
> I've ever seen.
It has no completion because I looked at "set language" as an example of
how to do a command which takes a set of strings. Apparantly it also
suffers from the completion problem.
--Mark
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 10:20 ` Mark Salter
@ 2001-09-26 11:09 ` Andrew Cagney
2001-09-26 11:34 ` Mark Salter
2001-09-26 12:50 ` Fernando Nasser
0 siblings, 2 replies; 18+ messages in thread
From: Andrew Cagney @ 2001-09-26 11:09 UTC (permalink / raw)
To: Mark Salter; +Cc: eliz, gdb-patches
>
> I don't know what happened to Don, but I trust I don't want it to happen
> to me.
Everyone, including me, pulled Don in different directions leading him
to implement the same patch N times :-(
> I put it in cli-cmds.c because that is where set/show remotebaud lives.
I was thinking more of where the command lived within the CLI and its
semantics. As to where to put the code well ...
Ok, cli/cli-cmds.c contains:
> /* If target is open when baud changes, it doesn't take effect until the
> next open (I think, not sure). */
> add_show_from_set (add_set_cmd ("remotebaud", no_class,
> var_zinteger, (char *) &baud_rate,
> "Set baud rate for remote serial I/O.\n\
> This value is used to set the speed of the serial port when debugging\n\
> using remote targets.", &setlist),
> &showlist);
so it only takes effect when the port is opened - lets call this a
feature :-) Things like monitor.c and remote.c then check/set the
baud_rate after doing the serial open.
The convention has been for commands that affect the serial/parallel
port to be called ``set/show remoteXXXX'' eg:
set/show remotebaud
set/show remotelogfile
set/show remotelogbase
so
set/show remotestopbits
certainly follows this convention.
We've also recently gained the convention for:
set/show remote XXXX
to be used for things that relate to the remote targets (using the
remote protocol).
My first thought is that, the ``serial'' (well serial / parallel / ...)
commands should be under:
set/show serial XXXXXX
and
set debug serial
rather than ``set/show remote XXXX'' since they are not specific to the
remote protocol.
Thoughts? I'm pretty easy to convince otherwise.
If there is agreement on this, I can churn out the framework needed so
that you, Mark, can just drop in ``set serial stopbits''.
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: set/show remotestopbits
2001-09-26 11:09 ` Andrew Cagney
@ 2001-09-26 11:34 ` Mark Salter
2001-09-26 12:50 ` Fernando Nasser
1 sibling, 0 replies; 18+ messages in thread
From: Mark Salter @ 2001-09-26 11:34 UTC (permalink / raw)
To: ac131313; +Cc: gdb-patches
>>>>> Andrew Cagney writes:
>>
>> I don't know what happened to Don, but I trust I don't want it to happen
>> to me.
> Everyone, including me, pulled Don in different directions leading him
> to implement the same patch N times :-(
Ok. Well I didn;t expect to have the patch excepted on the first try. I
have a perfect record of having to rework things...
> My first thought is that, the ``serial'' (well serial / parallel / ...)
> commands should be under:
> set/show serial XXXXXX
> and
> set debug serial
> rather than ``set/show remote XXXX'' since they are not specific to the
> remote protocol.
> Thoughts? I'm pretty easy to convince otherwise.
I have no opinion on the matter. I just want something that lets me talk
to the target. I had been using a gdb with hard-coded 2 stop bits just so
I could get on with my work. I decided to be helpful and write a more
useful patch because Corinna has more pressing matters to deal with in
the project. If you add a "set serial" framework (or decide otherwise),
I'll be happy to rework the patch as needed.
--Mark
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 11:09 ` Andrew Cagney
2001-09-26 11:34 ` Mark Salter
@ 2001-09-26 12:50 ` Fernando Nasser
2001-09-26 13:12 ` Andrew Cagney
1 sibling, 1 reply; 18+ messages in thread
From: Fernando Nasser @ 2001-09-26 12:50 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Mark Salter, eliz, gdb-patches
Sorry Mark, I did not know of the "convention" below. I haven't seen
it documented anywhere before this message.
Anyway, I agree with Andrew's argument that some parameters are
not necessarily tied to the remote protocol. With that argument in mind,
the remoteXXXX's cause a little confusion ("remote target" vs. "remote
target that uses the remote protocol" -- "remote" seems to be overloaded).
Serial and parallel sound nice. What if we have some things that can
apply to any "remote" (non-native) target and is not specific to the
communication link. (I am trying to think of an example -- the name of
a log file, perhaps? Can you think of some other one?).
Fernando
Andrew Cagney wrote:
>
> The convention has been for commands that affect the serial/parallel
> port to be called ``set/show remoteXXXX'' eg:
>
> set/show remotebaud
> set/show remotelogfile
> set/show remotelogbase
>
> so
> set/show remotestopbits
>
> certainly follows this convention.
>
> We've also recently gained the convention for:
>
> set/show remote XXXX
>
> to be used for things that relate to the remote targets (using the
> remote protocol).
>
> My first thought is that, the ``serial'' (well serial / parallel / ...)
> commands should be under:
>
> set/show serial XXXXXX
> and
> set debug serial
>
> rather than ``set/show remote XXXX'' since they are not specific to the
> remote protocol.
>
> Thoughts? I'm pretty easy to convince otherwise.
>
> If there is agreement on this, I can churn out the framework needed so
> that you, Mark, can just drop in ``set serial stopbits''.
>
> Andrew
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: set/show remotestopbits
2001-09-26 12:50 ` Fernando Nasser
@ 2001-09-26 13:12 ` Andrew Cagney
2001-09-26 13:18 ` Fernando Nasser
0 siblings, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2001-09-26 13:12 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Mark Salter, eliz, gdb-patches
> Anyway, I agree with Andrew's argument that some parameters are
> not necessarily tied to the remote protocol. With that argument in mind,
> the remoteXXXX's cause a little confusion ("remote target" vs. "remote
> target that uses the remote protocol" -- "remote" seems to be
overloaded).
>
> Serial and parallel sound nice. What if we have some things that can
> apply to any "remote" (non-native) target and is not specific to the
> communication link. (I am trying to think of an example -- the name of
> a log file, perhaps? Can you think of some other one?).
Perhaphs ``set remote ..'' should have been ``set target remote ...'' or
``set protocol remote ...'' or ``set remote-protocol ...''. (But
remote-protocol is also poorly defined).
Anyway, the entire syntax will need to be reviewed again soon. At
present GDB assumes a single active target with a single interface.
While it doesn't need to be solved now, we do need to start thinking
about multiple targets with multiple interfaces and how to specify them.
for instance, how to show the serial settings for interface foo.
I'll add the framework for ``set serial ''' and PR the need to deprecate
``set remotebaud''.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: set/show remotestopbits
2001-09-26 13:12 ` Andrew Cagney
@ 2001-09-26 13:18 ` Fernando Nasser
0 siblings, 0 replies; 18+ messages in thread
From: Fernando Nasser @ 2001-09-26 13:18 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Mark Salter, eliz, gdb-patches
Andrew Cagney wrote:
>
> > Anyway, I agree with Andrew's argument that some parameters are
> > not necessarily tied to the remote protocol. With that argument in mind,
> > the remoteXXXX's cause a little confusion ("remote target" vs. "remote
> > target that uses the remote protocol" -- "remote" seems to be
> overloaded).
> >
> > Serial and parallel sound nice. What if we have some things that can
> > apply to any "remote" (non-native) target and is not specific to the
> > communication link. (I am trying to think of an example -- the name of
> > a log file, perhaps? Can you think of some other one?).
>
> Perhaphs ``set remote ..'' should have been ``set target remote ...'' or
> ``set protocol remote ...'' or ``set remote-protocol ...''. (But
> remote-protocol is also poorly defined).
>
> Anyway, the entire syntax will need to be reviewed again soon. At
> present GDB assumes a single active target with a single interface.
> While it doesn't need to be solved now, we do need to start thinking
> about multiple targets with multiple interfaces and how to specify them.
> for instance, how to show the serial settings for interface foo.
>
> I'll add the framework for ``set serial ''' and PR the need to deprecate
> ``set remotebaud''.
>
Great.
We will wait for you to do the "kick-off" for the syntax change debate.
Regards,
Fernando
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 10:02 ` Andrew Cagney
2001-09-26 10:20 ` Mark Salter
@ 2001-09-26 10:42 ` Michael Snyder
1 sibling, 0 replies; 18+ messages in thread
From: Michael Snyder @ 2001-09-26 10:42 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney wrote:
> [W]here does the commands setting baud rate live
> for instance?
cli/cli-cmds.c/set remotebaud
Probably not what you were hoping to hear. ;-(
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 8:02 ` Mark Salter
2001-09-26 10:02 ` Andrew Cagney
@ 2001-09-26 11:01 ` Eli Zaretskii
2001-09-26 11:12 ` Andrew Cagney
2001-09-26 11:23 ` Mark Salter
1 sibling, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2001-09-26 11:01 UTC (permalink / raw)
To: msalter; +Cc: gdb-patches
> Date: Wed, 26 Sep 2001 11:02:03 -0400
> From: Mark Salter <msalter@redhat.com>
>
> I'm going to take up Fernando's suggestion for the syntax. I'll look
> at completion then.
Thanks!
> > In any case, please also send something for gdb.texinfo to document
> > the new command.
>
> Most (if not all) of the "set/show remote foo" commands seem to be
> undocumented in the manual.
I've just checked in a quite old snapshot, and found 64 set commands,
half of which was documented in the manual. I wouldn't call that
"most", let alone "all".
In any case, the fact that there's a number of undocumented commands
does not mean we should add to that number.
> Seemed like standard practice...
Not since I became responsible for the manual maintenance.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 11:01 ` Eli Zaretskii
@ 2001-09-26 11:12 ` Andrew Cagney
2001-09-26 15:45 ` Stan Shebs
2001-09-26 11:23 ` Mark Salter
1 sibling, 1 reply; 18+ messages in thread
From: Andrew Cagney @ 2001-09-26 11:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: msalter, gdb-patches
>
> Thanks!
>
>
>> > In any case, please also send something for gdb.texinfo to document
>> > the new command.
>
>>
>> Most (if not all) of the "set/show remote foo" commands seem to be
>> undocumented in the manual.
>
>
> I've just checked in a quite old snapshot, and found 64 set commands,
> half of which was documented in the manual. I wouldn't call that
> "most", let alone "all".
>
> In any case, the fact that there's a number of undocumented commands
> does not mean we should add to that number.
Stan Shebs kept threatening to delete any undocumented commands ....
>> Seemed like standard practice...
Was.
>
> Not since I became responsible for the manual maintenance.
and appreciated.
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 11:12 ` Andrew Cagney
@ 2001-09-26 15:45 ` Stan Shebs
0 siblings, 0 replies; 18+ messages in thread
From: Stan Shebs @ 2001-09-26 15:45 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Eli Zaretskii, msalter, gdb-patches
Andrew Cagney wrote:
>
> > In any case, the fact that there's a number of undocumented commands
> > does not mean we should add to that number.
>
> Stan Shebs kept threatening to delete any undocumented commands ....
On a less hostile note :-), once upon a time Jason Molenda had a
script to compare the manual and the sources, and point out
discrepancies. Unfortunately, it never got formalized enough to
put in, but such a thing would certainly make it simple to keep
track of documentation bogosities.
Stan
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 11:01 ` Eli Zaretskii
2001-09-26 11:12 ` Andrew Cagney
@ 2001-09-26 11:23 ` Mark Salter
1 sibling, 0 replies; 18+ messages in thread
From: Mark Salter @ 2001-09-26 11:23 UTC (permalink / raw)
To: eliz; +Cc: gdb-patches
>>>>> Eli Zaretskii writes:
>> Date: Wed, 26 Sep 2001 11:02:03 -0400
>> From: Mark Salter <msalter@redhat.com>
>>
>> I'm going to take up Fernando's suggestion for the syntax. I'll look
>> at completion then.
> Thanks!
>> > In any case, please also send something for gdb.texinfo to document
>> > the new command.
>>
>> Most (if not all) of the "set/show remote foo" commands seem to be
>> undocumented in the manual.
> I've just checked in a quite old snapshot, and found 64 set commands,
> half of which was documented in the manual. I wouldn't call that
> "most", let alone "all".
I wasn't referring to general set/show commands. Just "set/show remote*"
and "set/show remote *". I count 26 of those. None documented in the
manual that I can find.
> In any case, the fact that there's a number of undocumented commands
> does not mean we should add to that number.
Fair enough.
--Mark
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: set/show remotestopbits
2001-09-26 5:27 Mark Salter
2001-09-26 7:35 ` Fernando Nasser
2001-09-26 7:42 ` Eli Zaretskii
@ 2001-09-26 11:17 ` Andrew Cagney
2 siblings, 0 replies; 18+ messages in thread
From: Andrew Cagney @ 2001-09-26 11:17 UTC (permalink / raw)
To: Mark Salter; +Cc: gdb-patches
> I have a target board with a stub and a serial port that is fixed
> at 2 stopbits, so I need a way to tell gdb to use something other
> than the default 1.
Just FYI, the bulk of the patch is ok. Just need to figure out where it
should live and have <tab> expansion working.
One aside, the macro STREQ() is deprecated. The sequence ``strcmp() ==
0'' being used instead.
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2001-09-26 15:45 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-26 5:35 set/show remotestopbits Mark Salter
-- strict thread matches above, loose matches on Subject: below --
2001-09-26 5:27 Mark Salter
2001-09-26 7:35 ` Fernando Nasser
2001-09-26 7:42 ` Eli Zaretskii
2001-09-26 8:02 ` Mark Salter
2001-09-26 10:02 ` Andrew Cagney
2001-09-26 10:20 ` Mark Salter
2001-09-26 11:09 ` Andrew Cagney
2001-09-26 11:34 ` Mark Salter
2001-09-26 12:50 ` Fernando Nasser
2001-09-26 13:12 ` Andrew Cagney
2001-09-26 13:18 ` Fernando Nasser
2001-09-26 10:42 ` Michael Snyder
2001-09-26 11:01 ` Eli Zaretskii
2001-09-26 11:12 ` Andrew Cagney
2001-09-26 15:45 ` Stan Shebs
2001-09-26 11:23 ` Mark Salter
2001-09-26 11:17 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox