From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9129 invoked by alias); 18 Jan 2013 20:40:16 -0000 Received: (qmail 9011 invoked by uid 22791); 18 Jan 2013 20:40:13 -0000 X-SWARE-Spam-Status: No, hits=-4.6 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 mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jan 2013 20:40:04 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MGU005009CSAD00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Fri, 18 Jan 2013 22:40:02 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MGU0051Q9EP1670@a-mtaout20.012.net.il>; Fri, 18 Jan 2013 22:40:02 +0200 (IST) Date: Fri, 18 Jan 2013 20:40:00 -0000 From: Eli Zaretskii Subject: Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks In-reply-to: <20130118193457.GA4369@host2.jankratochvil.net> To: Jan Kratochvil Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83mww65iok.fsf@gnu.org> References: <20130117215846.GC16249@host2.jankratochvil.net> <83fw1z6j5i.fsf@gnu.org> <20130118183938.GA1255@host2.jankratochvil.net> <83r4li5mdj.fsf@gnu.org> <20130118193457.GA4369@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: 2013-01/txt/msg00455.txt.bz2 > Date: Fri, 18 Jan 2013 20:34:57 +0100 > From: Jan Kratochvil > Cc: gdb-patches@sourceware.org > > On Fri, 18 Jan 2013 20:20:24 +0100, Eli Zaretskii wrote: > > > Date: Fri, 18 Jan 2013 19:39:38 +0100 > > > From: Jan Kratochvil > > > Cc: gdb-patches@sourceware.org > > > > > > On Fri, 18 Jan 2013 08:32:25 +0100, Eli Zaretskii wrote: > > > > > int > > > > > compare_filenames_for_search (const char *filename, const char *search_name) > > > > > @@ -171,7 +171,8 @@ compare_filenames_for_search (const char *filename, const char *search_name) > > > > > to put the "c:file.c" name into debug info. Such compatibility > > > > > works only on GDB built for DOS host. */ > > > > > return (len == search_len > > > > > - || IS_DIR_SEPARATOR (filename[len - search_len - 1]) > > > > > + || (!IS_ABSOLUTE_PATH (search_name) > > > > > + && IS_DIR_SEPARATOR (filename[len - search_len - 1])) > > > > > || (HAS_DRIVE_SPEC (filename) > > > > > && STRIP_DRIVE_SPEC (filename) == &filename[len - search_len])); > > > > > } > > > > > > > > I don't understand why the "match up to a slash" rule is now limited > > > > to non-absolute file names. > > > > > > FILENAME may contain for example: /path/to//file.c > > > Then we may request to put a breakpoint to: /file.c:main > > > And without > > > the '!IS_ABSOLUTE_PATH (search_name) &&' part it would falsely match. > > > > Thanks for explaining. However, IMO i's wrong to test for double > > slash with IS_ABSOLUTE_PATH, because the same could happen with > > foo//bar.c, right? So why not explicitly test for consecutive > > slashes instead? > > I do not understand much what do you suggest. I'm saying that your addition of IS_ABSOLUTE_PATH to the test above might fail file-name comparisons where they previously succeeded, and for reasons that seem wrong to me. IOW, I simply don't see why the test for IS_ABSOLUTE_PATH should be added there. What exactly would go wrong if you don't add it?