Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: [ser-unix.c] Fix handling of baud rates
Date: Thu, 26 Apr 2001 07:17:00 -0000	[thread overview]
Message-ID: <3AE82D73.78A375DE@redhat.com> (raw)
In-Reply-To: <2110-Thu26Apr2001102549+0300-eliz@is.elta.co.il>

Eli Zaretskii wrote:
> 
> > Date: Wed, 25 Apr 2001 18:37:25 -0400
> > From: Fernando Nasser <fnasser@redhat.com>
> >
> > The following patch will cause GDB to use only legal values for the
> > serial line speed.  If the speed requested is not one of the valid
> > speeds, the best speed that is less than the value requested will be
> > used.  However, if the requested speed is less than 50, 50 bauds will be
> > used.
> 
> I'd say it is better to print an error message than silently use the
> wrong baudrate.  What if the user simply mistyped the value?

I don't really mind, I just want to get rid of the core dump.

The problem with the error message is that:
1) there is nothing very nice to set the errno to (suggestions?)
2) it comes too late; the user set this value either in the command 
   line or through a "set baudrate" and it was accepted.  I cannot add
   a test in there because I don't know what the target will be.

To solve the criptic error message, I could add a warning() to the
rate_to_mode() function, so that would preceed the error message (with
the best possible errno):
  "Illegal baud rate %d."

But as we are adding a warning(), why not just say:
  "Illegal baud rate %d; using %d instead."
and gracefully fall back?


Just let me know of the preferences.  This bug is in 5.0, GNUPro and
everywhere and I just want to get rid of the user's complaints.


P.S.: ARM RDI does fall back on the speed if the board (with the Angel
monitor) cannot speak at the speed requested by the user.  The only
indication is in the welcome string returned by the board, which has the
Angel version, copyright and the speed being used (Insight users don't
see that this happened yet).





-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


  reply	other threads:[~2001-04-26  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-25 15:39 Fernando Nasser
2001-04-26  0:29 ` Eli Zaretskii
2001-04-26  7:17   ` Fernando Nasser [this message]
     [not found]     ` <1659-Thu26Apr2001173526+0300-eliz@is.elta.co.il>
2001-04-26  7:47       ` Fernando Nasser
2001-04-26  9:44         ` Eli Zaretskii
2001-05-10 12:08 ` RFA: [ser-unix.c] Fix handling of baud rates [REPOST] Fernando Nasser
2001-05-11  1:17   ` Eli Zaretskii
2001-05-11 11:31   ` Fernando Nasser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AE82D73.78A375DE@redhat.com \
    --to=fnasser@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox