Index: lldb/source/Target/Target.cpp =================================================================== --- lldb/source/Target/Target.cpp +++ lldb/source/Target/Target.cpp @@ -1782,36 +1782,27 @@ if (ProcessIsValid()) { if (load_addr == LLDB_INVALID_ADDRESS) load_addr = resolved_addr.GetLoadAddress(this); - - if (load_addr == LLDB_INVALID_ADDRESS) { - ModuleSP addr_module_sp(resolved_addr.GetModule()); - if (addr_module_sp && addr_module_sp->GetFileSpec()) - error.SetErrorStringWithFormatv( - "{0:F}[{1:x+}] can't be resolved, {0:F} is not currently loaded", - addr_module_sp->GetFileSpec(), resolved_addr.GetFileAddress()); - else - error.SetErrorStringWithFormat("0x%" PRIx64 " can't be resolved", - resolved_addr.GetFileAddress()); - } else { - bytes_read = m_process_sp->ReadMemory(load_addr, dst, dst_len, error); - if (bytes_read != dst_len) { - if (error.Success()) { - if (bytes_read == 0) - error.SetErrorStringWithFormat( - "read memory from 0x%" PRIx64 " failed", load_addr); - else - error.SetErrorStringWithFormat( - "only %" PRIu64 " of %" PRIu64 - " bytes were read from memory at 0x%" PRIx64, - (uint64_t)bytes_read, (uint64_t)dst_len, load_addr); - } - } - if (bytes_read) { - if (load_addr_ptr) - *load_addr_ptr = load_addr; - return bytes_read; + if (load_addr == LLDB_INVALID_ADDRESS) + load_addr = resolved_addr.GetFileAddress(); + + bytes_read = m_process_sp->ReadMemory(load_addr, dst, dst_len, error); + if (bytes_read != dst_len) { + if (error.Success()) { + if (bytes_read == 0) + error.SetErrorStringWithFormat( + "read memory from 0x%" PRIx64 " failed", load_addr); + else + error.SetErrorStringWithFormat( + "only %" PRIu64 " of %" PRIu64 + " bytes were read from memory at 0x%" PRIx64, + (uint64_t)bytes_read, (uint64_t)dst_len, load_addr); } } + if (bytes_read) { + if (load_addr_ptr) + *load_addr_ptr = load_addr; + return bytes_read; + } } if (file_cache_read_buffer && file_cache_bytes_read > 0) {