From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15852 invoked by alias); 11 Apr 2006 20:32:52 -0000 Received: (qmail 15840 invoked by uid 22791); 11 Apr 2006 20:32:50 -0000 X-Spam-Check-By: sourceware.org Received: from xproxy.gmail.com (HELO xproxy.gmail.com) (66.249.82.192) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Apr 2006 20:32:48 +0000 Received: by xproxy.gmail.com with SMTP id h29so859190wxd for ; Tue, 11 Apr 2006 13:32:44 -0700 (PDT) Received: by 10.70.103.16 with SMTP id a16mr920852wxc; Tue, 11 Apr 2006 13:32:43 -0700 (PDT) Received: by 10.70.125.5 with HTTP; Tue, 11 Apr 2006 13:32:43 -0700 (PDT) Message-ID: <8f2776cb0604111332n5f0f665ala64bc30710ca74de@mail.gmail.com> Date: Tue, 11 Apr 2006 20:32:00 -0000 From: "Jim Blandy" To: "Jim Blandy" , gdb-patches@sources.redhat.com Subject: Re: RFA: parse 'target remote' device special cases first In-Reply-To: <20060325070020.GK26748@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060325070020.GK26748@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00136.txt.bz2 On 3/25/06, Daniel Jacobowitz wrote: > On Wed, Mar 08, 2006 at 04:12:32PM -0800, Jim Blandy wrote: > > src/gdb/ChangeLog: > > 2006-03-08 Jim Blandy > > > > * serial.c (serial_open): Check for special cases at the front of > > the "device" name before scanning for the ':' that would indicate > > an IP-based connection. > > Doesn't this go against the "what not why" ChangeLog convention? It > ought to go in serial_open as a comment, I think. You're right, there should be a comment in serial_open; I've added one. But the ChangeLog entry seems okay to me: it doesn't talk about one check inadvertently masking the others, or how text following a "|" (say) might contain colons, or things like that; it just says what the code has been changed to do when. > Other than that, I agree; this patch is OK. I've committed the patch below, but I'm happy to revise the log entry if you still think it's not of the right form. I agree the principle you're citing is important; it seems to me the entry adheres to it. src/gdb/ChangeLog: 2006-04-11 Jim Blandy * serial.c (serial_open): Check for special cases at the front of the "device" name before scanning for the ':' that would indicate an IP-based connection. Index: src/gdb/serial.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/serial.c +++ src/gdb/serial.c @@ -184,8 +184,6 @@ serial_open (const char *name) if (strcmp (name, "pc") =3D=3D 0) ops =3D serial_interface_lookup ("pc"); - else if (strchr (name, ':')) - ops =3D serial_interface_lookup ("tcp"); else if (strncmp (name, "lpt", 3) =3D=3D 0) ops =3D serial_interface_lookup ("parallel"); else if (strncmp (name, "|", 1) =3D=3D 0) @@ -193,6 +191,11 @@ serial_open (const char *name) ops =3D serial_interface_lookup ("pipe"); open_name =3D name + 1; /* discard ``|'' */ } + /* Check for a colon, suggesting an IP address/port pair. + Do this *after* checking for all the interesting prefixes. We + don't want to constrain the syntax of what can follow them. */ + else if (strchr (name, ':')) + ops =3D serial_interface_lookup ("tcp"); else ops =3D serial_interface_lookup ("hardwire");