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 4/9] TUI: Use internally fullname


> Date: Mon, 21 Jan 2013 22:11:21 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org
> 
> -      if (compare_filenames_for_search (s->filename, name))
> +      if (compare_filenames_for_search (s->filename, name)
> +         || compare_filenames_for_search (symtab_to_fullname (s), name))
> 
> One cannot use just:
> +      if (compare_filenames_for_search (symtab_to_fullname (s), name))
> 
> as in the case of S->FILENAME == NAME == "./gdb.base/return.c" it would be
> a regression because SYMTAB_TO_FULLNAME == "/gdb/testsuite/gdb.base/return.c".
> Formerly S->FILENAME matched NAME but SYMTAB_TO_FULLNAME does not match NAME.
> 
> One could also do some "normalization" of NAME, one could strip "./" but for
> more complicated cases one cannot do much.

Why strip it?  We could resolve "." to an absolute file name using the
compilation directory, and then they will match, right?

> The next step would be to turn various pathname comparisons rather to
> st_dev&&st_ino comparisons when possible which should be both faster and more
> universal.

That will break on Windows, unless we replace the library
implementation of 'stat' and 'fstat', or provide a method for
retrieving just the inode and device number (which could be
implemented on Windows using available APIs, such as
GetFileInformationByHandle).


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