This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gnulib stat problem (Was: [pushed] Update Gnulib to the latest git version)
- From: "Hannes Domani via gdb-patches" <gdb-patches at sourceware dot org>
- To: Christian Biesinger <cbiesinger at google dot com>, Tom Tromey <tom at tromey dot com>
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>, gdb-patches at sourceware dot org, palves at redhat dot com
- Date: Tue, 14 Jan 2020 17:03:21 +0000 (UTC)
- Subject: Re: gnulib stat problem (Was: [pushed] Update Gnulib to the latest git version)
- References: <gerrit.1573970717000.I9c2b07a3046baecfb664e21b2644353ea888dbfa@gnutoolchain-gerrit.osci.io> <20191216182208.22D882816F@gnutoolchain-gerrit.osci.io> <87imle7z8x.fsf_-_@tromey.com>
- Reply-to: Hannes Domani <ssbssa at yahoo dot de>
Am Dienstag, 14. Januar 2020, 17:57:10 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:
> >> Update Gnulib to the latest git version
>
> I think that this patch introduced a regression on Windows, and I'm
> wondering what to do about it.
>
> After merging this in locally, we saw some gdb crashes. I have a patch
> for the crash (will send it soon), but there's still a problem.
> Specifically, the first time I "run", gdb always thinks the executable
> has changed, even if it has not:
>
> (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.
>
> 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.
I reported this issue some time ago:
https://sourceware.org/bugzilla/show_bug.cgi?id=25302