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]
Other format: [Raw text]

Re: Problem with COM1 port with GDB 5.3 under Cygwin 1.5.*


I hope CC-ing gdb@sources.redhat.com is the correct thing to do for these posts.

I have inserted comments.

Eli Zaretskii wrote:

Date: Tue, 23 Sep 2003 13:07:32 -0600
From: Creighton MacDonnell <creighton@macdonnell.ca>

This patch avoids the Cygwin 1.5.* problem with "com*" port names, while still allowing "com*" names to be used in GDB scripts (they get translated to "/dev/com?"), and also allows "/dev/ttyS*" and "/dev/com*" device names to be used.


If Cygwin wants /dev/com1 instead of com1, are you sure it won't want
/dev/lpt1 instead of lpt1 as well?

Under either Cygwin 1.3.* or Cygwin 1.5.*:

$ ls -l /dev/lpt1
ls: /dev/lpt1: No such file or directory
$ ls -l /dev/lpt2
ls: /dev/lpt2: No such file or directory
$ ls -l lpt1
----------    0 ???????? ????????        0 Dec 31  1969 lpt1
$ ls -l lpt2
----------    1 ???????? ????????        0 Dec 31  1969 lpt2

So it would have to be "lpt1" and "lpt2" if anything.

The Cygwin user guide seems to say that you should be able to use the standard DOS device names from Cygwin scripts.

I doubt frankly that the parallel port would work under the current 1.5.* version or the former 1.3.* version.

I left this as it was, since there was no obvious alternative.

Anyway, is this a Cygwin bug or what?  IIRC, Windows supports both
com1 and /dev/com1, so why doesn't Cygwin do that as well?

The Cygwin user guide says very clearly it should (no explicit mention of "lpt?" though), and under 1.3.* it did.

Under Cygwin 1.3.*:

$ ls -l /dev/com1
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:18 /dev/com1
$ ls -l /dev/com2
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:18 /dev/com2
$ ls -l com1
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:18 com1
$ ls -l com2
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:19 com2
$ ls -l /dev/ttyS0
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:19 /dev/ttyS0
$ ls -l /dev/ttyS1
crw-rw-rw-    1 0        0          7,   0 Sep 24 10:19 /dev/ttyS1

Under Cygwin 1.5.*:

$ ls -l /dev/com1
crw-rw-rw-    1 default  None       7,   0 Sep 24 10:21 /dev/com1
$ ls -l /dev/com2
crw-rw-rw-    1 default  None       7,   0 Sep 24 10:21 /dev/com2
$ ls -l com1
----------    0 ???????? ????????        0 Dec 31  1969 com1
$ ls -l com2
----------    0 ???????? ????????        0 Dec 31  1969 com2
$ ls -l /dev/ttyS0
crw-rw-rw-    1 default  None       7,   0 Sep 24 10:21 /dev/ttyS0
$ ls -l /dev/ttyS1
crw-rw-rw-    1 default  None       7,   0 Sep 24 10:21 /dev/ttyS1

This probably is a bug in Cygwin 1.5.*. But I would also like to be able to use "/dev/ttyS*" names for devices, for comptatibilty with Linux, which I also use. And this can only be achieved by changing GDB Also, I am already experienced compiling GDB (and the GNU cross development tools) in order to get tools that do exactly what I want. I have little interest in becoming a Cygwin internals guru.

Also, my sense (admittedly as a Cygwin outsider) is that the "/dev/*" names are likley to be better supported in future Cygwin releases. Perhaps it would be best for GDB to avoid the DOS device names, when there is an alternative.

Also, what happens with versions of Cygwin other than 1.5.x?  Could
they be broken by this change?

GDB 5.3 with my patch, compiled under Cygwin 1.3.*, will run without being recompiled under 1.5.* too.

Beyond that, I don't know. Is anyone on this list using older versions of Cygwin with "target rdi"?



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