mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
use remote-utils facilities for baud_rate
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
Tue Sep 14 12:21:49 1993 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||
|
||||
* remote.c, remote-nindy.c, remote-mon.c, remote-es.c: include
|
||||
remote-utils.h.
|
||||
|
||||
* remote.c (remote_open), remote-nindy.c (nindy_open,
|
||||
nindy_files_info), remote-mon.c (general_open), remote-es.c
|
||||
(es1800_open): use remote-utils facilities for baud rate.
|
||||
|
||||
Tue Sep 14 09:12:17 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
|
||||
|
||||
* paread.c, coffread.c, elfread.c: Include <time.h> before libbfd.h.
|
||||
|
@ -106,6 +106,7 @@ STP
|
||||
#include "wait.h"
|
||||
#include "terminal.h"
|
||||
#include "command.h"
|
||||
#include "remote-utils.h"
|
||||
|
||||
#ifdef USG
|
||||
#include <sys/types.h>
|
||||
@ -364,7 +365,7 @@ es1800_open (name, from_tty)
|
||||
char buf[PBUFSIZ];
|
||||
char *p;
|
||||
int i, fcflag;
|
||||
char *baudrate;
|
||||
char baudrate[1024];
|
||||
|
||||
m68020 = 0;
|
||||
|
||||
@ -372,7 +373,7 @@ es1800_open (name, from_tty)
|
||||
{
|
||||
error_no_arg ("serial port device name");
|
||||
}
|
||||
baudrate = baud_rate ? baud_rate : "19200"; /* default baudrate = 19200 */
|
||||
sprintf(baudrate, "%d", sr_get_baud_rate());
|
||||
|
||||
target_preopen (from_tty);
|
||||
es1800_close (0);
|
||||
|
@ -49,6 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "command.h"
|
||||
#include "serial.h"
|
||||
#include "monitor.h"
|
||||
#include "remote-utils.h"
|
||||
|
||||
#ifdef HAVE_TERMIO
|
||||
# define TERMINAL struct termios
|
||||
@ -337,17 +338,11 @@ general_open(args, name, from_tty)
|
||||
perror_with_name(dev_name);
|
||||
|
||||
/* The baud rate was specified when GDB was started. */
|
||||
if (baud_rate)
|
||||
{
|
||||
int rate;
|
||||
|
||||
if (sscanf (baud_rate, "%d", &rate) == 1)
|
||||
if (SERIAL_SETBAUDRATE (monitor_desc, rate))
|
||||
if (SERIAL_SETBAUDRATE (monitor_desc, sr_get_baud_rate()))
|
||||
{
|
||||
SERIAL_CLOSE (monitor_desc);
|
||||
perror_with_name (name);
|
||||
}
|
||||
}
|
||||
|
||||
SERIAL_RAW(monitor_desc);
|
||||
|
||||
|
@ -117,6 +117,7 @@ NINDY ROM monitor at the other end of the line.
|
||||
#include "nindy-share/stop.h"
|
||||
|
||||
#include "dcache.h"
|
||||
#include "remote-utils.h"
|
||||
|
||||
static DCACHE *nindy_dcache;
|
||||
|
||||
@ -179,6 +180,7 @@ nindy_open (name, from_tty)
|
||||
char *name; /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
|
||||
int from_tty;
|
||||
{
|
||||
char baudrate[1024];
|
||||
|
||||
if (!name)
|
||||
error_no_arg ("serial port device name");
|
||||
@ -193,7 +195,8 @@ nindy_open (name, from_tty)
|
||||
/* Allow user to interrupt the following -- we could hang if there's
|
||||
no NINDY at the other end of the remote tty. */
|
||||
immediate_quit++;
|
||||
ninConnect(name, baud_rate ? baud_rate : "9600",
|
||||
sprintf(baudrate, "%d", sr_get_baud_rate());
|
||||
ninConnect(name, baudrate,
|
||||
nindy_initial_brk, !from_tty, nindy_old_protocol);
|
||||
immediate_quit--;
|
||||
|
||||
@ -222,8 +225,8 @@ nindy_detach (name, from_tty)
|
||||
static void
|
||||
nindy_files_info ()
|
||||
{
|
||||
printf("\tAttached to %s at %s bps%s%s.\n", savename,
|
||||
baud_rate? baud_rate: "9600",
|
||||
printf("\tAttached to %s at %d bps%s%s.\n", savename,
|
||||
sr_get_baud_rate(),
|
||||
nindy_old_protocol? " in old protocol": "",
|
||||
nindy_initial_brk? " with initial break": "");
|
||||
}
|
||||
|
12
gdb/remote.c
12
gdb/remote.c
@ -133,6 +133,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "gdb-stabs.h"
|
||||
|
||||
#include "dcache.h"
|
||||
#include "remote-utils.h"
|
||||
|
||||
#if !defined(DONT_USE_REMOTE)
|
||||
#ifdef USG
|
||||
@ -297,20 +298,11 @@ device is attached to the remote system (e.g. /dev/ttya).");
|
||||
if (!remote_desc)
|
||||
perror_with_name (name);
|
||||
|
||||
#if 0
|
||||
/* FIXME: This should be using remote-utils.c. */
|
||||
if (baud_rate)
|
||||
{
|
||||
int rate;
|
||||
|
||||
if (sscanf (baud_rate, "%d", &rate) == 1)
|
||||
if (SERIAL_SETBAUDRATE (remote_desc, rate))
|
||||
if (SERIAL_SETBAUDRATE (remote_desc, sr_get_baud_rate()))
|
||||
{
|
||||
SERIAL_CLOSE (remote_desc);
|
||||
perror_with_name (name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SERIAL_RAW (remote_desc);
|
||||
|
||||
|
Reference in New Issue
Block a user