This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] maintenance_print_msymbols: Try harder to match files
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: gdb-patches at sources dot redhat dot com, Joel Brobecker <brobecker at adacore dot com>
- Date: Mon, 02 May 2005 22:17:58 +0300
- Subject: Re: [RFA] maintenance_print_msymbols: Try harder to match files
- References: <20050124210931.GE17455@cygbert.vinschen.de> <20050501233700.GD4311@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.