diff options
author | Pavel Labath <labath@google.com> | 2016-11-09 09:59:18 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-11-09 09:59:18 +0000 |
commit | 7e2cfbf0b7001cc49f918e0d1cfe94b527764fd3 (patch) | |
tree | d2e76aa452b3f86f7d26feabf0f583807df92fb8 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | |
parent | 25143dfd48ea7f52d3066ff73a6c99f0f1bae1da (diff) | |
download | bcm5719-llvm-7e2cfbf0b7001cc49f918e0d1cfe94b527764fd3.tar.gz bcm5719-llvm-7e2cfbf0b7001cc49f918e0d1cfe94b527764fd3.zip |
Remove TimeValue usage from Core/Module
Summary:
The only interesting part here is that TimePoint and TimeValue have different
natural string representations, which affects "target modules list" output. It
is now "2016-07-09 04:02:21.000000000", whereas previously in was
"Sat Jul 9 04:02:21 2016". I wanted to check if we're OK with that.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26275
llvm-svn: 286349
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index f843824703c..567ac88fdf0 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -35,6 +35,7 @@ #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Symbol/TypeMap.h" #include "lldb/Symbol/VariableList.h" +#include "llvm/Support/ScopedPrinter.h" #include "LogChannelDWARF.h" #include "SymbolFileDWARF.h" @@ -175,9 +176,8 @@ public: DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx, const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name, off_t object_offset, - const TimeValue *object_mod_time_ptr) - : Module(file_spec, arch, object_name, object_offset, - object_mod_time_ptr), + const llvm::sys::TimePoint<> object_mod_time) + : Module(file_spec, arch, object_name, object_offset, object_mod_time), m_exe_module_wp(exe_module_sp), m_cu_idx(cu_idx) {} ~DebugMapModule() override = default; @@ -355,9 +355,8 @@ void SymbolFileDWARFDebugMap::InitOSO() { m_compile_unit_infos[i].so_file.SetFile( so_symbol->GetName().AsCString(), false); m_compile_unit_infos[i].oso_path = oso_symbol->GetName(); - TimeValue oso_mod_time; - oso_mod_time.OffsetWithSeconds(oso_symbol->GetIntegerValue(0)); - m_compile_unit_infos[i].oso_mod_time = oso_mod_time; + m_compile_unit_infos[i].oso_mod_time = + llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0)); uint32_t sibling_idx = so_symbol->GetSiblingIndex(); // The sibling index can't be less that or equal to the current index // "i" @@ -425,15 +424,14 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo( FileSpec oso_file(oso_path, false); ConstString oso_object; if (oso_file.Exists()) { - TimeValue oso_mod_time(FileSystem::GetModificationTime(oso_file)); + auto oso_mod_time = FileSystem::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 " - "0x%" PRIx64 ", debug map time is 0x%" PRIx64 + "%s, debug map time is %s" ") since this executable was linked, file will be ignored", - oso_file.GetPath().c_str(), - oso_mod_time.GetAsSecondsSinceJan1_1970(), - comp_unit_info->oso_mod_time.GetAsSecondsSinceJan1_1970()); + oso_file.GetPath().c_str(), llvm::to_string(oso_mod_time).c_str(), + llvm::to_string(comp_unit_info->oso_mod_time).c_str()); return NULL; } @@ -464,7 +462,8 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo( comp_unit_info->oso_sp->module_sp.reset(new DebugMapModule( obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file, oso_arch, oso_object ? &oso_object : NULL, 0, - oso_object ? &comp_unit_info->oso_mod_time : NULL)); + oso_object ? comp_unit_info->oso_mod_time + : llvm::sys::TimePoint<>())); } } if (comp_unit_info->oso_sp) |