public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: "Martin M. Hunt" <hunt@redhat.com>
To: "insight@sources.redhat.com" <insight@sources.redhat.com>
Subject: [patch] increase number of com ports on windows
Date: Tue, 04 Feb 2003 07:23:00 -0000	[thread overview]
Message-ID: <1044343411.2677.9.camel@Dragon> (raw)

[-- 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.

                 reply	other threads:[~2003-02-04  7:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1044343411.2677.9.camel@Dragon \
    --to=hunt@redhat.com \
    --cc=insight@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).