public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
@ 2003-09-23 19:07 Creighton MacDonnell
  2003-09-24  5:24 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-23 19:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: gdb

I earlier posted to the gdb@sources.redhat.com list about a problem 
using the serial port on Cygwin 1.5.3 when using RDI (i.e. ARM Angel 
Debug Protocol) with GDB 5.3.

Using "com1" would hang, and GDB had never allowed names like 
"/dev/ttyS0", which Cygwin was supposed to support.

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.


--- ./gdb/rdi-share/unixcomm.c~    2002-06-08 14:34:41.000000000 -0600
+++ ./gdb/rdi-share/unixcomm.c    2003-09-23 12:12:43.703125000 -0600
@@ -96,7 +96,15 @@
 #define PARPORT2   "/dev/par1"
 #endif
 
-#if defined(_WIN32) || defined (__CYGWIN__)
+#if defined (__CYGWIN__)
+#define SERIAL_PREFIX "/dev/com"
+#define SERPORT1   "/dev/com1"
+#define SERPORT2   "/dev/com2"
+#define PARPORT1   "lpt1"
+#define PARPORT2   "lpt2"
+#endif
+
+#if defined(_WIN32)
 #define SERIAL_PREFIX "com"
 #define SERPORT1   "com1"
 #define SERPORT2   "com2"
@@ -154,6 +162,32 @@
   }
   if (strcmp(name, "2") == 0) return SERPORT2;
 
+  #if defined (__CYGWIN__)
+
+  /* allow Linux "/dev/ttyS*" names too */
+  if (strncmp(name, "/dev/ttyS", 9) == 0) return name;
+
+  /* allow Windows "com*" names too */
+  {
+    static const char *const real_name[] = {
+        SERIAL_PREFIX "0",
+        SERIAL_PREFIX "1",
+        SERIAL_PREFIX "2",
+        SERIAL_PREFIX "3",
+        SERIAL_PREFIX "4",
+        SERIAL_PREFIX "5",
+        SERIAL_PREFIX "6",
+        SERIAL_PREFIX "7",
+        SERIAL_PREFIX "8",
+        SERIAL_PREFIX "9",
+        };
+    if (strlen(name) == 4 && strncmp(name, "com", 3) == 0 &&
+        '0' <= name[3] && name[3] <= '9')
+      return real_name[name[3] - '0'];
+  }
+
+  #endif
+
   /* It wasn't one of the simple cases, so now we have to parse it
    * properly
    */

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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
  2003-09-23 19:07 Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1 Creighton MacDonnell
@ 2003-09-24  5:24 ` Eli Zaretskii
  2003-09-24 18:09   ` Problem with COM1 port with GDB 5.3 under Cygwin 1.5.* Creighton MacDonnell
  2003-09-24 18:12   ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
  0 siblings, 2 replies; 16+ messages in thread
From: Eli Zaretskii @ 2003-09-24  5:24 UTC (permalink / raw)
  To: Creighton MacDonnell; +Cc: gdb-patches, gdb

> 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.
> 
> 
> --- ./gdb/rdi-share/unixcomm.c~    2002-06-08 14:34:41.000000000 -0600
> +++ ./gdb/rdi-share/unixcomm.c    2003-09-23 12:12:43.703125000 -0600
> @@ -96,7 +96,15 @@
>  #define PARPORT2   "/dev/par1"
>  #endif
>  
> -#if defined(_WIN32) || defined (__CYGWIN__)
> +#if defined (__CYGWIN__)
> +#define SERIAL_PREFIX "/dev/com"
> +#define SERPORT1   "/dev/com1"
> +#define SERPORT2   "/dev/com2"
> +#define PARPORT1   "lpt1"
> +#define PARPORT2   "lpt2"
> +#endif

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

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?

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

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

