This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA] maintenance_print_msymbols: Try harder to match files


> Date: Sun, 1 May 2005 19:37:00 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Joel Brobecker <brobecker@adacore.com>
> 
> You're comparing solely based on inode number; I think that's an unwise
> choice for two reasons:
>   - The file may have been replaced on disk; we should use the copy
>     that was there when GDB opened it.
>   - There are some file systems in which all st_ino values are zero.
> 
> If you've got the full path, why not use that?

Indeed.  symtab.c:lookup_symbol has an example of what I think you
should use (and what AFAIU Daniel had in mind).  Note that file-name
comparison should use FILENAME_CMP instead of strcmp, to avoid
failures on non-Posix systems.


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