From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20609 invoked by alias); 9 Mar 2006 00:12:36 -0000 Received: (qmail 20596 invoked by uid 22791); 9 Mar 2006 00:12:35 -0000 X-Spam-Check-By: sourceware.org Received: from intranet.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Mar 2006 00:12:34 +0000 Received: (qmail 8392 invoked from network); 9 Mar 2006 00:12:33 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Mar 2006 00:12:33 -0000 To: gdb-patches@sources.redhat.com Subject: RFA: parse 'target remote' device special cases first From: Jim Blandy Date: Thu, 09 Mar 2006 04:38:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-03/txt/msg00131.txt.bz2 Without this change, if the command supplied after 'target remote |' contained a colon, the portion of the command ahead of that colon would be mistaken for a hostname. But the syntax isn't actually ambiguous, since hostnames don't start with '|'. Tested on x86_64-pc-linux-gnu. 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. Index: src/gdb/serial.c =================================================================== --- src.orig/gdb/serial.c +++ src/gdb/serial.c @@ -184,8 +184,6 @@ serial_open (const char *name) if (strcmp (name, "pc") == 0) ops = serial_interface_lookup ("pc"); - else if (strchr (name, ':')) - ops = serial_interface_lookup ("tcp"); else if (strncmp (name, "lpt", 3) == 0) ops = serial_interface_lookup ("parallel"); else if (strncmp (name, "|", 1) == 0) @@ -193,6 +191,8 @@ serial_open (const char *name) ops = serial_interface_lookup ("pipe"); open_name = name + 1; /* discard ``|'' */ } + else if (strchr (name, ':')) + ops = serial_interface_lookup ("tcp"); else ops = serial_interface_lookup ("hardwire");