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 Mon, 21 Jan 2013 19:45:57 +0100, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> Jan> 	Code cleanup.
> Jan> 	* breakpoint.c (clear_command): Remove variable is_abs, unify the
> Jan> 	call of filename_cmp with compare_filenames_for_search.
> [...]
> 
> Jan>      if (full_path != NULL)
> Jan>        {
> Jan> +	gdb_assert (IS_ABSOLUTE_PATH (full_path));
> Jan> +	gdb_assert (IS_ABSOLUTE_PATH (name));
> 
> I wonder if these can really never trigger.
> 
> I think under some obscure conditions, xfullpath can return a relative
> path, since gdb_realpath can.

xfullpath is gone in a new patchset so let's talk just about gdb_realpath.

May 'gdb_realpath (absolute_path)' really return a relative path?  I assume it
cannot although I do not see it guaranteed for example in POSIX.  No other
cases may happen.

I have restricted when quick_symbol_functions->map_symtabs_matching_filename
may be called, according to the calling cases used by the only existing
caller.


Thanks,
Jan


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