* Re: Problem with COM1 port with GDB 5.3 under Cygwin 1.5.*
  2003-09-24  5:24 ` Eli Zaretskii
@ 2003-09-24 18:09   ` Creighton MacDonnell
  2003-09-24 18:12     ` Eli Zaretskii
  2003-09-24 18:12   ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
  1 sibling, 1 reply; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-24 18:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: gdb

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"?


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

* Re: Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1
  2003-09-24  5:24 ` Eli Zaretskii
  2003-09-24 18:09   ` Problem with COM1 port with GDB 5.3 under Cygwin 1.5.* Creighton MacDonnell
@ 2003-09-24 18:12   ` Christopher Faylor
  1 sibling, 0 replies; 16+ messages in thread
From: Christopher Faylor @ 2003-09-24 18:12 UTC (permalink / raw)
  To: gdb-patches, gdb

On Wed, Sep 24, 2003 at 08:25:18AM +0200, Eli Zaretskii wrote:
>If Cygwin wants /dev/com1 instead of com1, are you sure it won't want
>/dev/lpt1 instead of lpt1 as well?

Not yet.  Eventually.

>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?

Because cygwin now has the ability to create files called "com1",
just like UNIX.  The string "com1" does get passed on to the OS
but, as a guess, it looks like cygwin isn't doing anything special
with the name and doesn't recognize it as anything more than a file.

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

This change should work fine with older versions.  I don't think I
have the authority to approve it, though.

cgf

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

* Re: Problem with COM1 port with GDB 5.3 under Cygwin 1.5.*
  2003-09-24 18:09   ` Problem with COM1 port with GDB 5.3 under Cygwin 1.5.* Creighton MacDonnell
@ 2003-09-24 18:12     ` Eli Zaretskii
  2003-09-24 20:03       ` Problem with COM1 port with GDB 5.3 under cygwin 1.5.* Christopher Faylor
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2003-09-24 18:12 UTC (permalink / raw)
  To: Creighton MacDonnell; +Cc: gdb-patches, gdb

> Date: Wed, 24 Sep 2003 10:34:48 -0600
> From: Creighton MacDonnell <creighton@macdonnell.ca>
> 
> >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.

Then I don't have any objections to this patch.  However, the Cygwin
port is not my responsibility in GDB maintenance, so you will have to
wait for Chris Faylor to approve this.

Thanks.

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

* Re: Problem with COM1 port with GDB 5.3 under cygwin 1.5.*
  2003-09-24 18:12     ` Eli Zaretskii
@ 2003-09-24 20:03       ` Christopher Faylor
  2003-09-25  4:46         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Christopher Faylor @ 2003-09-24 20:03 UTC (permalink / raw)
  To: gdb-patches, gdb

On Wed, Sep 24, 2003 at 08:14:06PM +0200, Eli Zaretskii wrote:
>> Date: Wed, 24 Sep 2003 10:34:48 -0600
>> From: Creighton MacDonnell <creighton@macdonnell.ca>
>> 
>> >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.
>
>Then I don't have any objections to this patch.  However, the Cygwin
>port is not my responsibility in GDB maintenance, so you will have to
>wait for Chris Faylor to approve this.

I already responded that I don't believe I have the authority to
approve changes to this file.

cgf

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

* Re: Problem with COM1 port with GDB 5.3 under cygwin 1.5.*
  2003-09-24 20:03       ` Problem with COM1 port with GDB 5.3 under cygwin 1.5.* Christopher Faylor
@ 2003-09-25  4:46         ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2003-09-25  4:46 UTC (permalink / raw)
  To: Christopher Faylor; +Cc: gdb-patches, gdb

> Date: Wed, 24 Sep 2003 16:02:57 -0400
> From: Christopher Faylor <cgf@redhat.com>
> 
> I already responded that I don't believe I have the authority to
> approve changes to this file.

Sorry, I didn't see your mail when I wrote mine.

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

* Re: Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1
  2003-09-10 20:05         ` Creighton MacDonnell
@ 2003-09-10 21:58           ` Christopher Faylor
  0 siblings, 0 replies; 16+ messages in thread
From: Christopher Faylor @ 2003-09-10 21:58 UTC (permalink / raw)
  To: gdb

