This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 6/9] Mechanical symtab->filename -> symtab_to_filename
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 21 Jan 2013 12:33:47 -0700
- Subject: Re: [patch 6/9] Mechanical symtab->filename -> symtab_to_filename
- References: <20130117222242.GG16249@host2.jankratochvil.net>
>>>>> "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