[Lldb-commits] [lldb] f2da1f6 - Get Section from resolved_addr in Target::ReadMemory
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 20 12:09:12 PDT 2021
Author: Jason Molenda
Date: 2021-04-20T12:09:06-07:00
New Revision: f2da1f68d815f97e1211da62e7e1f102941947e3
URL: https://github.com/llvm/llvm-project/commit/f2da1f68d815f97e1211da62e7e1f102941947e3
DIFF: https://github.com/llvm/llvm-project/commit/f2da1f68d815f97e1211da62e7e1f102941947e3.diff
LOG: Get Section from resolved_addr in Target::ReadMemory
Landing this fix for Augusto Noronha. The code is getting the
Section from 'addr' passed in, but it may have been expressed as
a load address when it was created and Target::ReadMemory tries to
convert it to a Section+offset if that's now possible; use the
Section found from that cleanup if it exists.
Differential Revision: https://reviews.llvm.org/D100850
Added:
Modified:
lldb/source/Target/Target.cpp
Removed:
################################################################################
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 177efa8f8f28..53bf64d5986a 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1756,7 +1756,7 @@ size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
bool is_readonly = false;
// Read from file cache if read-only section.
if (!force_live_memory && resolved_addr.IsSectionOffset()) {
- SectionSP section_sp(addr.GetSection());
+ SectionSP section_sp(resolved_addr.GetSection());
if (section_sp) {
auto permissions = Flags(section_sp->GetPermissions());
is_readonly = !permissions.Test(ePermissionsWritable) &&
More information about the lldb-commits
mailing list