Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 6/9] Mechanical symtab->filename -> symtab_to_filename
Date: Mon, 21 Jan 2013 19:34:00 -0000	[thread overview]
Message-ID: <87ip6q1gbo.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20130117222242.GG16249@host2.jankratochvil.net> (Jan	Kratochvil's message of "Thu, 17 Jan 2013 23:22:42 +0100")

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> Hi,
Jan> this patch is mostly a mechanical substitution:
Jan> symtab-> filename -> symtab_to_filename (symtab)

Jan> -		      && loc->line_number == sal.line)
Jan> -		    {
Jan> -		      if (compare_filenames_for_search (loc->symtab->filename,
Jan> -							sal.symtab->filename))
Jan> -			line_match = 1;
Jan> -		    }
Jan> +		      && loc->line_number == sal.line
Jan> +		      && filename_cmp (symtab_to_fullname (loc->symtab),
Jan> +				       sal_fullname) == 0)
Jan> +		    line_match = 1;

I found the patch a bit difficult because some spots are the mechanical
conversion you mention, but others, like this, use symtab_to_fullname.

Jan> +	  if (function_sal->symtab != NULL
Jan> +	      && compare_filenames_for_search (function_sal->symtab->filename,
Jan> +					       e->filename))
Jan> +	    return 1;

This spot still uses symtab->filename directly.
Is that intentional?  If so I think it should perhaps have a comment.

Jan> +      if (symname == NULL
Jan> +	  || filename_cmp (symname, symtab_to_filename (s)) == 0)

This spot uses filename_cmp with symtab_to_filename.
Is that intentional?
It seems a bit strange to me to allow the filename-display setting to
control comparisons.

Jan>  	  if (! regexp
Jan> -	      || re_exec (symtab->filename))
Jan> +	      || re_exec (symtab_to_filename (symtab)))

Likewise.

Jan> @@ -150,7 +152,7 @@ tui_set_source_content (struct symtab *s,
[...]
Jan> -				       s->filename) == 0
Jan> +				       symtab_to_filename (s)) == 0

Likewise.

Tom


  reply	other threads:[~2013-01-21 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 22:23 Jan Kratochvil
2013-01-21 19:34 ` Tom Tromey [this message]
2013-01-24 21:56   ` Jan Kratochvil
2013-01-25 14:28     ` Tom Tromey
2013-01-25 14:30       ` Jan Kratochvil

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=87ip6q1gbo.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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