* [patch] increase number of com ports on windows
@ 2003-02-04 7:23 Martin M. Hunt
0 siblings, 0 replies; only message in thread
From: Martin M. Hunt @ 2003-02-04 7:23 UTC (permalink / raw)
To: insight
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
Theoretically this patch will remove the hard-coded limit of 9 com ports
recognized by Insight on windows. I don't know how to get a list of
valid ports, so the new code just keeps incrementing the port number and
trying to open the port until an open fails. If anyone has more than 4
serial ports, I would appreciate it if you would test this.
2003-02-03 Martin M. Hunt <hunt@redhat.com>
* library/targetselection.itb (TargetSelection::port_list): Keep
checking ports on Windows until we can open no more. Replaces
fixed limit of 9.
[-- Attachment #2: p --]
[-- Type: text/x-patch, Size: 1026 bytes --]
Index: library/targetselection.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/targetselection.itb,v
retrieving revision 1.12
diff -u -r1.12 targetselection.itb
--- library/targetselection.itb 15 Oct 2002 21:19:51 -0000 1.12
+++ library/targetselection.itb 4 Feb 2003 07:19:41 -0000
@@ -877,12 +877,16 @@
# which is OK because we may be using it or the user
# may be setting up the remote target manually with
# a terminal program.
- for {set i 1} {$i < 9} { incr i} {
+ set quit 0
+ for {set i 1} {!$quit} {incr i} {
if {[catch { set fd [::open COM$i: RDWR] } msg]} {
# Failed. Find out why.
if {[string first "permission denied" $msg] != -1} {
# Port is there, but busy right now. That's OK.
lappend plist com$i
+ } elseif {$i > 4} {
+ # if we've scanned the first 4 ports, then quit when we find no more
+ set quit 1
}
} else {
# We got it. Now close it and add to list.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-02-04 7:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 7:23 [patch] increase number of com ports on windows Martin M. Hunt
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).