summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Section.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/Section.cpp')
-rw-r--r--lldb/source/Core/Section.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 492abec357b..e2a084ceb2f 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -98,6 +98,24 @@ Section::GetFileAddress () const
return m_file_addr;
}
+bool
+Section::SetFileAddress (lldb::addr_t file_addr)
+{
+ SectionSP parent_sp (GetParent ());
+ if (parent_sp)
+ {
+ if (m_file_addr >= file_addr)
+ return parent_sp->SetFileAddress (m_file_addr - file_addr);
+ return false;
+ }
+ else
+ {
+ // This section has no parent, so m_file_addr is the file base address
+ m_file_addr = file_addr;
+ return true;
+ }
+}
+
lldb::addr_t
Section::GetOffset () const
{
OpenPOWER on IntegriCloud