This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/3] gdb: Improve cache matching criteria for the bfd cache.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Mon, 17 Aug 2015 18:34:16 +0100
- Subject: Re: [PATCH v2 1/3] gdb: Improve cache matching criteria for the bfd cache.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1439454669 dot git dot andrew dot burgess at embecosm dot com> <b02704260b44396f657791907c51826ea9b495dd dot 1439454670 dot git dot andrew dot burgess at embecosm dot com>
On 08/13/2015 01:44 PM, Andrew Burgess wrote:
> Within gdb open bfd objects are reused where possible if an attempt is
> made to reopen a file that is already being debugged. To spot if the on
> disc file has changed gdb currently examines the mtime of the file and
> compares it to the mtime of the open bfd in the cache.
>
> A problem exists when the on disc file is being rapidly regenerated, as
> happens, for example, with automated testing. In some cases the file is
> generated so quickly that the mtime appears not to change, while the on
> disc file has changed.
>
> This patch extends the bfd cache to also hold the file size of the file,
> the inode of the file, and the device id of the file; gdb can then
> compare filename, file size, mtime, inode, and device id to determine if
> an existing bfd object can be reused.
>
> gdb/ChangeLog:
>
> * gdb_bfd.c (struct gdb_bfd_data): Add size, inode, and device id
> field.
> (struct gdb_bfd_cache_search): Likewise.
> (eq_bfd): Compare the size, inode, and device id fields.
> (gdb_bfd_open): Initialise the size, inode, and device id fields.
> (gdb_bfd_ref): Likewise.
> (gdb_bfd_unref): Likewise.
OK.
Thanks,
Pedro Alves