This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks
> Date: Fri, 18 Jan 2013 22:10:02 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org
>
> On Fri, 18 Jan 2013 21:40:11 +0100, Eli Zaretskii wrote:
> > I'm saying that your addition of IS_ABSOLUTE_PATH to the test above
> > might fail file-name comparisons where they previously succeeded, and
> > for reasons that seem wrong to me.
>
> Could you give an example? Previously it was forbidden/unspecified what
> happens when you call compare_filenames_for_search
> with IS_ABSOLUTE_PATH (search_name).
Any absolute file name would be an example.
> I hope we agree that placing a breakpoint to
> /filename.c:main
> should not be successful even if one of the source files is named:
> /path/to//filename.c
Yes, we do. But IS_ABSOLUTE_PATH tests more than just whether there's
a slash at the beginning of "/filename.c". I'm saying we should test
explicitly for the slash, not for the file name being absolute. IOW,
using IS_ABSOLUTE_PATH here obfuscates the real intent of the code.