From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4818 invoked by alias); 19 Jan 2013 14:09:30 -0000 Received: (qmail 4801 invoked by uid 22791); 19 Jan 2013 14:09:28 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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, 19 Jan 2013 14:09:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0JE9JUc009781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 19 Jan 2013 09:09:19 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0JE9FD9028980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 19 Jan 2013 09:09:17 -0500 Date: Sat, 19 Jan 2013 14:09:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks Message-ID: <20130119140914.GA7303@host2.jankratochvil.net> References: <20130117215846.GC16249@host2.jankratochvil.net> <83fw1z6j5i.fsf@gnu.org> <20130118183938.GA1255@host2.jankratochvil.net> <83r4li5mdj.fsf@gnu.org> <20130118193457.GA4369@host2.jankratochvil.net> <83mww65iok.fsf@gnu.org> <20130118211002.GA9261@host2.jankratochvil.net> <83d2x1r7iy.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83d2x1r7iy.fsf@gnu.org> 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: 2013-01/txt/msg00463.txt.bz2 On Sat, 19 Jan 2013 07:50:13 +0100, Eli Zaretskii wrote: > > Could you give an example? Previously it was forbidden/unspecified what > > happens when you call compare_filenames_for_search > > with IS_ABSOLUTE_PATH (search_name). > > Any absolute file name would be an example. Could you state literal SEARCH_NAME, literal FILENAME, what is a result you expect and what do you you think is the actual result with this patch? I have double/triple checked this patch and I do not see a bug there. > > I hope we agree that placing a breakpoint to > > /filename.c:main > > should not be successful even if one of the source files is named: > > /path/to//filename.c > > Yes, we do. But IS_ABSOLUTE_PATH tests more than just whether there's > a slash at the beginning of "/filename.c". I'm saying we should test > explicitly for the slash, not for the file name being absolute. IOW, > using IS_ABSOLUTE_PATH here obfuscates the real intent of the code. I think IS_ABSOLUTE_PATH is there really right, we need to test if the SEARCH_NAME should match from the beginning of FILENAME or if it can match only its trailing part. For example when asking for a breakpoint at: c:\filename.c:main it must not match a debug info filename: d:\foo\c:\filename.c This case would incorrectly match if only 'IS_DIR_SEPARATOR (search_name[0])' was tested there. Moreover this patch is a "Code cleanup" and the callers were already using IS_ABSOLUTE_PATH. So if IS_ABSOLUTE_PATH is wrong (which IMO so far it is not) then it is still a new patch / unrelated fix, not the scope of this patch. Thanks, Jan