forked from Imagelibrary/binutils-gdb
Merge with armelf980813:
* rdi-share/unixcomm.c: If using cygwin32, also use the SERPORT and
PARPORT defines for win32.
(Unix_MatchValidSerialDevice): For cygwin32, valid serial port names
start with "com", not "/dev/tty".
(Unix_OpenSerial): Do not use O_NONBLOCK on cygwin32.
* rdi-share/devsw.c (DevSW_Close): Free the device's state (SwitcherState)
so that the device may be reopened.
* remote-rdi.c (mywritec): Send all output through gdb's *_unfiltered
functions, ignoring non-ASCII chars, so that non-tty UI's can snarf
the output from fputs_hook.
(mywrite): Ditto.
(arm_rdi_open): Set inferior_pid.
(arm_rdi_detach): Pop the target off the target stack so that
users can attach and detach multiple times.
(arm_rdi_close): Close the opened device and reset inferior_pid, too.
This commit is contained in:
@@ -88,11 +88,14 @@
|
||||
#define PARPORT2 "/dev/par1"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SERIAL_PREFIX "/dev/tty"
|
||||
#if defined(_WIN32) || defined (__CYGWIN32__)
|
||||
#define SERPORT1 "com1"
|
||||
#define SERPORT2 "com2"
|
||||
#define PARPORT1 "lpt1"
|
||||
#define PARPORT2 "lpt2"
|
||||
#undef SERIAL_PREFIX
|
||||
#define SERIAL_PREFIX "com"
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -121,7 +124,11 @@ extern const char *Unix_MatchValidSerialDevice(const char *name)
|
||||
*/
|
||||
|
||||
/* Accept /dev/tty* where * is limited */
|
||||
if (strlen(name) == strlen(SERPORT1) && strncmp(name, "/dev/tty", 8) == 0) return name;
|
||||
if (strlen(name) == strlen(SERPORT1)
|
||||
&& strncmp(name, SERIAL_PREFIX, strlen (SERIAL_PREFIX)) == 0)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/* Accept "1" or "2" or "S" - S is equivalent to "1" */
|
||||
if (strcmp(name, "1") == 0 ||
|
||||
@@ -224,7 +231,7 @@ extern int Unix_IsSerialInUse(void)
|
||||
|
||||
extern int Unix_OpenSerial(const char *name)
|
||||
{
|
||||
#if defined(BSD)
|
||||
#if defined(BSD) || defined(__CYGWIN32__)
|
||||
serpfd = open(name, O_RDWR);
|
||||
#else
|
||||
serpfd = open(name, O_RDWR | O_NONBLOCK);
|
||||
|
||||
Reference in New Issue
Block a user