This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/3] bfd cache: tighten match criteria and debug commands.
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Tue, 14 Apr 2015 12:46:27 +0100
- Subject: Re: [PATCH 0/3] bfd cache: tighten match criteria and debug commands.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1428941320 dot git dot andrew dot burgess at embecosm dot com> <552C326E dot 6080803 at redhat dot com>
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/