From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24509 invoked by alias); 8 Dec 2012 18:33:05 -0000 Received: (qmail 24484 invoked by uid 22791); 8 Dec 2012 18:33:04 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Dec 2012 18:32:57 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MEQ00B005QSPC00@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Sat, 08 Dec 2012 20:32:54 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MEQ00BK466TPF10@a-mtaout21.012.net.il>; Sat, 08 Dec 2012 20:32:54 +0200 (IST) Date: Sat, 08 Dec 2012 18:33:00 -0000 From: Eli Zaretskii Subject: Re: RFC: add relative file name handling for linespecs In-reply-to: <20121208163407.GA11843@host2.jankratochvil.net> To: Jan Kratochvil Cc: gdb-patches@sourceware.org, tromey@redhat.com Reply-to: Eli Zaretskii Message-id: <83txrwcs3c.fsf@gnu.org> References: <83ipkjeagi.fsf@gnu.org> <20121208163407.GA11843@host2.jankratochvil.net> 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/msg00216.txt.bz2 > Date: Sat, 8 Dec 2012 17:34:07 +0100 > From: Jan Kratochvil > Cc: gdb-patches@sourceware.org, Tom Tromey > > 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? If this comes only from debug info, I guess you are right, although it would be good to make sure GCC never writes such names into debug info.