On Wed, Sep 10, 2003 at 02:05:39PM -0600, Creighton MacDonnell wrote:
>Christopher Faylor wrote:
>>I wouldn't be speculating on what other people should be doing.  I'd be
>>debugging the problem myself.
>
>That was my point..  We the GDB users will have to do some work.  Not
>just ask on the Cygwin list.
>
>But I don't have time right now.  I did take a look at the code.  And I
>do not think that this will be less work than responding to E-mails.

I respectfully disagree.

cgf

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

* Re: Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1
  2003-09-10 18:56       ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
@ 2003-09-10 20:05         ` Creighton MacDonnell
  2003-09-10 21:58           ` Christopher Faylor
  0 siblings, 1 reply; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-10 20:05 UTC (permalink / raw)
  To: gdb

Christopher Faylor wrote:

>I wouldn't be
>speculating on what other people should be doing.  I'd be debugging the
>problem myself.
>
That was my point.. We the GDB users will have to do some work. Not just 
ask on the Cygwin list.

But I don't have time right now. I did take a look at the code. And I do 
not think that this will be less work than responding to E-mails.

I have a working Cygwin installation, and the downloaded files to allow 
it to be reinstalled. So this is not a crisis for me.

If anyone else needs these files to reconstruct a usable Cygwin system. 
let me know.

>  In the time it takes to send email, you could be
>doing someting like
>
>cd gdb
>ls *serial*
>
>and investigating the code there, setting breakpoints, etc.
>
>cgf
>  
>

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

* Re: Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1
  2003-09-10 16:48     ` Creighton MacDonnell
  2003-09-10 18:55       ` Thomas Doerfler
@ 2003-09-10 18:56       ` Christopher Faylor
  2003-09-10 20:05         ` Creighton MacDonnell
  1 sibling, 1 reply; 16+ messages in thread
From: Christopher Faylor @ 2003-09-10 18:56 UTC (permalink / raw)
  To: gdb

On Wed, Sep 10, 2003 at 10:48:49AM -0600, Creighton MacDonnell wrote:
>If I were a Cygwin maintainer, and knew that GDB did not allow names 
>such as "/dev/ttyS0" under the old Cygwin, I might react that GDB should 
>be made "Cygwin-compatible" first. And after that, if there are still 
>problems with the "com?" names, they may want debug information that 
>could only be obtained by putting debug code into GDB.

It's lucky that you're not a cygwin maintainer.  "Cygwin compatibility"
is supposed to be "UNIX compatibility".  That's why cygwin exists.

I don't have two systems set up for testing serial ports right now.
However, if I was a person having this problem, I wouldn't be
speculating on what other people should be doing.  I'd be debugging the
problem myself.  In the time it takes to send email, you could be
doing someting like

cd gdb
ls *serial*

and investigating the code there, setting breakpoints, etc.

cgf

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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
  2003-09-10 16:48     ` Creighton MacDonnell
@ 2003-09-10 18:55       ` Thomas Doerfler
  2003-09-10 18:56       ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
  1 sibling, 0 replies; 16+ messages in thread
From: Thomas Doerfler @ 2003-09-10 18:55 UTC (permalink / raw)
  To: Creighton MacDonnell; +Cc: Thomas Doerfler, gdb

Hello Craighton,

I have tested around a bit, I executed my cross-gdb under a 
native gdb to step through the serial code. For convenience, I 
executed the cross-gdb without its nice and colored "insight" 
GUI (using the "-nw" switch on the cross-gdb command line). 
After half an hour of debugging, I got the message back, that 
the serial connection to my target is up and running... (We 
call this a Heisenbug, you can't find it, when you look at 
it...)

When I start my cross-gdb directly from command line and also 
disable the Insight GUI (-nw once again), I also get the 
serial connection up (!!!). Another funny detail: When I 
terminate my gdb session, I don't get any more echos on my 
console...

So, here are the facts that spin in my mind:

