This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks


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).


> IOW, I simply don't see why the test for IS_ABSOLUTE_PATH should be
> added there.  What exactly would go wrong if you don't add it?

When you revert this change:

-	  || IS_DIR_SEPARATOR (filename[len - search_len - 1])
+	  || (!IS_ABSOLUTE_PATH (search_name)
+	      && IS_DIR_SEPARATOR (filename[len - search_len - 1]))

then the new testcase FAILs

+mi_gdb_test "-break-insert -t /$srcfile:main" \
+           "\\^error,msg=\"No source file named /[string_to_regexp $srcfile]\\.\"" \
+           "compare_filenames_for_search does not match"

because the breakpoint will be placed there, it should not (error is expected
and correct).

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


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]