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: RFC: add relative file name handling for linespecs


> From: Tom Tromey <tromey@redhat.com>
> Date: Tue, 10 Jan 2012 09:06:08 -0700
> 
> This needs at least a doc review.

Thanks, the documentation parts are okay.

> +/* See whether FILENAME matches SEARCH_NAME using the rule that we
> +   advertise to the user.

Why not say explicitly how the names are matched?  "The rule we
advertise" doesn't give any hint where to look for that rule, so the
issue remains a mystery and requires to read the source to glean what
this does.

> +  /* Either the names must completely match, or the character
> +     preceding the trailing SEARCH_NAME segment of FILENAME must be a
> +     directory separator.  */
> +  return (len == search_len
> +	  || IS_DIR_SEPARATOR (filename[len - search_len - 1]));

What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar"
on Windows?


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