1. With Insight GUI enabled: When I try to use a serial port 
in GDB, that is used by another application, I get a slightly 
different error message than in the case when I try to open an 
unused port.

2. Without Insight GUI: I can properly open a (unused) serial 
port and communicate with my target. But afterwards, the 
settings of stdin/stdout of gdb are set to wrong options (echo 
off...)

So my current theory: gdb can open serial devices under 
cygwin, but maybe when it tries to apply the line settings 
(echo, special characters etc) it sets these features TO THE 
WRONG DESCRIPTOR, to stdin/out instead of the serial device. 
This works more or less as long as stdin/out is a tty type 
device, but it fails, if it is redirected to the "insight" 
console window. In the later case, the ominous "is not a 
typewriter" message get thrown, or a "Permission denied"...

I will try to verify that.

wkr,
	Thomas.

> 
> As I mentioned in my first posting,  the code in GDB for accessing 
> serial ports seems quite complicated. It does not just attempt to open 
> whatever you specifiy for a device name. There is code that builds up 
> some sort of "list of devices".
> 
> I expect this is to assist portability. But iin this case I think it is 
> doing the opposite. When I tried to use "/dev/ttyS0" as a device name 
> under the old Cygwin, GDB would say it "could not open the device". But 
> I think what may actually be happening is that "/dev/ttyS0" did not make 
> it into the list of devices.
> 
> I fear that GDB may be attempting to get a list of interfaces, or 
> information about interfaces, using some sort of lower level system 
> calls which Cygwin just stubs out. This might not only cause GDB to not 
> realize the device name is actually OK, but may cause it to attempt to 
> open COM? with inapproriate options.
> 
> If I were a Cygwin maintainer, and knew that GDB did not allow names 
> such as "/dev/ttyS0" under the old Cygwin, I might react that GDB should 
> be made "Cygwin-compatible" first. And after that, if there are still 
> problems with the "com?" names, they may want debug information that 
> could only be obtained by putting debug code into GDB.
> 
> In the end, it is we GDB under Cygwin users that have the problem. It 
> does not appear that many other Cygwin users care much about the serial 
> port.
> 
> Thomas Doerfler wrote:
> 
> >Hello,
> >
> >I just have passed some similar tests. I have connected a 
> >Win32 terminal program to one COM port, and was trying to send 
> >data to the other port using cygwin, with a loopback (null-
> >modem) cable attached.
> >
> >I could 
> >
> >$ echo bla >/dev/ttyS1
> >
> >and even
> >
> >$ echo bla >COM2
> >
> >
> >and got the result on the serial line (and into my terminal 
> >screen)
> >
> >So at least sendig data from cygwin works fine.
> >
> >Currently I don't know how to come around this. The problem 
> >seems to be more connected to cygwin, because we see this with 
> >at least two different gdb versions...
> >
> >wkr,
> >	Thomas.
> >
> 

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler@imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm

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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
  2003-09-10 15:18   ` Thomas Doerfler
@ 2003-09-10 16:48     ` Creighton MacDonnell
  2003-09-10 18:55       ` Thomas Doerfler
  2003-09-10 18:56       ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
  0 siblings, 2 replies; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-10 16:48 UTC (permalink / raw)
  To: gdb; +Cc: Thomas Doerfler


As I mentioned in my first posting,  the code in GDB for accessing 
serial ports seems quite complicated. It does not just attempt to open 
whatever you specifiy for a device name. There is code that builds up 
some sort of "list of devices".

I expect this is to assist portability. But iin this case I think it is 
doing the opposite. When I tried to use "/dev/ttyS0" as a device name 
under the old Cygwin, GDB would say it "could not open the device". But 
I think what may actually be happening is that "/dev/ttyS0" did not make 
it into the list of devices.

I fear that GDB may be attempting to get a list of interfaces, or 
information about interfaces, using some sort of lower level system 
calls which Cygwin just stubs out. This might not only cause GDB to not 
realize the device name is actually OK, but may cause it to attempt to 
open COM? with inapproriate options.

If I were a Cygwin maintainer, and knew that GDB did not allow names 
such as "/dev/ttyS0" under the old Cygwin, I might react that GDB should 
be made "Cygwin-compatible" first. And after that, if there are still 
problems with the "com?" names, they may want debug information that 
could only be obtained by putting debug code into GDB.

In the end, it is we GDB under Cygwin users that have the problem. It 
does not appear that many other Cygwin users care much about the serial 
port.

Thomas Doerfler wrote:

>Hello,
>
>I just have passed some similar tests. I have connected a 
>Win32 terminal program to one COM port, and was trying to send 
>data to the other port using cygwin, with a loopback (null-
>modem) cable attached.
>
>I could 
>
>$ echo bla >/dev/ttyS1
>
>and even
>
>$ echo bla >COM2
>
>
>and got the result on the serial line (and into my terminal 
>screen)
>
>So at least sendig data from cygwin works fine.
>
>Currently I don't know how to come around this. The problem 
>seems to be more connected to cygwin, because we see this with 
>at least two different gdb versions...
>
>wkr,
>	Thomas.
>


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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
  2003-09-10 14:55 ` Creighton MacDonnell
