[PATCH 0/3] bfd cache: tighten match criteria and debug commands.
Gary Benson
gbenson@redhat.com
Tue Apr 14 11:46:00 GMT 2015
Pedro Alves wrote:
> On 04/13/2015 06:30 PM, Andrew Burgess wrote:
> > Given that any solution using inodes would probably be on top of
> > the existing match criteria, and that obtaining the file size is
> > pretty cheep, I figured there's little harm is having this in
> > place now, and adding an inode based criteria later, if wanted.
>
> Although my first reaction was that it does sounds useful for
> Windows which leaves st_ino==0, as described in
> separate_debug_file_exists, I think that we should instead not share
> the bfds even if the file size matches: it's not hard to rebuild the
> program/library you're debugging and end up with the same file size
> but different contents... A caching/sharing system that works in
> most cases, but sometimes fails is not a good system.
Note also that there's five places in GDB that fake the contents of
stat buffers for BFD. These faked ones only fill in st_size:
gdb/spu-linux-nat.c:317: sb->st_size = INT_MAX;
gdb/solib-spu.c:317: sb->st_size = INT_MAX;
gdb/minidebug.c:245: sb->st_size = lzma_index_uncompressed_size (lstream->index);
gdb/jit.c:130: sb->st_size = buffer->size;
gdb/remote.c:10093: st->st_size = INT_MAX;
You'd have to either extend or cope with these.
Cheers,
Gary
--
http://gbenson.net/
More information about the Gdb-patches
mailing list