From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122412 invoked by alias); 14 Jan 2020 19:46:41 -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 122401 invoked by uid 89); 14 Jan 2020 19:46:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=convince X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2020 19:46:30 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1irS8x-0006mX-Qh; Tue, 14 Jan 2020 14:46:29 -0500 Received: from [176.228.60.248] (port=4255 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1irS8x-0008FY-3J; Tue, 14 Jan 2020 14:46:27 -0500 Date: Tue, 14 Jan 2020 21:10:00 -0000 Message-Id: <834kwx6cte.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey CC: cbiesinger@google.com, simon.marchi@polymtl.ca, gdb-patches@sourceware.org, palves@redhat.com In-reply-to: <87imle7z8x.fsf_-_@tromey.com> (message from Tom Tromey on Tue, 14 Jan 2020 09:56:46 -0700) Subject: Re: gnulib stat problem (Was: [pushed] Update Gnulib to the latest git version) References: <20191216182208.22D882816F@gnutoolchain-gerrit.osci.io> <87imle7z8x.fsf_-_@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00386.txt.bz2 > From: Tom Tromey > CC: Simon Marchi , gdb-patches@sourceware.org, palves@redhat.com > Date: Tue, 14 Jan 2020 09:56:46 -0700 > > (gdb) file ./t.exe > Reading symbols from ./t.exe... > (gdb) run > `C:\home\tromey\t.exe' has changed; re-reading symbols. > Starting program: C:\home\tromey\t.exe > > I believe what is happening here is that gdb is using the gnulib stat > (or fstat or whatever), which adjusts for timezone; but BFD is using > plain stat, which does not. However, gdb will end up comparing an > time_t coming from the gnulib stat with a time_t coming from > bfd_get_mtime, which causes this problem. Been there, done that, have scars to prove. > I suppose the principled answer is to change BFD and the rest of the > tree to use gnulib. This seems like a pain, so I'd rather avoid it. > Also, if binutils doesn't want this, we'll still have the bug. > > Another idea would be to avoid bfd_get_mtime entirely in gdb. I don't > know how feasible this is, given that (I think) we need it to call > through the iovec. > > Maybe gdb could *only* use bfd_get_mtime when it matters. This would > mean changing gdb_bfd_open to create a BFD before checking the cache, > but maybe that's not very expensive. > > I'd appreciate your thoughts on the topic. Regardless of what we do about this particular issue, maybe you could report this to bug-gnulib, as one more evidence how redefining 'stat' in Gnulib causes problems. Because my report about a similar problem, here: https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00205.html didn't convince the Gnulib developers. Thanks.