@ 2003-09-10 15:18   ` Thomas Doerfler
  2003-09-10 16:48     ` Creighton MacDonnell
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Doerfler @ 2003-09-10 15:18 UTC (permalink / raw)
  To: Creighton MacDonnell; +Cc: gdb

Hello,

I just have passed some similar tests. I have connected a 
Win32 terminal program to one COM port, and was trying to send 
data to the other port using cygwin, with a loopback (null-
modem) cable attached.

I could 

$ echo bla >/dev/ttyS1

and even

$ echo bla >COM2


and got the result on the serial line (and into my terminal 
screen)

So at least sendig data from cygwin works fine.

Currently I don't know how to come around this. The problem 
seems to be more connected to cygwin, because we see this with 
at least two different gdb versions...

wkr,
	Thomas.

> 
> Thanks for responding.
> 
> The obvious thing to do (I think) would be to run a program under Cygwin 
> 1.5.3 to exercise the serial ports using the "com?", "/dev.com?" and 
> "/dev/ttyS?" names first to see that they actually work under Cygwin. 
> But I cannot find any Cygwin package that uses the serial port in the 
> set of standard Cygwin packages that "setup" knows about. Nor have I 
> found one anywhere else. I could not get mincom to compile under Cygwin, 
> even after several hacks at the code.
> 
> I tried just using "cat com1" and "echo ??? > com1" to communicate with 
> my board as a test, but the results are erratic even under the old Cygwin.
> 
> When I have time, I plan to learn how to right some very simple code to 
> use the serial port, and run it on both of my serial ports.. In my 
> posting to the Cygwin list I asked if anyone had some code like this. 
> But I got no response. If anyone on this list can offer some simple code 
> for this, please do.
> 
> I do notice that under the old Cygwin I get this:
> 
> $ ls -l com1
> crw-rw-rw-    1 0        0          7,   0 Sep 10 08:33 com1
> 
> But under the new Cygwin I get this:
> 
> $ ls -l com1
> ----------    0 ???????? ????????        0 Dec 31  1969 com1
> 
> I did get one response on the Cygwin list that "com1" no longer works. 
> We are supposed to use "/dev/com1". I do not know how knowledgable this 
> person was. The Cygwin user guide says "com1" should work. But it also 
> says that "/dev/com1" and "/dev/ttyS0" should work.
> 
> One notable difference on Cygwin is that "ls /dev" or "ls /dev/*" 
> produce nothing. There is no actual "/dev" directory. The user guide 
> says that you just go ahead and open the device name.
> 
> An the thing is though, I was never able to get GDB to use "/dev/ttyS0" 
> even under the old Cygwin. This is a nuisance because I also use Linux, 
> and there I have GDB scripts that use "/dev/ttyS0".
> 
> I am pusuing this on this list because the previous fact suggests that 
> GDB might benefit from some Cygwin specific code in this area and 
> because I felt I was more likely to find someone else affected by this 
> problem on this list. Also, the Cygwin list is swamped right now with 
> other problems related to the 1.5.3 upgrade.
> 
> Again let me say to anyone with knowledge of the GDB code concerning 
> serial ports, I have a test environment and I am willing to try any 
> hacks or patches you may provide. But I do not have time right now to 
> comb over the serial port GDB code and try to understand it.
> 
> Thomas Doerfler wrote:
> 
> >Hello,
> >
> >I have read your posting to the gdb mailing list. Some days 
> >now I have a similar problem with a M68K-GDB5.2 working with 
> >the serial remote protocol under cygwin 1.5.3.
> >
> >My gdb complains, that COM1 is "not a typewriter", and it will 
> >open the alternative deivces "/dev/ttyS0" only in vary rare 
> >occasions.
> >
> >I will try to downgrade my cygwin installation and try 
> >again...
> >wkr,
> >	Thomas.
> >  
> >

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler@imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm

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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
  2003-09-10 11:54 Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1 Thomas Doerfler
