From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25415 invoked by alias); 2 Jun 2014 20:45:20 -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 25405 invoked by uid 89); 2 Jun 2014 20:45:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 02 Jun 2014 20:45:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A29501161BC; Mon, 2 Jun 2014 16:45:17 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hYhIBKHz9UNz; Mon, 2 Jun 2014 16:45:17 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 72CE51161BB; Mon, 2 Jun 2014 16:45:17 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 35A8F40E72; Mon, 2 Jun 2014 13:45:18 -0700 (PDT) Date: Mon, 02 Jun 2014 20:45:00 -0000 From: Joel Brobecker To: Brad Mouring Cc: gdb-patches@sourceware.org, Brad Mouring Subject: Re: [PATCH] gdb/source.c: Fix matching path substitute rule listing Message-ID: <20140602204518.GL4289@adacore.com> References: <1401733662-26215-1-git-send-email-brad.mouring@ni.com> <1401740862-25438-1-git-send-email-brad.mouring@ni.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401740862-25438-1-git-send-email-brad.mouring@ni.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-06/txt/msg00044.txt.bz2 Hi Brad, > 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 Much better, thank you! You are still missing a couple of elements: * You patch needs two ChangeLog entries, one in gdb/ChangeLog, and one in gdb/testsuite/ChangeLog. The revision log should have both at the end. Here is an example of another patch where both GDB and testsuite where changed thus resulting in 2 CL entries: 938f0e2f6766e90a5ddc5df00e97a68873fd1252 * You forgot to tell us on which platform you tested your patch. Comment about the patch itself below... Please don't be discouraged, you have very close to getting it in! > --- > gdb/source.c | 4 +++- > gdb/testsuite/gdb.base/subst.exp | 8 ++++++++ > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/gdb/source.c b/gdb/source.c > index c112765..240062c 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -1857,6 +1857,7 @@ show_substitute_path_command (char *args, int from_tty) > char **argv; > char *from = NULL; > struct cleanup *cleanup; > + int rule_from_len; > > argv = gdb_buildargv (args); > cleanup = make_cleanup_freeargv (argv); > @@ -1879,7 +1880,8 @@ show_substitute_path_command (char *args, int from_tty) > > while (rule != NULL) > { > - if (from == NULL || FILENAME_CMP (rule->from, from) == 0) > + rule_from_len = strlen(rule->from); > + if (from == NULL || substitute_path_rule_matches (rule, from) != 0) > printf_filtered (" `%s' -> `%s'.\n", rule->from, rule->to); > rule = rule->next; You do not need "rule_from_len" anymore. The final patch for this file should be a one-line change. -- Joel