diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 | 
| commit | b76161e41bc2c07cd47f9c61f875d1be95e26d10 (patch) | |
| tree | d03c19ce10dec6419f97df1d4dac9d47eb88982f /source/Symbol/ObjectFile.cpp | |
| parent | 8b4000f13b303cc154136abc74c55670673e2a96 (diff) | |
Notes
Diffstat (limited to 'source/Symbol/ObjectFile.cpp')
| -rw-r--r-- | source/Symbol/ObjectFile.cpp | 25 | 
1 files changed, 14 insertions, 11 deletions
| diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp index 483a315defbd..c970de6fef06 100644 --- a/source/Symbol/ObjectFile.cpp +++ b/source/Symbol/ObjectFile.cpp @@ -37,8 +37,9 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,    ObjectFileSP object_file_sp;    if (module_sp) { +    static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);      Timer scoped_timer( -        LLVM_PRETTY_FUNCTION, +        func_cat,          "ObjectFile::FindPlugin (module = %s, file = %p, file_offset = "          "0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",          module_sp->GetFileSpec().GetPath().c_str(), @@ -176,9 +177,11 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,    ObjectFileSP object_file_sp;    if (module_sp) { -    Timer scoped_timer(LLVM_PRETTY_FUNCTION, "ObjectFile::FindPlugin (module = " -                                             "%s, process = %p, header_addr = " -                                             "0x%" PRIx64 ")", +    static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); +    Timer scoped_timer(func_cat, +                       "ObjectFile::FindPlugin (module = " +                       "%s, process = %p, header_addr = " +                       "0x%" PRIx64 ")",                         module_sp->GetFileSpec().GetPath().c_str(),                         static_cast<void *>(process_sp.get()), header_addr);      uint32_t idx; @@ -454,7 +457,7 @@ DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,    DataBufferSP data_sp;    if (process_sp) {      std::unique_ptr<DataBufferHeap> data_ap(new DataBufferHeap(byte_size, 0)); -    Error error; +    Status error;      const size_t bytes_read = process_sp->ReadMemory(          addr, data_ap->GetBytes(), data_ap->GetByteSize(), error);      if (bytes_read == byte_size) @@ -493,7 +496,7 @@ size_t ObjectFile::ReadSectionData(const Section *section,    if (IsInMemory()) {      ProcessSP process_sp(m_process_wp.lock());      if (process_sp) { -      Error error; +      Status error;        const addr_t base_load_addr =            section->GetLoadBaseAddress(&process_sp->GetTarget());        if (base_load_addr != LLDB_INVALID_ADDRESS) @@ -654,17 +657,17 @@ ConstString ObjectFile::GetNextSyntheticSymbolName() {    return ConstString(ss.GetString());  } -Error ObjectFile::LoadInMemory(Target &target, bool set_pc) { -  Error error; +Status ObjectFile::LoadInMemory(Target &target, bool set_pc) { +  Status error;    ProcessSP process = target.CalculateProcess();    if (!process) -    return Error("No Process"); +    return Status("No Process");    if (set_pc && !GetEntryPointAddress().IsValid()) -    return Error("No entry address in object file"); +    return Status("No entry address in object file");    SectionList *section_list = GetSectionList();    if (!section_list) -      return Error("No section in object file"); +    return Status("No section in object file");    size_t section_count = section_list->GetNumSections(0);    for (size_t i = 0; i < section_count; ++i) {      SectionSP section_sp = section_list->GetSectionAtIndex(i); | 
