Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate
@ 2001-05-11 12:17 Fernando Nasser
  2001-05-11 17:38 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Fernando Nasser @ 2001-05-11 12:17 UTC (permalink / raw)
  To: gdb-patches

Does anyone care about these targets?

This patch adds a check to handle the case where the user specified an
invalid baud rate.

Do I check this in?


ChangeLog

	* remote-e7000.c (e7000_open): Check for bad baud rate.
	* remote-st.c (st2000_open): Ditto.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9
Index: remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.20
diff -c -p -r1.20 remote-e7000.c
*** remote-e7000.c	2001/05/04 04:15:26	1.20
--- remote-e7000.c	2001/05/11 19:11:06
*************** e7000_open (char *args, int from_tty)
*** 667,673 ****
    if (!e7000_desc)
      perror_with_name (dev_name);
  
!   SERIAL_SETBAUDRATE (e7000_desc, baudrate);
    SERIAL_RAW (e7000_desc);
  
  #ifdef GDB_TARGET_IS_H8300
--- 667,677 ----
    if (!e7000_desc)
      perror_with_name (dev_name);
  
!   if (SERIAL_SETBAUDRATE (e7000_desc, baudrate))
!     {
!       SERIAL_CLOSE (dev_name);
!       perror_with_name (dev_name);
!     }
    SERIAL_RAW (e7000_desc);
  
  #ifdef GDB_TARGET_IS_H8300
Index: remote-st.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-st.c,v
retrieving revision 1.12
diff -c -p -r1.12 remote-st.c
*** remote-st.c	2001/05/04 04:15:26	1.12
--- remote-st.c	2001/05/11 19:11:06
*************** or target st2000 <host> <port>\n");
*** 285,291 ****
    if (!st2000_desc)
      perror_with_name (dev_name);
  
!   SERIAL_SETBAUDRATE (st2000_desc, baudrate);
  
    SERIAL_RAW (st2000_desc);
  
--- 285,295 ----
    if (!st2000_desc)
      perror_with_name (dev_name);
  
!   if (SERIAL_SETBAUDRATE (st2000_desc, baudrate))
!     {
!       SERIAL_CLOSE (dev_name);
!       perror_with_name (dev_name);
!     }
  
    SERIAL_RAW (st2000_desc);
  
From fnasser@redhat.com Fri May 11 12:30:00 2001
From: Fernando Nasser <fnasser@redhat.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: Michael Snyder <msnyder@cygnus.com>, Jim Blandy <jimb@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA] breakpoint.c: Pass breakpoint type to set_raw_breakpoint()
Date: Fri, 11 May 2001 12:30:00 -0000
Message-id: <3AFC3D3C.C237D12F@redhat.com>
References: <1010511075057.ZM27226@ocotillo.lan> <3AFC073A.CADCE636@redhat.com> <1010511190413.ZM28698@ocotillo.lan>
X-SW-Source: 2001-05/msg00237.html
Content-length: 2150

Excelent!  The comment is now very accurate and clear.

Fernando

Kevin Buettner wrote:
> 
> On May 11, 11:37am, Fernando Nasser wrote:
> 
> > I agree with your solution.  Actually, one day, in the lost past, this
> > function did have more arguments.  Look at the comments for
> > set_raw_breakpoint():
> >
> > /* Low level routine to set a breakpoint.
> >    Takes as args the three things that every breakpoint must have.
> >
> > BTW, when you check in you can change the comment as well to reflect the
> > current version.
> 
> Fernando,
> 
> Thanks for calling my attention to the set_raw_breakpoint() comment.
> I have rewritten it from:
> 
> /* Low level routine to set a breakpoint.
>    Takes as args the three things that every breakpoint must have.
>    Returns the breakpoint object so caller can set other things.
>    Does not set the breakpoint number!
>    Does not print anything.
> 
>    ==> This routine should not be called if there is a chance of later
>    error(); otherwise it leaves a bogus breakpoint on the chain.  Validate
>    your arguments BEFORE calling this routine!  */
> 
> To:
> 
> /* set_raw_breakpoint() is a low level routine for allocating and
>    partially initializing a breakpoint of type BPTYPE.  The newly
>    created breakpoint's address, section, source file name, and line
>    number are provided by SAL.  The newly created and partially
>    initialized breakpoint is added to the breakpoint chain and
>    is also returned as the value of this function.
> 
>    It is expected that the caller will complete the initialization of
>    the newly created breakpoint struct as well as output any status
>    information regarding the creation of a new breakpoint.  In
>    particular, set_raw_breakpoint() does NOT set the breakpoint
>    number!  Care should be taken to not allow an error() to occur
>    prior to completing the initializtion of the breakpoint.  If this
>    should happen, a bogus breakpoint will be left on the chain.  */
> 
> Kevin

-- 
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] 4+ messages in thread

* Re: RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate
  2001-05-11 12:17 RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate Fernando Nasser
@ 2001-05-11 17:38 ` Andrew Cagney
  2001-05-11 18:34   ` Fernando Nasser
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2001-05-11 17:38 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: gdb-patches

> ChangeLog
> 
> 	* remote-e7000.c (e7000_open): Check for bad baud rate.
> 	* remote-st.c (st2000_open): Ditto.


This change is pretty straight forward, er, obvious.  All you're doing 
is tweeking files to match the current interface.

	Andrew



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

* Re: RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate
  2001-05-11 17:38 ` Andrew Cagney
@ 2001-05-11 18:34   ` Fernando Nasser
  2001-05-12 14:18     ` Fernando Nasser
  0 siblings, 1 reply; 4+ messages in thread
From: Fernando Nasser @ 2001-05-11 18:34 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney wrote:
> 
> > ChangeLog
> >
> >       * remote-e7000.c (e7000_open): Check for bad baud rate.
> >       * remote-st.c (st2000_open): Ditto.
> 
> This change is pretty straight forward, er, obvious.  All you're doing
> is tweeking files to match the current interface.
> 

OK, thanks.  I will check them in.


-- 
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] 4+ messages in thread

* Re: RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate
  2001-05-11 18:34   ` Fernando Nasser
@ 2001-05-12 14:18     ` Fernando Nasser
  0 siblings, 0 replies; 4+ messages in thread
From: Fernando Nasser @ 2001-05-12 14:18 UTC (permalink / raw)
  To: Andrew Cagney, gdb-patches

Fernando Nasser wrote:
> 
> Andrew Cagney wrote:
> >
> > > ChangeLog
> > >
> > >       * remote-e7000.c (e7000_open): Check for bad baud rate.
> > >       * remote-st.c (st2000_open): Ditto.
> >
> > This change is pretty straight forward, er, obvious.  All you're doing
> > is tweeking files to match the current interface.
> >
> 
> OK, thanks.  I will check them in.
> 
Done.

-- 
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] 4+ messages in thread

end of thread, other threads:[~2001-05-12 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-11 12:17 RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate Fernando Nasser
2001-05-11 17:38 ` Andrew Cagney
2001-05-11 18:34   ` Fernando Nasser
2001-05-12 14:18     ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox