From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38566 invoked by alias); 17 Aug 2015 17:34:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 38552 invoked by uid 89); 17 Aug 2015 17:34:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 17 Aug 2015 17:34:20 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D568B85539; Mon, 17 Aug 2015 17:34:18 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7HHYGIk015382; Mon, 17 Aug 2015 13:34:17 -0400 Message-ID: <55D21B18.5000002@redhat.com> Date: Mon, 17 Aug 2015 17:34:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH v2 1/3] gdb: Improve cache matching criteria for the bfd cache. References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-08/txt/msg00433.txt.bz2 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