From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68763 invoked by alias); 14 Jan 2020 22:26:43 -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 68755 invoked by uid 89); 14 Jan 2020 22:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-29.4 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Spam-Relays-External:209.85.167.196, H*RU:209.85.167.196, HX-Received:sk:p203mr1, HX-Received:f1d4 X-HELO: mail-oi1-f196.google.com Received: from mail-oi1-f196.google.com (HELO mail-oi1-f196.google.com) (209.85.167.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2020 22:26:42 +0000 Received: by mail-oi1-f196.google.com with SMTP id v140so13519467oie.0 for ; Tue, 14 Jan 2020 14:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CdBZYcqkrxrE3SE33ojD/U8PRO/NB2qSIl+pbf8O+4Y=; b=Eo/1BWKeD2wJLsXETkgAfLYboHET6xTMCa0zLbFMey2d6QKSSNTSFVGjjSalmkIWwR BjV/sBesNO6aAvYLk4zUF0hgqx8tv6940ydfH7HEPZpSkxVgKC2TaueBPD29wMBwtTFH 1AA63EWAMLrUHqOrpfU4oq3eU0FdkUkRW+EnDKlkAiVmYgweE0WI4t4Vl82F4jXcQROD OzgWz6HI92llWA9HkkmkNrTj90lOvtIJGjS5Rr0u2CgEclXlqDTSVFFbC6h31aFrj/B/ iAC2QwvbT+ftHos8FhTQfURrUAaE3JbuJQLd7ldRwQ0yTpTr1OOJN/d4M6IoMI7MefgB +0ng== MIME-Version: 1.0 References: <20200114210956.25115-1-tromey@adacore.com> <20200114210956.25115-3-tromey@adacore.com> In-Reply-To: <20200114210956.25115-3-tromey@adacore.com> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Tue, 14 Jan 2020 23:17:00 -0000 Message-ID: Subject: Re: [PATCH 2/3] Consistently use BFD's time To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00392.txt.bz2 On Tue, Jan 14, 2020 at 4:10 PM Tom Tromey wrote: > > gdb uses the gnulib stat, while BFD does not. This can lead to > inconsistencies between the two, because the gnulib stat adjusts for > timezones. > > This patch changes gdb to use bfd_stat when examining a BFD's time. > This avoids the problem; and also opens the door to caching target > BFDs as well. > > One possible downside here is that gdb must now create a BFD before > checking the cache. > > gdb/ChangeLog > 2020-01-14 Tom Tromey > > * gdb_bfd.c (gdb_bfd_open): Use bfd_stat. > * symfile.c (reread_symbols): Use bfd_stat. > > Change-Id: Ie937630a221cbae15809c99327b47c1cbce141c0 > --- > gdb/ChangeLog | 5 +++++ > gdb/gdb_bfd.c | 49 +++++++++++++++++++++++++------------------------ > gdb/symfile.c | 5 +---- > 3 files changed, 31 insertions(+), 28 deletions(-) > > diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c > index a1ee7814f32..26968396a15 100644 > --- a/gdb/gdb_bfd.c > +++ b/gdb/gdb_bfd.c > @@ -442,8 +442,15 @@ gdb_bfd_open (const char *name, const char *target, int fd) > } > } > > + /* We open the BFD here so that we can use BFD to get the mtime. > + This is important because gdb uses the gnulib stat, but BFD does > + not, and this can lead to differences on some systems. */ Maybe mention that mingw/windows is one of those? Christian