From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23951 invoked by alias); 8 Dec 2012 16:34:27 -0000 Received: (qmail 23591 invoked by uid 22791); 8 Dec 2012 16:34:22 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Dec 2012 16:34:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB8GYDDO003385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Dec 2012 11:34:13 -0500 Received: from host2.jankratochvil.net (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB8GY8IE026461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 8 Dec 2012 11:34:11 -0500 Date: Sat, 08 Dec 2012 16:34:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: RFC: add relative file name handling for linespecs Message-ID: <20121208163407.GA11843@host2.jankratochvil.net> References: <83ipkjeagi.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00214.txt.bz2 Hi Eli, On Wed, 11 Jan 2012 22:49:37 +0100, Tom Tromey wrote: > Tom> + /* Either the names must completely match, or the character > Tom> + preceding the trailing SEARCH_NAME segment of FILENAME must be a > Tom> + directory separator. */ > Tom> + return (len == search_len > Tom> + || IS_DIR_SEPARATOR (filename[len - search_len - 1])); > > Eli> What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar" > Eli> on Windows? > > Would something like this work? > > || (HAS_DRIVE_SPEC (filename) && len - search_len == 2) FILENAME here is from the debug info file (not from the user), I believe on MinGW the path from DWARF is absolute (like in UNIX) and it has the format d:\foo\bar (not d:foo\bar), doesn't it? Whether user can / cannot then specify d:foo/bar is unrelated to the patch Tom did above. It could be implemented but it would be a different code/patch. Not that it would be a bug but the current code there || (HAS_DRIVE_SPEC (filename) && STRIP_DRIVE_SPEC (filename) == &filename[len - search_len])); can IMO never match on real world MinGW DWARF files. Thanks, Jan