From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8806 invoked by alias); 28 May 2014 22:42:07 -0000 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 Received: (qmail 8735 invoked by uid 89); 28 May 2014 22:42:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ni.com Received: from skprod3.natinst.com (HELO ni.com) (130.164.80.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 28 May 2014 22:42:05 +0000 Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod3.natinst.com (8.14.5/8.14.5) with ESMTP id s4SMg1Mc011306; Wed, 28 May 2014 17:42:01 -0500 Received: from linuxgetsreal.amer.corp.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP5) with SMTP id 2014052817420089-444263 ; Wed, 28 May 2014 17:42:00 -0500 Received: by linuxgetsreal.amer.corp.natinst.com (sSMTP sendmail emulation); Wed, 28 May 2014 17:42:00 -0500 From: "Brad Mouring" To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: Fix matching path substitution rule listing, add tests Date: Wed, 28 May 2014 22:42:00 -0000 Message-Id: <1401316902-12320-1-git-send-email-brad.mouring@ni.com> In-Reply-To: <20140528161531.GA4289@adacore.com> References: <20140528161531.GA4289@adacore.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-05-28_07:2014-05-28,2014-05-28,1970-01-01 signatures=0 X-SW-Source: 2014-05/txt/msg00708.txt.bz2 Let's try this one again. The check for the source (or "from") directory snippet in listing matching path substitution rules currently will not match anything other than a direct match of the "from" field in a substitution rule, resulting in the incorrect behavior below ... (gdb) set substitute-path /a/path /another/path (gdb) show substitute-path List of all source path substitution rules: `/a/path' -> `/another/path'. (gdb) show substitute-path /a/path/to/a/file.ext Source path substitution rule matching `/a/path/to/a/file.ext': (gdb) show substitute-path /a/path Source path substitution rule matching `/a/path': `/a/path' -> `/another/path'. ... This change effects the following behavior by (sanely) checking with the length of the "from" portion of a rule and ensuring that the next character of the path considered for substitution is a path delimiter. With this change, the following behavior is garnered ... (gdb) set substitute-path /a/path /another/path (gdb) show substitute-path List of all source path substitution rules: `/a/path' -> `/another/path'. (gdb) show substitute-path /a/path/to/a/file.ext Source path substitution rule matching `/a/path/to/a/file.ext': `/a/path' -> `/another/path'. (gdb) show substitute-path /a/pathological/case/that/should/fail.err Source path substitution rule matching `/a/pathological/case/that/should/fail.err': (gdb) Also included in this submission is a couple of new tests to verify this behavior in the test suite. Cheers and thanks for your attention. ChangeLog entry for gdb/ChangeLog: 2014-05-28 Brad Mouring * source.c (show_substitute_path_command): Fix display of matching substitution rules * subst.exp: Add tests to verify changes in source.c