diff options
Diffstat (limited to 'source/Plugins/ObjectFile')
8 files changed, 21 insertions, 20 deletions
diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 0720cca273410..b71d6fa4ebead 100644 --- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -25,8 +25,8 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferLLVM.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" #include "llvm/ADT/PointerUnion.h" @@ -727,8 +727,9 @@ size_t ObjectFileELF::GetModuleSpecifications( uint32_t core_notes_crc = 0; if (!gnu_debuglink_crc) { + static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); lldb_private::Timer scoped_timer( - LLVM_PRETTY_FUNCTION, + func_cat, "Calculating module crc32 %s with size %" PRIu64 " KiB", file.GetLastPathComponent().AsCString(), (file.GetByteSize() - file_offset) / 1024); @@ -1079,7 +1080,7 @@ Address ObjectFileELF::GetImageInfoAddress(Target *target) { if (dyn_base == LLDB_INVALID_ADDRESS) return Address(); - Error error; + Status error; if (symbol.d_tag == DT_MIPS_RLD_MAP) { // DT_MIPS_RLD_MAP tag stores an absolute address of the debug pointer. Address addr; @@ -1232,12 +1233,12 @@ size_t ObjectFileELF::ParseProgramHeaders() { m_header); } -lldb_private::Error +lldb_private::Status ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data, lldb_private::ArchSpec &arch_spec, lldb_private::UUID &uuid) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_MODULES)); - Error error; + Status error; lldb::offset_t offset = 0; @@ -1763,7 +1764,7 @@ size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, DataExtractor data; if (section_size && (set_data(data, sheader.sh_offset, section_size) == section_size)) { - Error error = RefineModuleDetailsFromNote(data, arch_spec, uuid); + Status error = RefineModuleDetailsFromNote(data, arch_spec, uuid); if (error.Fail()) { if (log) log->Printf("ObjectFileELF::%s ELF note processing failed: %s", diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 9b2d58b7be82a..06f1a4d22d2dc 100644 --- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -375,7 +375,7 @@ private: unsigned PLTRelocationType(); - static lldb_private::Error + static lldb_private::Status RefineModuleDetailsFromNote(lldb_private::DataExtractor &data, lldb_private::ArchSpec &arch_spec, lldb_private::UUID &uuid); diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 84ecfdc67bee3..1a4ae1a21aecc 100644 --- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -40,9 +40,9 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" #include "lldb/Utility/DataBufferLLVM.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/UUID.h" @@ -2121,8 +2121,8 @@ UUID ObjectFileMachO::GetSharedCacheUUID(FileSpec dyld_shared_cache, } size_t ObjectFileMachO::ParseSymtab() { - Timer scoped_timer(LLVM_PRETTY_FUNCTION, - "ObjectFileMachO::ParseSymtab () module = %s", + static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); + Timer scoped_timer(func_cat, "ObjectFileMachO::ParseSymtab () module = %s", m_file.GetFilename().AsCString("")); ModuleSP module_sp(GetModule()); if (!module_sp) @@ -3850,7 +3850,7 @@ size_t ObjectFileMachO::ParseSymtab() { symbol_name = NULL; } else { const addr_t str_addr = strtab_addr + nlist.n_strx; - Error str_error; + Status str_error; if (process->ReadCStringFromMemory(str_addr, memory_symbol_name, str_error)) symbol_name = memory_symbol_name.c_str(); @@ -5968,7 +5968,7 @@ bool ObjectFileMachO::SetLoadAddress(Target &target, lldb::addr_t value, } bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, - const FileSpec &outfile, Error &error) { + const FileSpec &outfile, Status &error) { if (process_sp) { Target &target = process_sp->GetTarget(); const ArchSpec target_arch = target.GetArchitecture(); @@ -5997,7 +5997,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, std::vector<segment_command_64> segment_load_commands; // uint32_t range_info_idx = 0; MemoryRegionInfo range_info; - Error range_error = process_sp->GetMemoryRegionInfo(0, range_info); + Status range_error = process_sp->GetMemoryRegionInfo(0, range_info); const uint32_t addr_byte_size = target_arch.GetAddressByteSize(); const ByteOrder byte_order = target_arch.GetByteOrder(); if (range_error.Success()) { @@ -6231,7 +6231,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp, segment.vmsize, segment.vmaddr); addr_t bytes_left = segment.vmsize; addr_t addr = segment.vmaddr; - Error memory_read_error; + Status memory_read_error; while (bytes_left > 0 && error.Success()) { const size_t bytes_to_read = bytes_left > sizeof(bytes) ? sizeof(bytes) : bytes_left; diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index 96379a4db4117..9a42f41a4c949 100644 --- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -67,7 +67,7 @@ public: static bool SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, - lldb_private::Error &error); + lldb_private::Status &error); static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length); diff --git a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index c89383a7b7ba4..dcb9527f24c85 100644 --- a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -145,7 +145,7 @@ size_t ObjectFilePECOFF::GetModuleSpecifications( bool ObjectFilePECOFF::SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, - lldb_private::Error &error) { + lldb_private::Status &error) { return SaveMiniDump(process_sp, outfile, error); } @@ -440,7 +440,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) { DataExtractor data; if (process_sp) { auto data_ap = llvm::make_unique<DataBufferHeap>(size, 0); - Error readmem_error; + Status readmem_error; size_t bytes_read = process_sp->ReadMemory(m_image_base + offset, data_ap->GetBytes(), data_ap->GetByteSize(), readmem_error); diff --git a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h index 2313047735e0c..d8a94e19d34f4 100644 --- a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++ b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h @@ -85,7 +85,7 @@ public: static bool SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, - lldb_private::Error &error); + lldb_private::Status &error); static bool MagicBytesMatch(lldb::DataBufferSP &data_sp); diff --git a/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp b/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp index 094e258a7a038..d6553f6e51425 100644 --- a/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp +++ b/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp @@ -23,7 +23,7 @@ namespace lldb_private { bool SaveMiniDump(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, - lldb_private::Error &error) { + lldb_private::Status &error) { if (!process_sp) return false; #ifdef _WIN32 diff --git a/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h b/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h index 3f741dc04f514..135d533873876 100644 --- a/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h +++ b/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h @@ -16,7 +16,7 @@ namespace lldb_private { bool SaveMiniDump(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, - lldb_private::Error &error); + lldb_private::Status &error); } // namespace lldb_private |