<div dir="ltr"><div dir="ltr">You're right, fixed in r347660. </div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 27, 2018 at 6:24 AM Pavel Labath <<a href="mailto:pavel@labath.sk">pavel@labath.sk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Was it necessary to modify FileSystem to achieve this. It looks like you <br>
could have just as easily made the time_point_cast in <br>
SymbolFileDWARFDebugMap (next to a comment explaining why that was needed).<br>
<br>
The extra nanosecond_precision argument looks fairly odd, and diverges <br>
from how the llvm interfaces for modification times operate.<br>
<br>
On 27/11/2018 00:40, Jonas Devlieghere via lldb-commits wrote:<br>
> Author: jdevlieghere<br>
> Date: Mon Nov 26 15:40:52 2018<br>
> New Revision: 347615<br>
> <br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=347615&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=347615&view=rev</a><br>
> Log:<br>
> [FileSystem] Ignore nanoseconds when comparing oso_mod_time<br>
> <br>
> After a recent change in LLVM the TimePoint encoding become more<br>
> precise, exceeding the precision of the TimePoint obtained from the<br>
> DebugMap. This patch adds a flag to the GetModificationTime helper in<br>
> the FileSystem to return the modification time with less precision.<br>
> <br>
> Thanks to Davide for bisecting this failure on the LLDB bots.<br>
> <br>
> Modified:<br>
>      lldb/trunk/include/lldb/Host/FileSystem.h<br>
>      lldb/trunk/source/Host/common/FileSystem.cpp<br>
>      lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp<br>
> <br>
> Modified: lldb/trunk/include/lldb/Host/FileSystem.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=347615&r1=347614&r2=347615&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=347615&r1=347614&r2=347615&view=diff</a><br>
> ==============================================================================<br>
> --- lldb/trunk/include/lldb/Host/FileSystem.h (original)<br>
> +++ lldb/trunk/include/lldb/Host/FileSystem.h Mon Nov 26 15:40:52 2018<br>
> @@ -56,8 +56,12 @@ public:<br>
>   <br>
>     /// Returns the modification time of the given file.<br>
>     /// @{<br>
> -  llvm::sys::TimePoint<> GetModificationTime(const FileSpec &file_spec) const;<br>
> -  llvm::sys::TimePoint<> GetModificationTime(const llvm::Twine &path) const;<br>
> +  llvm::sys::TimePoint<><br>
> +  GetModificationTime(const FileSpec &file_spec,<br>
> +                      bool nanosecond_precision = true) const;<br>
> +  llvm::sys::TimePoint<><br>
> +  GetModificationTime(const llvm::Twine &path,<br>
> +                      bool nanosecond_precision = true) const;<br>
>     /// @}<br>
>   <br>
>     /// Returns the on-disk size of the given file in bytes.<br>
> <br>
> Modified: lldb/trunk/source/Host/common/FileSystem.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSystem.cpp?rev=347615&r1=347614&r2=347615&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSystem.cpp?rev=347615&r1=347614&r2=347615&view=diff</a><br>
> ==============================================================================<br>
> --- lldb/trunk/source/Host/common/FileSystem.cpp (original)<br>
> +++ lldb/trunk/source/Host/common/FileSystem.cpp Mon Nov 26 15:40:52 2018<br>
> @@ -64,15 +64,22 @@ Optional<FileSystem> &FileSystem::Instan<br>
>   }<br>
>   <br>
>   sys::TimePoint<><br>
> -FileSystem::GetModificationTime(const FileSpec &file_spec) const {<br>
> -  return GetModificationTime(file_spec.GetPath());<br>
> +FileSystem::GetModificationTime(const FileSpec &file_spec,<br>
> +                                bool nanosecond_precision) const {<br>
> +  return GetModificationTime(file_spec.GetPath(), nanosecond_precision);<br>
>   }<br>
>   <br>
> -sys::TimePoint<> FileSystem::GetModificationTime(const Twine &path) const {<br>
> +sys::TimePoint<><br>
> +FileSystem::GetModificationTime(const Twine &path,<br>
> +                                bool nanosecond_precision) const {<br>
>     ErrorOr<vfs::Status> status = m_fs->status(path);<br>
>     if (!status)<br>
>       return sys::TimePoint<>();<br>
> -  return status->getLastModificationTime();<br>
> +  if (nanosecond_precision)<br>
> +    return status->getLastModificationTime();<br>
> +  else<br>
> +    return std::chrono::time_point_cast<std::chrono::seconds>(<br>
> +        status->getLastModificationTime());<br>
>   }<br>
>   <br>
>   uint64_t FileSystem::GetByteSize(const FileSpec &file_spec) const {<br>
> <br>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=347615&r1=347614&r2=347615&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=347615&r1=347614&r2=347615&view=diff</a><br>
> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Mon Nov 26 15:40:52 2018<br>
> @@ -420,7 +420,8 @@ Module *SymbolFileDWARFDebugMap::GetModu<br>
>         FileSpec oso_file(oso_path);<br>
>         ConstString oso_object;<br>
>         if (FileSystem::Instance().Exists(oso_file)) {<br>
> -        auto oso_mod_time = FileSystem::Instance().GetModificationTime(oso_file);<br>
> +        auto oso_mod_time = FileSystem::Instance().GetModificationTime(<br>
> +            oso_file, /*nanosecond_precision=*/false);<br>
>           if (oso_mod_time != comp_unit_info->oso_mod_time) {<br>
>             obj_file->GetModule()->ReportError(<br>
>                 "debug map object file '%s' has changed (actual time is "<br>
> <br>
> <br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
> <br>
<br>
</blockquote></div>