Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Don't assume the name of Windows serial devices?
@ 2008-03-28 14:38 Carlos O'Donell
  2008-03-28 14:45 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos O'Donell @ 2008-03-28 14:38 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]


Is there any reason we restrict the Windows serial device names to 
"COM?" A user could have serial boards, com ports higher than 9 
(\\.\COMX), or weird file devices that act like serial ports.

The following patch removes the code that rejects devices that don't 
start with the word "COM".

Comments?

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

[-- Attachment #2: gdb-serial.diff --]
[-- Type: text/x-patch, Size: 796 bytes --]

2008-03-28  Carlos O'Donell  <carlos@codesourcery.com>

	* ser-mingw.c (ser_windows_open): Open requested name.

Index: gdb/ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.12
diff -u -p -r1.12 ser-mingw.c
--- gdb/ser-mingw.c	1 Jan 2008 22:53:12 -0000	1.12
+++ gdb/ser-mingw.c	28 Mar 2008 14:32:56 -0000
@@ -51,13 +51,6 @@ ser_windows_open (struct serial *scb, co
   struct ser_windows_state *state;
   COMMTIMEOUTS timeouts;
 
-  /* Only allow COM ports.  */
-  if (strncmp (name, "COM", 3) != 0)
-    {
-      errno = ENOENT;
-      return -1;
-    }
-
   h = CreateFile (name, GENERIC_READ | GENERIC_WRITE, 0, NULL,
 		  OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
   if (h == INVALID_HANDLE_VALUE)

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

* Re: [RFC] Don't assume the name of Windows serial devices?
  2008-03-28 14:38 [RFC] Don't assume the name of Windows serial devices? Carlos O'Donell
@ 2008-03-28 14:45 ` Daniel Jacobowitz
  2008-03-28 17:33   ` Carlos O'Donell
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2008-03-28 14:45 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: gdb-patches

On Fri, Mar 28, 2008 at 10:37:42AM -0400, Carlos O'Donell wrote:
>
> Is there any reason we restrict the Windows serial device names to "COM?" 
> A user could have serial boards, com ports higher than 9 (\\.\COMX), or 
> weird file devices that act like serial ports.
>
> The following patch removes the code that rejects devices that don't  
> start with the word "COM".
>
> Comments?

I don't think weird file devices will act enough like serial ports for
things to work just right, but I don't see the need for the
restriction either - hopefully no one tries to open random junk
with target remote :-)

> 2008-03-28  Carlos O'Donell  <carlos@codesourcery.com>
> 
> 	* ser-mingw.c (ser_windows_open): Open requested name.

OK.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Don't assume the name of Windows serial devices?
  2008-03-28 14:45 ` Daniel Jacobowitz
@ 2008-03-28 17:33   ` Carlos O'Donell
  0 siblings, 0 replies; 3+ messages in thread
From: Carlos O'Donell @ 2008-03-28 17:33 UTC (permalink / raw)
  To: Carlos O'Donell, gdb-patches

Daniel Jacobowitz wrote:
>> 2008-03-28  Carlos O'Donell  <carlos@codesourcery.com>
>>
>> 	* ser-mingw.c (ser_windows_open): Open requested name.
> 
> OK.
> 

Checked in. Thanks.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716


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

end of thread, other threads:[~2008-03-28 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 14:38 [RFC] Don't assume the name of Windows serial devices? Carlos O'Donell
2008-03-28 14:45 ` Daniel Jacobowitz
2008-03-28 17:33   ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox