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
This commit is contained in:
parent
9816d43cff
commit
f2da1f68d8
|
@ -1756,7 +1756,7 @@ size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
|
||||||
bool is_readonly = false;
|
bool is_readonly = false;
|
||||||
// Read from file cache if read-only section.
|
// Read from file cache if read-only section.
|
||||||
if (!force_live_memory && resolved_addr.IsSectionOffset()) {
|
if (!force_live_memory && resolved_addr.IsSectionOffset()) {
|
||||||
SectionSP section_sp(addr.GetSection());
|
SectionSP section_sp(resolved_addr.GetSection());
|
||||||
if (section_sp) {
|
if (section_sp) {
|
||||||
auto permissions = Flags(section_sp->GetPermissions());
|
auto permissions = Flags(section_sp->GetPermissions());
|
||||||
is_readonly = !permissions.Test(ePermissionsWritable) &&
|
is_readonly = !permissions.Test(ePermissionsWritable) &&
|
||||||
|
|
Loading…
Reference in a new issue