Skip to content

Commit

Permalink
Get Section from resolved_addr in Target::ReadMemory
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jasonmolenda committed Apr 20, 2021
1 parent 9816d43 commit f2da1f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/source/Target/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit f2da1f6

Please sign in to comment.