This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] New testcase for PR tui/25126 (staled source cache)
On Tuesday, February 11 2020, Andrew Burgess wrote:
> * Sergio Durigan Junior <sergiodj@redhat.com> [2020-02-10 15:02:20 -0500]:
[...]
>> +close $bkpsrcfd
>> +close $srcfd
>> +file rename -force -- $bkpsrc $srcfile
>> +# Here, we have to wait 1 second because of the way GDB keeps track to
>> +# check whether the binary has changed or not. GDB uses stat(2) and
>> +# currently checks 'st_mtime', whose precision is measured in
>> +# seconds. Since the whole file-copying/rename operation can take
>> +# less than 1 second, GDB can mistakenly assume that the binary is
>> +# still the same if we don't wait here.
>
> Maybe rewrite this comment as:
>
> We have to wait 1 second because of the way GDB checks whether the
> binary has changed or not. GDB uses stat(2) and currently checks
> 'st_mtime', whose precision is measured in seconds. Since the copy,
> rename, and rebuild can take less than 1 second, GDB might mistakenly
> assume that the binary is unchanged.
>
> Otherwise this looks good to me and can be applied.
Thanks, I adopted your version of the text and pushed the patch.
f6be87130b5b327075a09c05e78532816f186995
Thank you and Luis for the reviews.
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/