@ 2003-09-10 14:55 ` Creighton MacDonnell
  2003-09-10 15:18   ` Thomas Doerfler
  0 siblings, 1 reply; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-10 14:55 UTC (permalink / raw)
  To: gdb; +Cc: Thomas Doerfler


Thanks for responding.

The obvious thing to do (I think) would be to run a program under Cygwin 
1.5.3 to exercise the serial ports using the "com?", "/dev.com?" and 
"/dev/ttyS?" names first to see that they actually work under Cygwin. 
But I cannot find any Cygwin package that uses the serial port in the 
set of standard Cygwin packages that "setup" knows about. Nor have I 
found one anywhere else. I could not get mincom to compile under Cygwin, 
even after several hacks at the code.

I tried just using "cat com1" and "echo ??? > com1" to communicate with 
my board as a test, but the results are erratic even under the old Cygwin.

When I have time, I plan to learn how to right some very simple code to 
use the serial port, and run it on both of my serial ports.. In my 
posting to the Cygwin list I asked if anyone had some code like this. 
But I got no response. If anyone on this list can offer some simple code 
for this, please do.

I do notice that under the old Cygwin I get this:

$ ls -l com1
crw-rw-rw-    1 0        0          7,   0 Sep 10 08:33 com1

But under the new Cygwin I get this:

$ ls -l com1
----------    0 ???????? ????????        0 Dec 31  1969 com1

I did get one response on the Cygwin list that "com1" no longer works. 
We are supposed to use "/dev/com1". I do not know how knowledgable this 
person was. The Cygwin user guide says "com1" should work. But it also 
says that "/dev/com1" and "/dev/ttyS0" should work.

One notable difference on Cygwin is that "ls /dev" or "ls /dev/*" 
produce nothing. There is no actual "/dev" directory. The user guide 
says that you just go ahead and open the device name.

An the thing is though, I was never able to get GDB to use "/dev/ttyS0" 
even under the old Cygwin. This is a nuisance because I also use Linux, 
and there I have GDB scripts that use "/dev/ttyS0".

I am pusuing this on this list because the previous fact suggests that 
GDB might benefit from some Cygwin specific code in this area and 
because I felt I was more likely to find someone else affected by this 
problem on this list. Also, the Cygwin list is swamped right now with 
other problems related to the 1.5.3 upgrade.

Again let me say to anyone with knowledge of the GDB code concerning 
serial ports, I have a test environment and I am willing to try any 
hacks or patches you may provide. But I do not have time right now to 
comb over the serial port GDB code and try to understand it.

Thomas Doerfler wrote:

>Hello,
>
>I have read your posting to the gdb mailing list. Some days 
>now I have a similar problem with a M68K-GDB5.2 working with 
>the serial remote protocol under cygwin 1.5.3.
>
>My gdb complains, that COM1 is "not a typewriter", and it will 
>open the alternative deivces "/dev/ttyS0" only in vary rare 
>occasions.
>
>I will try to downgrade my cygwin installation and try 
>again...
>wkr,
>	Thomas.
>  
>

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

