Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Brad Mouring <bmouring@ni.com>
Cc: gdb-patches@sourceware.org, Brad Mouring <brad.mouring@ni.com>
Subject: Re: [PATCH] gdb/source.c: Fix matching path substitute rule listing
Date: Mon, 02 Jun 2014 20:45:00 -0000	[thread overview]
Message-ID: <20140602204518.GL4289@adacore.com> (raw)
In-Reply-To: <1401740862-25438-1-git-send-email-brad.mouring@ni.com>

Hi Brad,

> 2014-05-28  Brad Mouring <brad.mouring@ni.com>
> 
>     * 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


  reply	other threads:[~2014-06-02 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 21:02 [PATCH] gdb/source.c: Fix source path substitution Brad Mouring
2014-05-23 23:50 ` Joel Brobecker
2014-05-24  0:00   ` Joel Brobecker
2014-05-27 13:17     ` Brad Mouring
2014-05-27 18:10       ` Joel Brobecker
2014-05-28 16:01         ` Brad Mouring
2014-05-28 16:15           ` Joel Brobecker
2014-05-28 22:42             ` Fix matching path substitution rule listing, add tests Brad Mouring
2014-05-28 22:42               ` [PATCH 1/2] testsuite/subst: Add tests for printing matches Brad Mouring
2014-05-28 22:42               ` [PATCH 2/2] gdb/source.c: Fix matching path substitute rule listing Brad Mouring
2014-06-02 15:14                 ` Joel Brobecker
2014-06-02 18:28                   ` [PATCH] " Brad Mouring
2014-06-02 20:27                     ` Brad Mouring
2014-06-02 20:45                       ` Joel Brobecker [this message]
2014-06-02 20:55                         ` Brad Mouring
2014-06-03 14:25                           ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140602204518.GL4289@adacore.com \
    --to=brobecker@adacore.com \
    --cc=bmouring@ni.com \
    --cc=brad.mouring@ni.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox