diff options
-rw-r--r-- | lldb/include/lldb/Host/FileSystem.h | 8 | ||||
-rw-r--r-- | lldb/source/Host/common/FileSystem.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 12 |
3 files changed, 12 insertions, 23 deletions
diff --git a/lldb/include/lldb/Host/FileSystem.h b/lldb/include/lldb/Host/FileSystem.h index bfc5f93f696..2122860a5f6 100644 --- a/lldb/include/lldb/Host/FileSystem.h +++ b/lldb/include/lldb/Host/FileSystem.h @@ -56,12 +56,8 @@ public: /// Returns the modification time of the given file. /// @{ - llvm::sys::TimePoint<> - GetModificationTime(const FileSpec &file_spec, - bool nanosecond_precision = true) const; - llvm::sys::TimePoint<> - GetModificationTime(const llvm::Twine &path, - bool nanosecond_precision = true) const; + llvm::sys::TimePoint<> GetModificationTime(const FileSpec &file_spec) const; + llvm::sys::TimePoint<> GetModificationTime(const llvm::Twine &path) const; /// @} /// Returns the on-disk size of the given file in bytes. diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp index db218a3f763..a0105997589 100644 --- a/lldb/source/Host/common/FileSystem.cpp +++ b/lldb/source/Host/common/FileSystem.cpp @@ -64,22 +64,15 @@ Optional<FileSystem> &FileSystem::InstanceImpl() { } sys::TimePoint<> -FileSystem::GetModificationTime(const FileSpec &file_spec, - bool nanosecond_precision) const { - return GetModificationTime(file_spec.GetPath(), nanosecond_precision); +FileSystem::GetModificationTime(const FileSpec &file_spec) const { + return GetModificationTime(file_spec.GetPath()); } -sys::TimePoint<> -FileSystem::GetModificationTime(const Twine &path, - bool nanosecond_precision) const { +sys::TimePoint<> FileSystem::GetModificationTime(const Twine &path) const { ErrorOr<vfs::Status> status = m_fs->status(path); if (!status) return sys::TimePoint<>(); - if (nanosecond_precision) - return status->getLastModificationTime(); - else - return std::chrono::time_point_cast<std::chrono::seconds>( - status->getLastModificationTime()); + return status->getLastModificationTime(); } uint64_t FileSystem::GetByteSize(const FileSpec &file_spec) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index fa07fd1ebde..fa6ace8c3bb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -86,8 +86,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap( const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1; for (uint32_t idx = comp_unit_info->first_symbol_index + 2; // Skip the N_SO and N_OSO - idx < oso_end_idx; - ++idx) { + idx < oso_end_idx; ++idx) { Symbol *exe_symbol = exe_symtab->SymbolAtIndex(idx); if (exe_symbol) { if (exe_symbol->IsDebug() == false) @@ -420,8 +419,10 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo( FileSpec oso_file(oso_path); ConstString oso_object; if (FileSystem::Instance().Exists(oso_file)) { - auto oso_mod_time = FileSystem::Instance().GetModificationTime( - oso_file, /*nanosecond_precision=*/false); + // The modification time returned by the FS can have a higher precision + // than the one from the CU. + auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>( + FileSystem::Instance().GetModificationTime(oso_file)); if (oso_mod_time != comp_unit_info->oso_mod_time) { obj_file->GetModule()->ReportError( "debug map object file '%s' has changed (actual time is " @@ -802,8 +803,7 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables( const ConstString &name, const CompilerDeclContext *parent_decl_ctx, const std::vector<uint32_t> &indexes, // Indexes into the symbol table that match "name" - uint32_t max_matches, - VariableList &variables) { + uint32_t max_matches, VariableList &variables) { const uint32_t original_size = variables.GetSize(); const size_t match_count = indexes.size(); for (size_t i = 0; i < match_count; ++i) { |