* Re: Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
@ 2003-09-10 11:54 Thomas Doerfler
  2003-09-10 14:55 ` Creighton MacDonnell
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Doerfler @ 2003-09-10 11:54 UTC (permalink / raw)
  To: gdb; +Cc: Creighton MacDonnell

Hello,

I have read your posting to the gdb mailing list. Some days 
now I have a similar problem with a M68K-GDB5.2 working with 
the serial remote protocol under cygwin 1.5.3.

My gdb complains, that COM1 is "not a typewriter", and it will 
open the alternative deivces "/dev/ttyS0" only in vary rare 
occasions.

I will try to downgrade my cygwin installation and try 
again...
wkr,
	Thomas.

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

* Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1
@ 2003-09-08 21:41 Creighton MacDonnell
  0 siblings, 0 replies; 16+ messages in thread
From: Creighton MacDonnell @ 2003-09-08 21:41 UTC (permalink / raw)
  To: gdb


I upgraded my Cygwin installation a few days ago (Thursday, September 4) 
to the new 1.5.3-1 version, from the previous 1.3.22-1 version.

This broke a self-compiled (under the previous 1.3.22-1 version of 
Cygwin) version of GDB 5.3 compiled for "arm-elf" that I use.

It seems to me that GDB simply hangs after opening the COM1 serial port 
when trying to make an "RDI" (Angel Debug) connection.

I have recompiled my GNU tools with the new version of Cygwin but I have 
the same problem.

I still have my old installation of Cygwin, which still works. From this 
I know that the problem is not  with the target board or the serial port 
on my PC.

So something has changed in the Cygwin support for serial devices.

I have posted to the Cygwin mailing list, but I thought I would try this 
list too.

I had noticed previously that GDB would not use a serial port if it was 
refered to as /dev/com1 or /dev/ttyS0 (it would say and still says that 
it could not open it), although Cygwin claims to support these names. 
But it did work if "com1" was used as the device name.

I have looked at the code for serial device access in the GDB source, 
and it does not seem to make any special allowance for Cygwin. I see in 
the GDB code (after only a very quick look) some sort of  "serial 
interface discovery" process. This suggests that GDB does not just go 
ahead and attempt to open the device name. So understanding this code 
would probably not be trivial.

Does anyone else on this list use GDB in this way? Do you also have 
problems with Cygwin 1.5.1-1?

Is there anyone on this list with insight into the GDB code for 
accessing serial ports who might be able to suggest a hack that I might 
attempt to the code?

Thanks.


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

end of thread, other threads:[~2003-09-25  4:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-23 19:07 Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1 Creighton MacDonnell
2003-09-24  5:24 ` Eli Zaretskii
2003-09-24 18:09   ` Problem with COM1 port with GDB 5.3 under Cygwin 1.5.* Creighton MacDonnell
2003-09-24 18:12     ` Eli Zaretskii
2003-09-24 20:03       ` Problem with COM1 port with GDB 5.3 under cygwin 1.5.* Christopher Faylor
2003-09-25  4:46         ` Eli Zaretskii
2003-09-24 18:12   ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
  -- strict thread matches above, loose matches on Subject: below --
2003-09-10 11:54 Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1 Thomas Doerfler
2003-09-10 14:55 ` Creighton MacDonnell
2003-09-10 15:18   ` Thomas Doerfler
2003-09-10 16:48     ` Creighton MacDonnell
2003-09-10 18:55       ` Thomas Doerfler
2003-09-10 18:56       ` Problem with COM1 port from with GDB 5.3 under cygwin 1.5.3-1 Christopher Faylor
2003-09-10 20:05         ` Creighton MacDonnell
2003-09-10 21:58           ` Christopher Faylor
2003-09-08 21:41 Problem with COM1 port from with GDB 5.3 under Cygwin 1.5.3-1 Creighton MacDonnell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).