summaryrefslogtreecommitdiff
path: root/source/Target/SectionLoadList.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:58 +0000
commitf1d04915a666728c241bedb36bd99aafee3ea444 (patch)
treed63378f567f214209764be264c47c8b0814e1665 /source/Target/SectionLoadList.cpp
parent60bb8ce74a67345b14fd540dd739254f562c605b (diff)
Notes
Diffstat (limited to 'source/Target/SectionLoadList.cpp')
-rw-r--r--source/Target/SectionLoadList.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/Target/SectionLoadList.cpp b/source/Target/SectionLoadList.cpp
index 7f12c262f47e..31ccf17369db 100644
--- a/source/Target/SectionLoadList.cpp
+++ b/source/Target/SectionLoadList.cpp
@@ -207,8 +207,8 @@ bool SectionLoadList::SetSectionUnloaded(const lldb::SectionSP &section_sp,
return erased;
}
-bool SectionLoadList::ResolveLoadAddress(addr_t load_addr,
- Address &so_addr) const {
+bool SectionLoadList::ResolveLoadAddress(addr_t load_addr, Address &so_addr,
+ bool allow_section_end) const {
// First find the top level section that this load address exists in
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (!m_addr_to_sect.empty()) {
@@ -220,10 +220,11 @@ bool SectionLoadList::ResolveLoadAddress(addr_t load_addr,
const addr_t pos_load_addr = pos->first;
if (load_addr >= pos_load_addr) {
addr_t offset = load_addr - pos_load_addr;
- if (offset < pos->second->GetByteSize()) {
+ if (offset < pos->second->GetByteSize() + (allow_section_end ? 1 : 0)) {
// We have found the top level section, now we need to find the
// deepest child section.
- return pos->second->ResolveContainedAddress(offset, so_addr);
+ return pos->second->ResolveContainedAddress(offset, so_addr,
+ allow_section_end);
}
}
} else {
@@ -233,10 +234,12 @@ bool SectionLoadList::ResolveLoadAddress(addr_t load_addr,
m_addr_to_sect.rbegin();
if (load_addr >= rpos->first) {
addr_t offset = load_addr - rpos->first;
- if (offset < rpos->second->GetByteSize()) {
+ if (offset <
+ rpos->second->GetByteSize() + (allow_section_end ? 1 : 0)) {
// We have found the top level section, now we need to find the
// deepest child section.
- return rpos->second->ResolveContainedAddress(offset, so_addr);
+ return rpos->second->ResolveContainedAddress(offset, so_addr,
+ allow_section_end);
}
}
}