This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RFA: [remote-e7000.c and remote-st.c] Check for bad baud rate


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);
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]